diff --git a/example/lib/main.dart b/example/lib/main.dart index 2b1aaeb..dff1d9d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -3,7 +3,6 @@ import 'package:example/main_extention.dart'; import 'package:example/main_home.dart'; import 'package:example/main_utils.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:get/get.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/ansu_ui.dart b/lib/ansu_ui.dart index 202bfc0..6469499 100644 --- a/lib/ansu_ui.dart +++ b/lib/ansu_ui.dart @@ -76,3 +76,4 @@ export 'theme/as_theme.dart'; //third party export 'package:velocity_x/velocity_x.dart'; +export 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/dialog/as_bottom_dialog.dart b/lib/dialog/as_bottom_dialog.dart index 7b43cfa..f98c481 100644 --- a/lib/dialog/as_bottom_dialog.dart +++ b/lib/dialog/as_bottom_dialog.dart @@ -32,7 +32,7 @@ class ASBottomDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisSize: MainAxisSize.min, children: [ - ...items.sepWidget(separate: ASDivider())!, + ...(items??[]).sepWidget(separate: ASDivider()), 10.hb, _buildCancel(context), ], diff --git a/lib/dialog/as_dialog.dart b/lib/dialog/as_dialog.dart index eaaeac5..a157652 100644 --- a/lib/dialog/as_dialog.dart +++ b/lib/dialog/as_dialog.dart @@ -73,8 +73,8 @@ class ASDialog extends StatelessWidget { ), ), ), - ...items - .sepWidget(separate: SizedBox(height: _widgetSpacer))!, + ...(items ?? []) + .sepWidget(separate: SizedBox(height: _widgetSpacer)), ], ), ), diff --git a/lib/extension/list_extension.dart b/lib/extension/list_extension.dart index d9b2fdb..c3e8b86 100644 --- a/lib/extension/list_extension.dart +++ b/lib/extension/list_extension.dart @@ -1,13 +1,12 @@ import 'package:flutter/material.dart'; import 'package:ansu_ui/extension/num_extension.dart'; -extension SeparateExt on List? { - List? sepWidget({Widget? separate}) { - if (this == null) return null; - if (this!.isEmpty) return []; - return List.generate(this!.length * 2 - 1, (index) { +extension SeparateExt on List { + List sepWidget({Widget? separate}) { + if (this.isEmpty) return []; + return List.generate(this.length * 2 - 1, (index) { if (index.isEven) - return this![index ~/ 2]; + return this[index ~/ 2]; else return separate ?? 10.wb; }); diff --git a/lib/list_tile/as_card_expandable.dart b/lib/list_tile/as_card_expandable.dart index 289f444..386881d 100644 --- a/lib/list_tile/as_card_expandable.dart +++ b/lib/list_tile/as_card_expandable.dart @@ -109,14 +109,14 @@ class _ASCardExpandableState extends State { children: [ SizedBox(), ...widget.children, - ].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w))!, + ].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w)), ), expanded: Column( children: [ SizedBox(), ...(widget.custom ? [] : widget.children), ...widget.extra, - ].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w))!, + ].sepWidget(separate: ASDivider(indent: 10.w, endIndent: 10.w)), ), ), ); diff --git a/lib/theme/as_theme.dart b/lib/theme/as_theme.dart index c3e470a..d8594d9 100644 --- a/lib/theme/as_theme.dart +++ b/lib/theme/as_theme.dart @@ -23,6 +23,7 @@ class ASTheme { textTheme: ThemeData.light().textTheme.apply( displayColor: Color(0xFF333333), bodyColor: Color(0xFF333333), + fontFamily: 'NotoSansSC', ), inputDecorationTheme: InputDecorationTheme(), primaryColor: kPrimaryColor, diff --git a/lib/utils/camera_view.dart b/lib/utils/camera_view.dart index 66c6593..ac91937 100644 --- a/lib/utils/camera_view.dart +++ b/lib/utils/camera_view.dart @@ -86,7 +86,7 @@ class _CameraViewState extends State { title: '确认', onPressed: () => Navigator.pop(context, widget.file), ), - ].sepWidget(separate: ASDivider())!, + ].sepWidget(separate: ASDivider()), ), ), );