摘要: 这里说的占位符,实际就是排版时需要展示的图片,图片基于占位符填充,那么处理图片时,怎么解决占位符(图片)的上下偏移在设置占位符属性时,我通过以下方法来实现它: + (NSAttributedString *)wxImageAttributeCoreTextFromPaperQuestion:(WXT 阅读全文
posted @ 2022-11-15 15:48 macroK 阅读(230) 评论(0) 推荐(2) 编辑
摘要: //通过ConstrainedBox来确保Stack占满屏幕 ConstrainedBox( constraints: BoxConstraints.expand(), child: Stack( alignment:Alignment.center , //指定未定位或部分定位widget的对齐方 阅读全文
posted @ 2022-06-08 17:52 macroK 阅读(103) 评论(0) 推荐(0) 编辑
摘要: KeepAliveWrapper 主要避免在切换Tab时,会刷新当前页面的所有状态,每个页面都会重新刷新 这里引入一个组件,能同时在列表中和列表外使用,并可以缓存它 class KeepAliveWrapper extends StatefulWidget { const KeepAliveWrap 阅读全文
posted @ 2022-04-30 17:01 macroK 阅读(386) 评论(0) 推荐(0) 编辑
摘要: shared_preferences 示例 static Future<void> setToken(String token) async { SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs. 阅读全文
posted @ 2022-04-28 16:38 macroK 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 库引用 pubspec.yaml 文件引入 dependencies: json_annotation: <最新版本> dev_dependencies: build_runner: <最新版本> json_serializable: <最新版本> 终端运行 flutter packages get 阅读全文
posted @ 2022-04-28 16:20 macroK 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 配置 final routes = { '/': (context, {arguments}) => Tabs(), ///需要传值路由 '/form': (context, {arguments}) => FormValuePage( arguments: arguments, ), '/prod 阅读全文
posted @ 2022-03-25 11:24 macroK 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 环境配置 Flutter SDK 安装 https://docs.flutter.dev/development/tools/sdk/releases?tab=macos 下载完成后解压将其SDK flutter文件夹放入系统根目录,例如: /Users/k/flutter_sdk/flutter 阅读全文
posted @ 2022-03-04 11:02 macroK 阅读(1710) 评论(0) 推荐(0) 编辑
摘要: 导入 libxlsxwriter Podfile 文件添加如下示例,终端cd到项目文件夹,执行 pod install pod 'libxlsxwriter' 引用 导入头文件 #import <xlsxwriter/xlsxwriter.h> 创建Excel - (void)createExcel 阅读全文
posted @ 2022-01-17 13:46 macroK 阅读(466) 评论(0) 推荐(1) 编辑
摘要: 工程创建 pod lib create 私有库名称 安装 Cocoapods 项目 cd 到 Example 文件夹 pod install --no-repo-update pod update --no-repo-update 项目远程地址 git remote add origin 远程地址 阅读全文
posted @ 2021-12-10 16:12 macroK 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 创建项目 创建一个App项目:XKFrameworkApp 创建一个Framework项目:XKTestFramework 创建一个 .xcworkspace 文件,名字与App项目名字相同:XKFrameworkApp.xcworkspace 将 XKFrameworkApp.xcworkspac 阅读全文
posted @ 2021-12-09 11:56 macroK 阅读(807) 评论(1) 推荐(0) 编辑