flutter之殇

跳转url

url_launch(url, enableJavaScript: true, forceWebView: true)

SnackBar用法
切记snackBar用的context是特snackBar自己的context,不然会报

1
Another exception was thrown: Scaffold.of() called with a context that does not contain a Scaffold.

代码如下:vl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import 'package:flutter/material.dart';

class SnackBarPage extends StatelessWidget {
BuildContext scaffoldContext;

@override
Widget build(BuildContext context) {
// TODO: implement build
Widget body = Center (
child: RaisedButton(
onPressed: () {
final snackBar = SnackBar(
content: Text('hello! A SnackBar!'),
action: SnackBarAction(
label: 'Undo',
onPressed: () {
// Some code to undo the change!
},
),
);
Scaffold.of(scaffoldContext).showSnackBar(snackBar);
},
child: Text('test')
)
);

return
MaterialApp(
title: 'SnackBar',
home: Scaffold(
appBar: AppBar(
title: Text('SnackBar')
),
body: Builder(builder: (BuildContext context) {
scaffoldContext = context;
return body;
}),
),
);
}

}

打release包,flutter build apk
但是发现请求都失败了

找不到3des加密方法,只能从android和ios分别实现,然后桥接

如果image出现找不到的情况,不要hot运行,直接重新run

webdev could not run for this project.
The pubspec.yaml file has changed since the pubspec.lock file was generated, please run “pub get” again.

pub get

webdev could not run for this project.
You must have a dependency on build_web_compilers in pubspec.yaml.

https://cloud.tencent.com/developer/article/1430689

web
很多第三方插件都不支持

No address associated with hostname

ui适配问题(大屏幕和小屏幕手机问题)

BottomNavigationBar保留不了状态问题(切换tab的时候重新构建了页面),
1、body: widget
2、
3、PageView

PageView的坑
https://juejin.im/post/5b73c3b3f265da27d701473a

路由跳转有点坑,需要沉淀

bloc响应式

子模块bloc在使用上不要嵌套会有问题,并列的就没问题。

appBloc.appEventStream.listen(eventHandle);
监听器的使用

http://www.uxxsn.com/8599.html