
flutter
longforus
安卓码农
展开
-
怎么从WillPopScope迁移到PopScope
直接接收一个bool,和一个不好用的回调,不能再愉快的进行异步调用判断是否要pop了,个人觉得是反向升级.那么在PopScope下怎么进行异步判断呢?最近把flutter升级到了3.22.0-0.1.pre,3.19的正式版在我的项目上有些问题,先到预览版过渡一下.迁移到了PopScope,但是PopScope接受的是否pop的参数和WillPopScope相比变化较大,原创 2024-04-18 16:10:05 · 1991 阅读 · 0 评论 -
dart run build_runner build提示Could not find the implicit file to run: bin\flutter.dart.
最近的flutter在使用ObjectBox for Dart/Flutter,因为换了项目位置所以需要重新生成一下objectbox.g.dart文件,但是按照文档运行,dart run build_runner build却提示: Could not find the implicit file to run: bin\flutter.dart.Usage: dart run [arguments] <dart file | package target>-h, --help原创 2021-09-01 14:21:57 · 911 阅读 · 0 评论 -
flutter中的onBackPressed()
在安卓开发中有时候我们需要监听用户的返回键点击事件,在里面根据要求做判断来决定是返回还是弹窗等其他操作.就像這样:override fun onBackPressed() { if (allowBack){ super.onBackPressed() }else{ do something ... } ...原创 2019-01-09 15:47:52 · 1603 阅读 · 0 评论