Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from simplezhli:master #15

Open
wants to merge 193 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
dd9ff0b
flutter 2.0.5
simplezhli Apr 20, 2021
99cd5a3
开始迁移到空安全
simplezhli Apr 22, 2021
84659e6
FlutterJsonBeanFactory生成代码更新至空安全版本
simplezhli Apr 22, 2021
03be4e2
widget、util、demo迁移完成
simplezhli Apr 23, 2021
c0679f9
store、statistics、shop、setting、account迁移完成
simplezhli Apr 23, 2021
0ed2bab
goods、order、home、login迁移完成
simplezhli Apr 25, 2021
8227e4c
迁移至空安全完成 #161
simplezhli Apr 26, 2021
1e049f5
目录调整
simplezhli Apr 28, 2021
70e358f
fluro添加类参数用例
simplezhli Apr 29, 2021
16d12aa
覆盖`selectionHandleColor`无效问题记录
simplezhli Apr 30, 2021
9ed83a6
日常优化
simplezhli May 3, 2021
79b103b
commit
simplezhli May 5, 2021
8bc6440
flutter 2.0.6
simplezhli May 8, 2021
2060277
使用RestorableInt保存页面状态
simplezhli May 12, 2021
d8fb984
测试simulator-action
simplezhli May 13, 2021
08cd171
去除multidex
simplezhli May 19, 2021
2e19cfd
flutter 2.2.0
simplezhli May 20, 2021
2882254
fix #167
simplezhli May 20, 2021
7342308
集成测试代码迁移至空安全
simplezhli May 21, 2021
698a5b0
支持新的service worker加载机制
simplezhli May 21, 2021
1455c1a
web问题补充
simplezhli May 21, 2021
28b4004
优化统计页面
simplezhli May 25, 2021
5bb5089
添加desktop_window插件
simplezhli May 27, 2021
65c9a46
替换device_info为device_info_plus
simplezhli May 27, 2021
5d97b98
TextSpan 鼠标光标支持
simplezhli May 28, 2021
29ee2cc
ShortcutItem添加图片
simplezhli May 29, 2021
6a6d0e6
flutter 2.2.1
simplezhli May 31, 2021
a5f802c
Enable avoid_escaping_inner_quotes lint
simplezhli Jun 5, 2021
7b59f72
Enable use_named_constants lint
simplezhli Jun 6, 2021
0774971
flutter 2.2.2
simplezhli Jun 17, 2021
fb30370
enable lint prefer_interpolation_to_compose_strings
simplezhli Jun 26, 2021
4762900
Turn on avoid_dynamic_calls lint
simplezhli Jun 27, 2021
a2ea57a
flutter 2.2.3
simplezhli Jul 3, 2021
06af57e
升级quick_actions
simplezhli Jul 10, 2021
5785c04
image_picker 0.8.2
simplezhli Jul 16, 2021
c067856
依赖更新
simplezhli Jul 17, 2021
8707a25
keyboard_actions 3.4.1
simplezhli Jul 26, 2021
28a8573
enable avoid_function_literals_in_foreach_calls
simplezhli Jul 27, 2021
f1b8a30
依赖升级
simplezhli Aug 7, 2021
0d9b5c7
provider 6.0.0
simplezhli Aug 21, 2021
95f740a
flutter 2.5.0
simplezhli Sep 9, 2021
bcc2e1c
flutter 2.5适配
simplezhli Sep 9, 2021
b697125
flutter 2.5适配
simplezhli Sep 11, 2021
e7ed312
flutter 2.5.1
simplezhli Sep 21, 2021
b966c82
依赖升级
simplezhli Sep 28, 2021
2cb00b8
Enable avoid_setters_without_getters
simplezhli Oct 5, 2021
317cf72
flutter 2.5.2
simplezhli Oct 5, 2021
b82f500
适配至Android 11
simplezhli Oct 6, 2021
53ba1aa
fix: body evaluated outside `runZonedGuarded`
hkhere Oct 27, 2021
2b04f23
Merge pull request #183 from hkhere/fix_handle_error
simplezhli Oct 29, 2021
1848e5e
qr_code_scanner 0.6.0
simplezhli Nov 1, 2021
5392f10
依赖升级
simplezhli Nov 6, 2021
f33378a
queries补充
simplezhli Nov 27, 2021
98ff4e3
flutter_slidable升至1.1.0
simplezhli Nov 28, 2021
05d8372
fix CI
simplezhli Nov 28, 2021
2b7f5ae
fix CI
simplezhli Nov 28, 2021
0894adc
flutter_2d_amap升级
simplezhli Nov 28, 2021
4dd4f69
flutter_2d_amap升级
simplezhli Nov 28, 2021
bbf257b
Enable avoid_redundant_argument_values lint
simplezhli Nov 30, 2021
fa57a61
fix #187
simplezhli Dec 1, 2021
56600db
Enable sort_child_properties_last lint
simplezhli Dec 2, 2021
6da2ba5
Enable eol_at_end_of_file lint
simplezhli Dec 3, 2021
ead40ea
Enable more lints
simplezhli Dec 4, 2021
13faeac
适配flutter 2.8.0
simplezhli Dec 9, 2021
ad52a60
Enable avoid_print lint
simplezhli Dec 12, 2021
ec8fd73
fix CI
simplezhli Dec 12, 2021
73f2ab5
fix #191 适配FlutterJsonBeanFactory插件4.2.8版本
simplezhli Dec 23, 2021
5cb1d85
SingleTickerProviderStateMixin rebuild 问题补充
simplezhli Jan 8, 2022
0c483e7
flutter 2.8.1
simplezhli Jan 9, 2022
328f143
地图插件升级
simplezhli Jan 24, 2022
3f276b2
flutter 2.10.0
simplezhli Feb 4, 2022
6eaf355
适配flutter 2.10.0
simplezhli Feb 5, 2022
efe55ff
fix #198
simplezhli Feb 6, 2022
36262ee
common_utils 2.1.0
simplezhli Feb 17, 2022
a95dc93
update analysis_options.yaml
simplezhli Feb 18, 2022
6cdb277
Enable no_leading_underscores_for_local_identifiers
simplezhli Feb 20, 2022
4ba1d63
.
simplezhli Feb 20, 2022
4447ff9
flutter 2.10.2
simplezhli Feb 22, 2022
fa6246a
flutter 2.10.3
simplezhli Mar 6, 2022
982e206
Enable use_if_null_to_convert_nulls_to_bools lint
simplezhli Mar 15, 2022
f559a98
#205 尝试修复扫码页黑屏问题
simplezhli Mar 20, 2022
da16c45
依赖升级
simplezhli Apr 2, 2022
fb27a45
web问题文档更新
simplezhli Apr 16, 2022
d14a2ee
flutter 2.10.5
simplezhli May 2, 2022
ac3450e
dio、url_launcher废弃方法替换
simplezhli May 2, 2022
bbd2e35
gradle 7.0
simplezhli May 4, 2022
288c21c
Enable strict-casts
simplezhli May 8, 2022
5b1b656
Enable unnecessary_import
simplezhli May 10, 2022
9af9842
适配flutter 3.0.0
simplezhli May 12, 2022
c75ca18
适配flutter 3.0.0
simplezhli May 18, 2022
268a64e
依赖升级
simplezhli May 24, 2022
cb52663
fix #209
simplezhli Jun 1, 2022
e4a2fbb
扫码问题修复
simplezhli Jun 2, 2022
33847f4
Enable curly_braces_in_flow_control_structures
simplezhli Jun 19, 2022
b14f8b7
Enable use_super_parameters lint
simplezhli Jun 20, 2022
8f2f285
Enable use_super_parameters lint
simplezhli Jun 20, 2022
1bed671
Enable use_super_parameters lint
simplezhli Jun 22, 2022
2756c3a
依赖更新
simplezhli Jul 5, 2022
393aed6
Android 12
simplezhli Jul 17, 2022
414d13e
flutter 3.0.4
simplezhli Jul 22, 2022
dfcf845
依赖更新
simplezhli Aug 7, 2022
d0003a0
适配flutter 3.3.0
simplezhli Sep 2, 2022
0d52ec6
flutter 3.3.0
simplezhli Sep 4, 2022
32d2714
flutter 3.3.2
simplezhli Sep 18, 2022
6160932
fix 'Bad CPU type in executable'
simplezhli Sep 18, 2022
c1a0bc6
fix 'Bad CPU type in executable'
simplezhli Sep 18, 2022
3bfd0ac
fix #220
simplezhli Sep 22, 2022
273ef07
迁移废弃的Splash Screen API
simplezhli Sep 30, 2022
91a96d7
依赖升级
simplezhli Oct 1, 2022
a7d5c27
修复可访问性测试
simplezhli Oct 16, 2022
113b278
device_info_plus 7.0.1
simplezhli Oct 23, 2022
538894f
device_info_plus 7.0.1
simplezhli Oct 23, 2022
520d6f2
flutter 3.3.7
simplezhli Nov 3, 2022
74dcf74
log打印优化
simplezhli Nov 5, 2022
699282d
lottie 2.0.0
simplezhli Nov 10, 2022
6860943
clean-up analysis_options.yaml
simplezhli Nov 26, 2022
4cf3203
vibration_web添加
simplezhli Dec 19, 2022
2ec062d
迁移至diox
simplezhli Dec 19, 2022
fa29906
webview_flutter升级至4.0.0
simplezhli Dec 23, 2022
bee192e
Enable depend_on_referenced_packages/sized_box_shrink_expand/use_colo…
simplezhli Jan 4, 2023
f9f00c6
ThemeData部分废弃属性迁移
simplezhli Jan 6, 2023
9b6bfa2
适配flutter 3.7.0
simplezhli Jan 25, 2023
f277a1b
flutter 3.7.0
simplezhli Jan 26, 2023
aa724d2
flutter 3.7.0
simplezhli Jan 26, 2023
d49ba45
集成测试失败修复
simplezhli Jan 26, 2023
e95a335
替换desktop_window插件为window_manager
simplezhli Feb 4, 2023
d3f1bdd
让Windows应用成为单实例
simplezhli Feb 11, 2023
f131a2f
dio 5.0.0
simplezhli Feb 14, 2023
ff118f7
依赖升级
simplezhli Feb 24, 2023
1109471
flutter 3.7.5
simplezhli Feb 26, 2023
35f35e5
依赖升级
simplezhli Mar 11, 2023
6e3fa4f
Enable implicit_call_tearoffs lint
simplezhli Mar 19, 2023
fd793cd
依赖升级
simplezhli Apr 4, 2023
96fcfcc
SearchBar改为MySearchBar,避免冲突
simplezhli Apr 28, 2023
a8bf023
compileSdkVersion升至33
simplezhli Apr 28, 2023
9eda809
适配flutter 3.10.0
simplezhli May 11, 2023
435adc3
适配flutter 3.10.0
simplezhli May 11, 2023
b1122b7
runZonedGuarded与WidgetsFlutterBinding.ensureInitialized异常修复
simplezhli May 13, 2023
acd8685
desktop更新
simplezhli May 13, 2023
5ea6231
适配Android 13
simplezhli May 14, 2023
6a30aca
fix CI
simplezhli May 14, 2023
6157863
fix CI
simplezhli May 14, 2023
abf3a3d
fix CI
simplezhli May 14, 2023
117c136
更新下载地址
simplezhli May 15, 2023
a1769c6
README-EN 更新
simplezhli May 21, 2023
0caae0a
dio升至5.2.0+1
simplezhli Jun 8, 2023
72256de
image_picker支持Windows、macOS
simplezhli Jun 11, 2023
8cc4f93
analysis_options 更新
simplezhli Jun 29, 2023
e0b2a77
依赖升级,替换敏感词
simplezhli Jul 19, 2023
21397f1
适配flutter 3.13.0
simplezhli Aug 17, 2023
33bf67a
Update README.md
simplezhli Aug 22, 2023
6222a3c
Merge branch 'master' of github.com:simplezhli/flutter_deer
simplezhli Aug 23, 2023
3f6325a
适配flutter 3.13.0
simplezhli Aug 23, 2023
b6c9f02
SliverMainAxisGroup替换flutter_sticky_headers |
simplezhli Aug 24, 2023
8439416
Enable literal_only_boolean_expressions
simplezhli Aug 27, 2023
179deee
依赖升级
simplezhli Sep 17, 2023
ed5c8c7
flutter 3.13.6
simplezhli Sep 29, 2023
0965780
失效图片更新
simplezhli Oct 1, 2023
2f1e023
尝试修复集成测试
simplezhli Oct 1, 2023
373c867
尝试修复iOS集成测试失败问题
simplezhli Oct 1, 2023
cbb4e1c
Enable strict-inference
simplezhli Nov 12, 2023
f49ad66
适配flutter 3.16.0
simplezhli Nov 16, 2023
333d690
适配flutter 3.16.0 PopScope部分实现回退
simplezhli Nov 18, 2023
511a193
适配flutter 3.16.0
simplezhli Nov 21, 2023
4d32f36
Release环境时不打印debugPrint内容
simplezhli Dec 4, 2023
9af6716
flutter 3.16.5
simplezhli Dec 24, 2023
374fe1a
IPHONEOS_DEPLOYMENT_TARGET 设为 12.0
simplezhli Jan 9, 2024
b48e8e1
README 更新
simplezhli Jan 22, 2024
9f0e812
地图JS API安全密钥使用
simplezhli Feb 2, 2024
5296982
Android导航栏颜色优化
simplezhli Feb 13, 2024
3ea0964
flutter 3.16.9
simplezhli Feb 15, 2024
bc28a97
flutter 3.19.0
simplezhli Feb 19, 2024
93c340e
Allow deprecated members
simplezhli Feb 19, 2024
575ad4d
依赖升级
simplezhli Mar 16, 2024
07bfe9b
依赖升级
simplezhli Mar 24, 2024
f1e6493
依赖升级
simplezhli Apr 26, 2024
5d0a867
Sync lints and enable annotate_redeclares
simplezhli May 14, 2024
63681d7
flutter 3.22.0
simplezhli May 15, 2024
dce1f5d
fix CI
simplezhli May 15, 2024
aae7c56
Update flutter-drive.yml
simplezhli May 17, 2024
9c01b2e
依赖升级
simplezhli Jun 16, 2024
ab09d91
依赖升级
simplezhli Jul 28, 2024
5991f10
flutter 3.24.0
simplezhli Aug 12, 2024
1c97a82
适配Android 14
simplezhli Aug 12, 2024
ea9f3a0
隐藏TabBar点击效果方法更新
simplezhli Sep 14, 2024
df174df
xcode 16.0
simplezhli Sep 21, 2024
1e09534
Enable invalid_runtime_check_with_js_interop_types
simplezhli Sep 28, 2024
e3ee1a3
适配AGP 8
simplezhli Nov 24, 2024
14fd76d
更新测试设备信息
simplezhli Nov 24, 2024
a04bcba
更新测试设备信息
simplezhli Nov 24, 2024
fecbf0d
更新测试设备信息
simplezhli Nov 24, 2024
cede8b6
更新测试设备信息
simplezhli Nov 24, 2024
5a45005
flutter 3.27.0
simplezhli Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
widget、util、demo迁移完成
  • Loading branch information
