上一页 1 2 3 4 5 6 7 ··· 21 下一页
摘要: 安卓 package com.example.xcx_dashan_app; import io.flutter.embedding.android.FlutterActivity; import android.annotation.SuppressLint; import android.con 阅读全文
posted @ 2024-04-25 10:51 鲤斌 阅读(108) 评论(0) 推荐(0)
摘要: android_intent_plus: ^5.0.2 只支持Android,既能指定packageName,也能传入url,可以跳转到指定APP的某个页面,不适用iOS void openApp() { AndroidIntent intent = AndroidIntent( action: ' 阅读全文
posted @ 2024-04-22 11:13 鲤斌 阅读(592) 评论(0) 推荐(0)
摘要: url_launcher: ^6.2.5 在Flutter中,url_launcher库是用于在移动应用程序中打开URL的常用工具。它允许你通过调用系统的浏览器或其他应用程序来打开指定的URL,比如网页链接、电子邮件链接、电话号码等。这个库提供了一种简单的方法来实现在应用中跳转到外部链接的功能,增强 阅读全文
posted @ 2024-04-22 11:02 鲤斌 阅读(464) 评论(0) 推荐(0)
摘要: 依赖 package_info_plus: ^7.0.0 path_provider: ^2.1.2 #查找文件 获取文件存储路径 open_file: ^3.3.2 # 打开文件插件 permission_handler: ^11.3.1 #检测 Apk 是否拥有权限 配置权限 <!-- 在 An 阅读全文
posted @ 2024-04-12 22:36 鲤斌 阅读(256) 评论(0) 推荐(0)
摘要: 依赖 sqflite: ^2.3.2 #本地数据储存 获取数据库路径 // 定义一个异步函数来获取数据库路径 Future<String> getDatabasePath(String dbName) async { // 获取应用的文档目录 final directory = await getA 阅读全文
posted @ 2024-03-20 18:47 鲤斌 阅读(169) 评论(0) 推荐(0)
摘要: Flutter 中操作列表中的 Map 的常用用法: 查找元素: //查找一个对象: Map<String, dynamic>? findObjectById(int id) { return list.firstWhere((element) => element['id'] == id, orE 阅读全文
posted @ 2024-03-20 17:33 鲤斌 阅读(711) 评论(0) 推荐(0)
摘要: 添加依赖 flutter_inappwebview: ^6.0.0 #嵌套网页 代码 class PictureWebUrl extends StatefulWidget { final String weburl; PictureWebUrl({Key? key, required this.we 阅读全文
posted @ 2024-03-20 11:14 鲤斌 阅读(354) 评论(0) 推荐(0)
摘要: 在Flutter中,Map<String, dynamic> 和 Map<String, String> 都是Map类型的数据结构,但它们之间有一些重要的区别: 1.Map<String, dynamic>:这种Map的值可以是任何类型,包括基本数据类型(如int,double,String等),L 阅读全文
posted @ 2024-03-20 11:11 鲤斌 阅读(505) 评论(0) 推荐(0)
摘要: 使用FittedBox:FittedBox部件可以根据其子部件的大小调整其大小。您可以将Text部件放置在FittedBox中,并将fit属性设置为BoxFit.contain,以便在父部件大小变化时,文本会自动调整大小以适应父部件。 FittedBox( fit: BoxFit.contain, 阅读全文
posted @ 2024-03-14 18:57 鲤斌 阅读(73) 评论(0) 推荐(0)
摘要: 将对象转换为JSON /** Map<String, dynamic> toJson() { final _data = <String, dynamic>{}; _data['font'] = font; // No need for 'this.' here return _data; } */ 阅读全文
posted @ 2024-03-14 09:34 鲤斌 阅读(2136) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 21 下一页