随笔分类 -  Flutter

摘要:首先你需要在“MaterialApp”设置两套theme MaterialApp( theme: myTheme, // light darkTheme: ThemeData.dark(), // dark ); 在 widget 中这样判断当前模式 final isDark = MediaQuer 阅读全文
posted @ 2020-12-30 10:46 Ajanuw 阅读(728) 评论(0) 推荐(0) 编辑
摘要:dart plugin class TestLib { static MethodChannel _channel = const MethodChannel('test_lib') ..setMethodCallHandler(_methodCallHandler); static Functio 阅读全文
posted @ 2020-10-19 21:04 Ajanuw 阅读(1005) 评论(0) 推荐(0) 编辑
摘要:使用android studio打开/example/android 文件即可 阅读全文
posted @ 2020-10-10 15:42 Ajanuw 阅读(282) 评论(0) 推荐(0) 编辑
摘要:dependencies: path: sqflite: sqflite_common_ffi: import 'dart:io'; import 'package:flutter/material.dart'; import 'package:sqflite_common_ffi/sqflite_ 阅读全文
posted @ 2020-10-05 18:17 Ajanuw 阅读(827) 评论(0) 推荐(0) 编辑
摘要:import 'package:dart_printf/dart_printf.dart'; import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWi 阅读全文
posted @ 2020-10-04 12:04 Ajanuw 阅读(258) 评论(0) 推荐(0) 编辑
摘要:创建插件 mkdir win_test && cd win_test flutter create -t plugin --platforms windows ./ 找到win_test\example\build\windows\plugins\win_test\win_test_plugin.s 阅读全文
posted @ 2020-09-30 15:40 Ajanuw 阅读(771) 评论(0) 推荐(0) 编辑
摘要:main.dart import 'dart:io'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'package:path_provider/path_provid 阅读全文
posted @ 2020-08-09 14:15 Ajanuw 阅读(1504) 评论(0) 推荐(0) 编辑
摘要:页表页面 这是一个普通的展示数据,上拉加载更多数据的列表。 其中有一个类型为 的数据列表listData,有个page数据用于分页,isLoading用来判断是否正在加载数据,scrollController用于列表控制器 如果存在大量这种页面则可以用mixin来处理,不免大量重复的代码 mixin 阅读全文
posted @ 2020-05-03 16:46 Ajanuw 阅读(1105) 评论(0) 推荐(0) 编辑
摘要:"相关问题" 创建mixin 使用 阅读全文
posted @ 2020-04-22 13:53 Ajanuw 阅读(476) 评论(0) 推荐(0) 编辑
摘要:"amap_location 包" 获取debug SHA1 获取发布的 SHA1 在真机中,你可能需要手动获取定位权限 其他设置可以参考文档 阅读全文
posted @ 2020-04-22 12:24 Ajanuw 阅读(2483) 评论(0) 推荐(0) 编辑
摘要:"原文" "Opacity API文档" 有没有想过Flutter如何获取这些小部件并将其实际转换为屏幕上的像素? 您可能已经知道如何使用StatelessWidget和StatefulWidget。但是那些小部件仅构成其他小部件。布置小部件并将其渲染在其他位置进行。 不透明度(Opacity) 注 阅读全文
posted @ 2020-03-12 10:06 Ajanuw 阅读(277) 评论(0) 推荐(0) 编辑
摘要:"ColorFiltered" "ColorFilter" "BlendMode" Example main.dart import 'package:flutter/material.dart'; void main() = runApp(MyApp()); class MyApp extends 阅读全文
posted @ 2019-12-12 12:03 Ajanuw 阅读(1746) 评论(0) 推荐(0) 编辑
摘要:"文档" Example 阅读全文
posted @ 2019-12-12 11:46 Ajanuw 阅读(1244) 评论(0) 推荐(0) 编辑
摘要:```dart import 'dart:async'; import 'dart:isolate'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; void main() => runApp(MyApp()); class MyApp extends StatelessWid... 阅读全文
posted @ 2019-12-06 20:11 Ajanuw 阅读(2302) 评论(0) 推荐(0) 编辑
摘要:or use CustomScrollView 阅读全文
posted @ 2019-11-06 11:42 Ajanuw 阅读(726) 评论(0) 推荐(0) 编辑
摘要:"原文" 阅读全文
posted @ 2019-10-31 13:27 Ajanuw 阅读(2633) 评论(0) 推荐(0) 编辑
摘要:"get_it " 下面这个demo在两个页面都注入了 来共享数据 简单实现 阅读全文
posted @ 2019-10-19 17:16 Ajanuw 阅读(1808) 评论(0) 推荐(1) 编辑
摘要:"flutter_downloader" 此库更新极慢,所以问题及多,可以看文档 安装 配置 Java: Or Kotlin: 更新 andriod 上简单的使用 中文模板 阅读全文
posted @ 2019-10-19 12:53 Ajanuw 阅读(3785) 评论(0) 推荐(1) 编辑
摘要:![textField_2_Text.gif](https://i.loli.net/2019/10/14/1GWRwsiruyN6QbA.gif) ```dart import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @overri 阅读全文
posted @ 2019-10-14 17:59 Ajanuw 阅读(420) 评论(0) 推荐(0) 编辑
摘要:"WillPopScope" "addScopedWillPopCallback" 启用此路由以使用户否决尝试以将其关闭。 典型应用是如果用户尝试退出表单,则警告用户有关未保存的表单数据。连按两次返回键退出APP。 工作示例 阅读全文
posted @ 2019-10-14 10:09 Ajanuw 阅读(1495) 评论(0) 推荐(0) 编辑