自行实现(笨办法) class LoginData{ final int code; final String msg; final List<DataItem> data; LoginData({required this.code, required this.msg, req
Context是操作资源和系统服务的基础,LocalContext可以在任意compose层级访问,compose框架会自动将Context绑定在当前的Activity或Fragment上。 与系统服务交互 Toast提示信息 val context = LocalContext.curre
tabbar页面之间切换时会卸载(清理所有状态),解决这个问题。 变量、页面滚动状态等都可以保存 class _Page1State extends State<Page1> with AutomaticKeepAliveClientMixin { @override bool get w
本地存储 依赖:https://pub.dev/packages/shared_preferences 安装 flutter pub add shared_preferences 获取实例 var i = await SharedPreferences.getInstance()
识别一维/二维码目前用了多个模块中最好用的,在安卓中内部使用的是MLKit的barcode scanning捆绑版本,APP体积增加约3~10M。 google官方提供了barcode scanner但是没有捆绑版本(必须有谷歌套件)。 MLKit官方网址:https://developers.go
请求API、上传文件等 链接:https://pub.dev/packages/http 引入依赖 pubspec.yaml dependencies: http: ^1.4.0 http_parser: ^4.1.2 get请求 var response = await http.
0).如果使用CNG 如果用了blank模版(项目中没有android目录)则先在项目根目录中执行命令: npx expo prebuild 1).生成上传密钥 expo项目根目录中执行命令: #macOS sudo keytool -genkey -v -keystore my-upload-ke