flutter_in_action_source_code icon indicating copy to clipboard operation
flutter_in_action_source_code copied to clipboard

《Flutter实战》随书源码

Results 21 flutter_in_action_source_code issues
Sort by recently updated
recently updated
newest added

iOS:1. 设置本地语言为 中文简体,系统回掉 取到的是 美国英文; 2. (系统中文)先设置app为中文环境,重启app,然后选auto,app显示中文,在重启app,又会显示为英文; Android:1. 系统设置为中文,app中取到的是 zh_Hans_CN,设置auto的话还是显示英文; ``` dart localeResolutionCallback: (Locale _locale, Iterable supportedLocales) { if (localeModel.getLocale() != null) { //如果已经选定语言,则不跟随系统 return localeModel.getLocale(); } else { Locale...

在home_page.dart中,我想在判断用户未登录后,直接跳转到login路由,修改代码如下: //注释掉原代码中的return,添加 Navigator.of(context).pushNamed("login"); if (!userModel.isLogin) { Navigator.of(context).pushNamed("login"); // return Center( // child: RaisedButton( // child: Text(GmLocalizations.of(context).login), // onPressed: () => Navigator.of(context).pushNamed("login"), // ), // ); } 但由于body部分必须要return一个widget,所以上述代码报错。 请问如果要实现上述意图,代码如何操作,谢谢?

第一次install apk打开login 页面,焦点和键盘focus在密码栏,原因是这里应该是string判空而不是判null

看[7.3 跨组件状态共享(Provider)](https://book.flutterchina.club/chapter7/provider.html)的时候发现跑不了,来跑代码,拉下来之后发现项目里面好像缺少实现 `ChangeNotifier` 类 Undefined class 'ChangeNotifier'. Try changing the name to the name of an existing class, or creating a class with the name 'ChangeNotifier'. 基于这个commit的最新代码 [commit](https://github.com/wendux/flutter_in_action_source_code/commit/55cba13eaa33e51ca16c662a18dff551359f5a75)

请问作者是基于sdk哪个版本开发的?

> Configure project :path_provider Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error. FAILURE: Build failed with an exception. *...

https://github.com/wendux/flutter_in_action_source_code/blob/e5e54b3082bc344fb9c236a9e24796ac568ac859/github_client_app/lib/states/profile_change_notifier.dart#L14 大佬您好,关于此处: `User get user => _profile.user;` 由于`_profile.user` 是 `User?` 类型的, 所以在get的返回类型中改为了 `User?` 但当改好后`User? get user => _profile.user;` 又出现问题提示:The return type of getter 'user' is 'User?' which isn't a subtype...

1. update了flutter version '>=3.0.1