witsystem_core 0.1.7 copy "witsystem_core: ^0.1.7" to clipboard
witsystem_core: ^0.1.7 copied to clipboard

witsystem 核心包,提供核心功能

witsystem_core #

witsystem 核心包,提供核心功能

集成使用 #

1.导入 #

import 'package:witsystem_core/generated/l10n.dart' as witsystem_core ;

2.启用国际化文件 #

localizationsDelegates: const [ witsystem_core.S.delegate, GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate ],

3.初始化核心包 #

下面的初始化之前必须先调用 await WitsystemCore.initCore();

需要登录调用核心包登录的初始化 await WitsystemCore.intstance(appId: "appId", appSecret: "appSecret"); 不需要调用登录的初始化 await WitsystemCore.passwordLoginInstance(appId: "appId", appSecret: "appSecret",userId:"userId",password:" password");//密码登出初始化 await WitsystemCore.codeLoginInstance(appId: "appId", appSecret: "appSecret",userId:"userId",code:" code");//验证码登出初始化

4.核心包提供功能分为页面和api 页面主要是弹出框统一页面 #

核心使用文档 #

弹出页面的使用 #

sheet页面 #

showModalBottomSheet( context: context, isDismissible: true, barrierColor: Colors.black26, backgroundColor: const Color( 0x00000000), builder: (BuildContext context) { return WitsystemBottomSheet( sheetItem: sheetItem, onTap: (index) { _sheetClick(itemIndex, index); }, ); });

dialog页面 #

Widget widget=DialogCenterHintWidget();//弹出对话框中间提示 Widget widget= DialogCenterInputWidget() ;//弹出对话框中间输入

showDialog( context: context, barrierDismissible: true, builder: (BuildContext context) { return widget!; });

异常处理 #

http 请求异常 NetError #

NetError.error("code");

蓝牙异常 BleError #

NetError.error("code");

指令异常 CommandError #

NetError.error("code");

SDK初始化异常 SdkError #

SdkError.error("code"); ##提供自动的异常处理函数 AutoErrorHandle.autou();

提供的工具 #

字符串工具 StringUtil #

正则表达类 WitsRegExp #

用户 #

1.用户的基本功能,登录登出等和登录用户的基本信息 UserInfo #

2.使用标记功能,比如备注每一个用户的名称 UserRemarks #

加密 #

1.提供 RSA #

1.提供 AES #

参看文档 https://pub.dev/packages/encrypt #

数据 #

1. 当前只提供了 CacheManage做数据的保存 #

网络请求 #

1.提供带有签名和不带签名的两种POST请求 WitsystemNet #

pdf #

提供pdf 查看页面PdfViewWidget 和集成了syncfusion_flutter_pdfviewer #

#提供权限申请 WitsPermission

#提供图片保存功能 使用的插件名称image_gallery_saver 文档https://pub.dev/packages/image_gallery_saver #提供文件路径插件 path_provider 官方文档 https://pub.dev/packages/path_provider/install 参考文档 https://www.jianshu.com/p/07aa3ee93c7c #提供相册或者相机的widget ImageSheet #提供生成二维码widget WitsQrIamge #提供扫描二维码 Scan #提供mqtt WitsMqtt

#注意 1.在国际化中如果使用文字嵌入 如:"hint":"{name}确认了信息"。如果是这样的嵌入模式希望该成 "sdk名称_hint":"{name}确认了信息"这个。 不然如果 A和B两个模块同时带有hint 并且A模块没有嵌入参数B嵌入参数者时候就会报错。 2.在国际化中如果怕自己的文字被其他模块覆盖请求在key 中加入自己的SDK名称 如 sdk名称_key名称,如果两个SDK出现相同的key 其中一个将会被覆盖

Getting Started #

This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.