1.Spacer
2.Wrap+List.generate(length,generator)
3.DefaultTabcontroller+TabBar+TabBarView
4.showDialog(context:context,builder:(context)=>
{Material=>type:MaterialType.transparency})
5.Future.delayed(Duration(seconds: 1),(){});
6.GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: (){FocusScope.of(context).requestFocus(FocusNode());},
child:
7. controller.addListener()
8.class!extends!implements PreferredSizeWidget{
@override
// TODO: implement preferredSize
Size get preferredSize => Size.fromHeight()}
9.WillPopScope
10.Table+TableRow
11.CupertinoPicker+onSelectedItemChanged
12.showModalBottomSheet
13.ButterBar
14.CupertinoDatePicker
15.CupertinoButton
16.CupertinoContextMenu
17.showCupertinoModalPopup
18.assert(context!=null);
19.UnconstrainedBox
20.Overlay
21.ShaderMask
22.WidgetSpan
23.NotificationListener
24. .runtimeType
25. .statusCode
26.VerticalDivider
27.Visibility
28.flutter create -h
29.expanded,spacer,mediaquery,wrap,aspectRatio
30. git stash
31.with AutomaticKeepAliveClientMixin
32.IndexedStack()
33.IgnorePainter()
34.FadeInImage()
35.textAlign: TextAlign.end
36.popToRootPage()
37.void insert(int index, E element)
38.popUntil(ModalRoute.withName(x))
39.pushReplacementNamed/pushReplacement
40. A -> B -> C 在 C 页面采用 pushNamedAndRemoveUntil / pushAndRemoveUntil 方式启动新页面 D,则优先启动 D 并将 C -> B -> A 全部销毁
回到第一个路由页
Navigator.popUntil(context, (route) => route.isFirst);
41.
A -> B -> C 在 B 页面采用Navigator.popAndPushNamed(context, '/screen4'); 方式到 C 时,B 优先销毁,再打开C;
等同于Navigator.pushReplacement( context, MaterialPageRoute(builder: (BuildContext context) =>screen4()));
要求:A->B->C->D->B->A,D跳转B的时候销毁D和C
实现:
Navigator.popUntil(context, (route) {
if (route.settings.name == 'B') {
return true;
}
return false;
});
其中route.settings.name是在进栈的时候为该页面设置的
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => BPage(),
settings: RouteSettings(name: 'B'), // 设置B页面的路由名称为'B'
),
);
42.json.encode()
43.jsonDecode()
44.AnimatedSwitcher()
45.random().nextInt(x)
46.list.reversed list数组元素顺序反转
47.flutter upgrade 命令更新sdk
48.flutter build apk
49.2021年4月27号 = DateFormat.yMMMMd("zh-cn").format(DateTime.parse(2021-04-27T09:02:03))
50.CircularProgressIndicator 加载中转圈圈
51.DefaultTabController 顶部导航
52.
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp("[a-zA-Z]|[\u4e00-\u9fa5]|[0-9]|[ ]")),//限制表情的输入
LengthLimitingTextInputFormatter(15),//限制输入框输入的字符长度
],
53. CancelableOperation.fromFuture
54.全局设置系统栏颜色,在main里面设置
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
statusBarColor: Colors.white, // 设置顶部状态栏颜色
systemNavigationBarColor: Colors.white, // 设置底部操作栏颜色
));
55.adb logcat 日志打印到指定文件
Linux or Mac:
adb logcat | grep -F "`adb shell ps | grep com.abc.package | cut -c10-15`"
windows:
adb logcat | findstr com.abc.package
打印全部
adb logcat -v time >D:\log.txt
打印指定内容 XXX可以用包名,或者关键字去代替。双引号是必须
adb logcat -v time | find “XXX” >D:\log.txt
56. window.devicePixelRatio 获取设备像素密度
57. 忽略触摸事件IgnorePointer和AbsorbPointer,
这两个Widget都能阻止子树接收指针事件,
不同的是AbsorbPointer本身是可以接收指针事件的(但其子树不行),
而IgnorePointer本身就不可以接收指针事件
58. IntrinsicHeight 将其子widget的高度调整其本身实际的高度,不推荐使用
59. 反编译apk使用到的权限: `aapt dump permissions xxx.apk`