simplezhli committed Apr 23, 2021
commit 03be4e2e5273f96020bd725ed700a684aeaac2e9
2 changes: 1 addition & 1 deletion README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Web:https://simplezhli.github.io/flutter_deer/

- I have added a relative path to the design drawings in the page notes. I can search or find the corresponding page. I hope it will help you.

- This project uses the FlutterJsonBeanFactory plugin to generate beans.
- This project uses the [FlutterJsonBeanFactory](https://github.com/zhangruiyu/FlutterJsonBeanFactory) plugin to generate beans.

## Summary of experience

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Web体验地址:https://simplezhli.github.io/flutter_deer/

- 因为页面有点多,一开始可能会导致页面无法与设计图对应上。我在代码注释中有添加设计图的相对路径,可以搜索或查找到对应页面,希望对你有帮助。

- 本项目使用FlutterJsonBeanFactory插件来生成Bean。FlutterJsonBeanFactory插件使用可以查看[这篇文章](https://www.jianshu.com/p/14cbcbaa74b7)
- 本项目使用[FlutterJsonBeanFactory](https://github.com/zhangruiyu/FlutterJsonBeanFactory)插件来生成Bean

- Web受制于js等资源过大和部署在Github上,访问会慢一些。

Expand Down
11 changes: 11 additions & 0 deletions docs/Web问题汇总.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@

目前处理方法是添加`RepaintBoundary`。

## 按钮的大小在移动端与Web端不同

可以`ThemeData`中全局指定`visualDensity`属性为`VisualDensity.standard`。

详情见[Buttons not respecting default dimensions](https://github.com/flutter/flutter/issues/77142)

## 指定渲染引擎

```
Expand All @@ -51,5 +57,10 @@ flutter run -d chrome --release --web-renderer canvaskit
> 总结:HTML渲染相较于CanvasKit渲染,UI还原度差一些,但综合性能相对较好。


## 历史问题

- 2.0.0已知问题(~~#79351~~)。




3 changes: 1 addition & 2 deletions lib/account/account_router.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:fluro/fluro.dart';
import 'package:flutter_deer/routers/i_router.dart';

Expand Down Expand Up @@ -35,7 +34,7 @@ class AccountRouter implements IRouterProvider{
router.define(accountRecordListPage, handler: Handler(handlerFunc: (_, __) => const AccountRecordListPage()));
router.define(addWithdrawalAccountPage, handler: Handler(handlerFunc: (_, __) => const AddWithdrawalAccountPage()));
router.define(bankSelectPage, handler: Handler(handlerFunc: (_, Map<String, List<String>> params) {
final int type = int.parse(params['type']?.first);
final int type = int.parse(params['type']?.first ?? '0');
return BankSelectPage(type: type);
}));
router.define(citySelectPage, handler: Handler(handlerFunc: (_, __) => const CitySelectPage()));
Expand Down
11 changes: 5 additions & 6 deletions lib/account/widgets/rise_number_text.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// @dart=2.9
import 'package:flutter/material.dart';

// 简易实现数字滚动效果
class RiseNumberText extends StatefulWidget {

const RiseNumberText(this.number,{
Key key,
Key? key,
this.style,
this.duration = 1200
}): super(key: key);

final num number;
final TextStyle style;
final TextStyle? style;
final int duration;

@override
Expand All @@ -20,8 +19,8 @@ class RiseNumberText extends StatefulWidget {

class _RiseNumberTextState extends State<RiseNumberText> with SingleTickerProviderStateMixin {

Animation<double> _animation;
AnimationController _controller;
late Animation<double> _animation;
late AnimationController _controller;
num _fromNumber = 0;

@override
Expand All @@ -46,7 +45,7 @@ class _RiseNumberTextState extends State<RiseNumberText> with SingleTickerProvid

@override
void dispose() {
_controller?.dispose();
_controller.dispose();
super.dispose();
}

Expand Down
9 changes: 4 additions & 5 deletions lib/account/widgets/sms_verify_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'dart:async';

import 'package:flutter/material.dart';
Expand All @@ -17,7 +16,7 @@ import 'package:flutter_deer/widgets/my_button.dart';
/// 骚操作:借腹生子
class SMSVerifyDialog extends StatefulWidget {

const SMSVerifyDialog({Key key}) : super(key: key);
const SMSVerifyDialog({Key? key}) : super(key: key);

@override
_SMSVerifyDialogState createState() => _SMSVerifyDialogState();
Expand All @@ -28,8 +27,8 @@ class _SMSVerifyDialogState extends State<SMSVerifyDialog> {
/// 倒计时秒数
final int _second = 60;
/// 当前秒数
int _currentSecond;
StreamSubscription _subscription;
late int _currentSecond;
StreamSubscription? _subscription;
bool _clickable = true;

final FocusNode _focusNode = FocusNode();
Expand Down Expand Up @@ -131,7 +130,7 @@ class _SMSVerifyDialogState extends State<SMSVerifyDialog> {
/// https://github.com/flutter/flutter/issues/47191
/// https://github.com/flutter/flutter/pull/57264
/// 1.19.0已修复,小于此版本需添加addPostFrameCallback处理,否则会错误触发onChanged。
SchedulerBinding.instance.addPostFrameCallback((_) {
SchedulerBinding.instance!.addPostFrameCallback((_) {
_controller.clear();
});
}
Expand Down
17 changes: 8 additions & 9 deletions lib/account/widgets/withdrawal_account_item.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'dart:math';

import 'package:flutter/material.dart';
Expand All @@ -11,9 +10,9 @@ import 'package:flutter_deer/widgets/load_image.dart';
class WithdrawalAccountItem extends StatefulWidget {

const WithdrawalAccountItem({
Key key,
@required this.data,
this.onLongPress,
Key? key,
required this.data,
required this.onLongPress,
}): super(key: key);

final WithdrawalAccountModel data;
Expand All @@ -26,8 +25,8 @@ class WithdrawalAccountItem extends StatefulWidget {
/// 3D翻转动画 https://medium.com/flutterpub/flutter-flip-card-animation-with-3d-effect-4284af04f5a
class _WithdrawalAccountItemState extends State<WithdrawalAccountItem> with SingleTickerProviderStateMixin {

AnimationController _animationController;
Animation<double> _animation;
late AnimationController _animationController;
late Animation<double> _animation;
AnimationStatus _animationStatus = AnimationStatus.dismissed;

@override
Expand Down Expand Up @@ -142,9 +141,9 @@ class _WithdrawalAccountItemState extends State<WithdrawalAccountItem> with Sing
class AccountCard extends StatefulWidget {

const AccountCard({
Key key,
@required this.child,
this.type
Key? key,
required this.child,
required this.type
}): super(key: key);

final Widget child;
Expand Down
5 changes: 2 additions & 3 deletions lib/account/widgets/withdrawal_password_setting.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/res/resources.dart';
import 'package:flutter_deer/routers/fluro_navigator.dart';
Expand All @@ -12,7 +11,7 @@ import 'package:vibration/vibration.dart';
/// design/6店铺-账户/index.html#artboard13
class WithdrawalPasswordSetting extends StatefulWidget {

const WithdrawalPasswordSetting({Key key}) : super(key: key);
const WithdrawalPasswordSetting({Key? key}) : super(key: key);

@override
_WithdrawalPasswordSettingState createState() => _WithdrawalPasswordSettingState();
Expand Down Expand Up @@ -125,7 +124,7 @@ class _WithdrawalPasswordSettingState extends State<WithdrawalPasswordSetting> {
}

/// 点击时给予振动反馈
if (!Device.isDesktop && await Vibration.hasVibrator()) {
if (!Device.isDesktop && (await Vibration.hasVibrator() ?? false)) {
Vibration.vibrate(duration: 10);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/demo/demo_page.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/demo/focus/focus_demo_page.dart';
import 'package:flutter_deer/demo/lottie/lottie_demo.dart';
Expand All @@ -14,7 +13,7 @@ import 'package:flutter_deer/widgets/my_app_bar.dart';

class DemoPage extends StatefulWidget {

const DemoPage({Key key}) : super(key: key);
const DemoPage({Key? key}) : super(key: key);

@override
_DemoPageState createState() => _DemoPageState();
Expand Down
5 changes: 2 additions & 3 deletions lib/demo/focus/focus_demo_page.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/res/resources.dart';
import 'package:flutter_deer/util/theme_utils.dart';


/// 博客:https://weilu.blog.csdn.net/article/details/107132031
class FocusDemoPage extends StatefulWidget {
const FocusDemoPage({Key key, this.title}) : super(key: key);
const FocusDemoPage({Key? key, required this.title}) : super(key: key);

final String title;

Expand Down Expand Up @@ -47,7 +46,7 @@ class _FocusDemoPageState extends State<FocusDemoPage> {
// FocusScope.of(context).unfocus();
// _focusNode.unfocus();
// FocusManager.instance.primaryFocus.unfocus();
WidgetsBinding.instance.addPostFrameCallback((_) {
WidgetsBinding.instance!.addPostFrameCallback((_) {
debugDumpFocusTree();
});
},
Expand Down
11 changes: 5 additions & 6 deletions lib/demo/navigator/books_app_state.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/demo/navigator/book_entity.dart';

class BooksAppState extends ChangeNotifier {

BooksAppState() : _selectedIndex = 0;

int _selectedIndex;
late int _selectedIndex;

Book _selectedBook;
Book? _selectedBook;

final List<Book> books = <Book>[
Book('Stranger in a Strange Land', 'Robert A. Heinlein'),
Expand All @@ -29,9 +28,9 @@ class BooksAppState extends ChangeNotifier {
notifyListeners();
}

Book get selectedBook => _selectedBook;
Book? get selectedBook => _selectedBook;

set selectedBook(Book book) {
set selectedBook(Book? book) {
_selectedBook = book;
notifyListeners();
}
Expand All @@ -40,7 +39,7 @@ class BooksAppState extends ChangeNotifier {
if (!books.contains(_selectedBook)) {
return 0;
}
return books.indexOf(_selectedBook);
return books.indexOf(_selectedBook!);
}

void setSelectedBookById(int id) {
Expand Down
3 changes: 1 addition & 2 deletions lib/demo/navigator/books_main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/demo/navigator/parser/route_information_parser.dart';
import 'package:flutter_deer/demo/navigator/delegate/router_delegate.dart';
Expand All @@ -7,7 +6,7 @@ import 'package:flutter_deer/demo/navigator/delegate/router_delegate.dart';
/// https://weilu.blog.csdn.net/article/details/108902282
class NestedRouterDemo extends StatefulWidget {

const NestedRouterDemo({Key key}) : super(key: key);
const NestedRouterDemo({Key? key}) : super(key: key);

@override
_NestedRouterDemoState createState() => _NestedRouterDemoState();
Expand Down
5 changes: 2 additions & 3 deletions lib/demo/navigator/delegate/inner_router_delegate.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/demo/navigator/book_entity.dart';
import 'package:flutter_deer/demo/navigator/books_app_state.dart';
Expand Down Expand Up @@ -39,7 +38,7 @@ class InnerRouterDelegate extends RouterDelegate<BookRoutePath>
if (appState.selectedBook != null)
MaterialPage<dynamic>(
key: ValueKey(appState.selectedBook),
child: BookDetailsScreen(book: appState.selectedBook),
child: BookDetailsScreen(book: appState.selectedBook!),
),
] else
const FadeAnimationPage(
Expand Down Expand Up @@ -70,7 +69,7 @@ class InnerRouterDelegate extends RouterDelegate<BookRoutePath>

class FadeAnimationPage extends Page<void> {

const FadeAnimationPage({LocalKey key, this.child}) : super(key: key);
const FadeAnimationPage({LocalKey? key, required this.child}) : super(key: key);

final Widget child;

Expand Down
1 change: 0 additions & 1 deletion lib/demo/navigator/delegate/router_delegate.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/demo/navigator/screen/app_shell.dart';
import 'package:flutter_deer/demo/navigator/book_entity.dart';
Expand Down
7 changes: 3 additions & 4 deletions lib/demo/navigator/parser/route_information_parser.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';

import '../book_entity.dart';
Expand All @@ -7,22 +6,22 @@ class BookRouteInformationParser extends RouteInformationParser<BookRoutePath> {
@override
Future<BookRoutePath> parseRouteInformation(
RouteInformation routeInformation) async {
final uri = Uri.parse(routeInformation.location);
final uri = Uri.parse(routeInformation.location!);

if (uri.pathSegments.isNotEmpty && uri.pathSegments.first == 'settings') {
return BooksSettingsPath();
} else {
if (uri.pathSegments.length >= 2) {
if (uri.pathSegments[0] == 'book') {
return BooksDetailsPath(int.tryParse(uri.pathSegments[1]));
return BooksDetailsPath(int.tryParse(uri.pathSegments[1])!);
}
}
return BooksListPath();
}
}

@override
RouteInformation restoreRouteInformation(BookRoutePath configuration) {
RouteInformation? restoreRouteInformation(BookRoutePath configuration) {
if (configuration is BooksListPath) {
return const RouteInformation(location: '/home');
}
Expand Down
11 changes: 5 additions & 6 deletions lib/demo/navigator/screen/app_shell.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/demo/navigator/books_app_state.dart';
import 'package:flutter_deer/demo/navigator/delegate/inner_router_delegate.dart';
Expand All @@ -7,8 +6,8 @@ import 'package:flutter_deer/demo/navigator/delegate/inner_router_delegate.dart'
class AppShell extends StatefulWidget {

const AppShell({
Key key,
@required this.appState,
Key? key,
required this.appState,
}): super(key: key);

final BooksAppState appState;
Expand All @@ -18,8 +17,8 @@ class AppShell extends StatefulWidget {
}

class _AppShellState extends State<AppShell> {
InnerRouterDelegate _routerDelegate;
ChildBackButtonDispatcher _backButtonDispatcher;
late InnerRouterDelegate _routerDelegate;
late ChildBackButtonDispatcher _backButtonDispatcher;

@override
void initState() {
Expand All @@ -38,7 +37,7 @@ class _AppShellState extends State<AppShell> {
super.didChangeDependencies();
// Defer back button dispatching to the child router
_backButtonDispatcher = Router.of(context)
.backButtonDispatcher
.backButtonDispatcher!
.createChildBackButtonDispatcher();
}

Expand Down
1 change: 0 additions & 1 deletion lib/provider/base_list_provider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'package:flutter/material.dart';
import 'package:flutter_deer/widgets/state_layout.dart';

Expand Down
5 changes: 2 additions & 3 deletions lib/provider/locale_provider.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @dart=2.9
import 'dart:ui';

import 'package:sp_util/sp_util.dart';
Expand All @@ -8,8 +7,8 @@ import 'package:flutter_deer/common/common.dart';

class LocaleProvider extends ChangeNotifier {

Locale get locale {
final String locale = SpUtil.getString(Constant.locale);
Locale? get locale {
final String locale = SpUtil.getString(Constant.locale) ?? '';
switch(locale) {
case 'zh':
return const Locale('zh', 'CN');
Expand Down
Loading