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

outdated

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.intstance(appId: "appId", appSecret: "appSecret"); 不需要调用登录的初始化 await WitsystemCore.intstance(appId: "appId", appSecret: "appSecret",token:"token",rsaParseKey:" rsaParseKey");

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");

#注意 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.

0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

witsystem 核心包,提供核心功能

License

unknown (LICENSE)

Dependencies

dio, encrypt, flutter, intl, pointycastle, shared_preferences

More

Packages that depend on witsystem_core