diff --git a/example/lib/extension/example_string_ext.dart b/example/lib/extension/example_string_ext.dart index a64df28..28cf37b 100644 --- a/example/lib/extension/example_string_ext.dart +++ b/example/lib/extension/example_string_ext.dart @@ -1,9 +1,7 @@ import 'package:ansu_ui/ansu_ui.dart'; import 'package:example/codeviewer/code_segments.dart'; -import 'package:example/common/code_view.dart'; import 'package:example/component/example_scaffold.dart'; import 'package:flutter/material.dart'; -import 'package:get/get.dart'; class ExampleStringExt extends StatefulWidget { ExampleStringExt({Key key}) : super(key: key); diff --git a/example/lib/main_utils.dart b/example/lib/main_utils.dart index 2f23b01..f9de411 100644 --- a/example/lib/main_utils.dart +++ b/example/lib/main_utils.dart @@ -1,4 +1,3 @@ -import 'package:example/extension/example_num_ext.dart'; import 'package:example/util_view/example_camera_view.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; diff --git a/example/lib/widgets/example_numeric_button.dart b/example/lib/widgets/example_numeric_button.dart index 8f3fca7..5299673 100644 --- a/example/lib/widgets/example_numeric_button.dart +++ b/example/lib/widgets/example_numeric_button.dart @@ -13,7 +13,7 @@ class ExampleNumericButton extends StatefulWidget { class _ExampleNumericButtonState extends State { _showSnack(BuildContext context, String title) { - Scaffold.of(context).showSnackBar( + ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text(title)), ); } diff --git a/example/pubspec.lock b/example/pubspec.lock index f587c51..3097693 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -14,7 +14,7 @@ packages: dependency: transitive description: name: animator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" ansu_ui: @@ -28,84 +28,84 @@ packages: dependency: "direct main" description: name: args - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.0" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" bot_toast: dependency: transitive description: name: bot_toast - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.15.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" expandable: dependency: transitive description: name: expandable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.0" flutter: @@ -131,14 +131,14 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" flutter_screenutil: dependency: transitive description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" flutter_web_plugins: @@ -150,105 +150,105 @@ packages: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.4" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" grinder: dependency: "direct main" description: name: grinder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.0" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" image_picker: dependency: transitive description: name: image_picker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.3" lpinyin: dependency: transitive description: name: lpinyin - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" sky_engine: @@ -260,56 +260,56 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.1" states_rebuilder: dependency: transitive description: name: states_rebuilder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0+1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" velocity_x: dependency: transitive description: name: velocity_x - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.6.1" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" sdks: diff --git a/lib/badge/as_badge.dart b/lib/badge/as_badge.dart index 472e688..31a50db 100644 --- a/lib/badge/as_badge.dart +++ b/lib/badge/as_badge.dart @@ -5,17 +5,15 @@ import 'package:velocity_x/velocity_x.dart'; class ASBadge extends StatelessWidget { final Widget child; - final String tag; - const ASBadge({Key key, @required this.child, this.tag}) - : assert(child != null), - super(key: key); + final String? tag; + const ASBadge({Key? key, required this.child, this.tag}) : super(key: key); @override Widget build(BuildContext context) { return (tag?.length ?? 0) == 0 ? child : Stack( - overflow: Overflow.visible, + clipBehavior: Clip.none, children: [ child, Positioned( @@ -36,7 +34,7 @@ class ASBadge extends StatelessWidget { borderRadius: 8.radius, ), height: 16.w, - child: tag.text.white.size(10).make(), + child: (tag ?? '').text.white.size(10).make(), ), ), ], diff --git a/lib/bar/as_navigation_bar.dart b/lib/bar/as_navigation_bar.dart index 33349d7..761df54 100644 --- a/lib/bar/as_navigation_bar.dart +++ b/lib/bar/as_navigation_bar.dart @@ -5,7 +5,7 @@ import 'package:ansu_ui/styles/as_colors.dart'; class ASNavigationBar extends StatefulWidget { final List items; final TabController controller; - ASNavigationBar({Key key, @required this.items, this.controller}) + ASNavigationBar({Key? key, required this.items,required this.controller}) : super(key: key); @override diff --git a/lib/bar/as_navigation_item.dart b/lib/bar/as_navigation_item.dart index a6ba45b..83fdb19 100644 --- a/lib/bar/as_navigation_item.dart +++ b/lib/bar/as_navigation_item.dart @@ -6,7 +6,7 @@ BottomNavigationBarItem asNavigationItem( String path1, String path2, String title, { - String tag, + String? tag, }) { Widget icon = Image.asset( path1, diff --git a/lib/bar/as_tab_indicator.dart b/lib/bar/as_tab_indicator.dart index bc03bdd..b2b6dc7 100644 --- a/lib/bar/as_tab_indicator.dart +++ b/lib/bar/as_tab_indicator.dart @@ -9,44 +9,42 @@ class ASTabIndicator extends Decoration { const ASTabIndicator({ this.borderSide = const BorderSide(width: 4.0, color: Colors.white), this.insets = EdgeInsets.zero, - }) : assert(borderSide != null), - assert(insets != null); + }); final BorderSide borderSide; final EdgeInsetsGeometry insets; @override - Decoration lerpFrom(Decoration a, double t) { + Decoration? lerpFrom(Decoration? a, double t) { if (a is ASTabIndicator) { return ASTabIndicator( borderSide: BorderSide.lerp(a.borderSide, borderSide, t), - insets: EdgeInsetsGeometry.lerp(a.insets, insets, t), + insets: EdgeInsetsGeometry.lerp(a.insets, insets, t)!, ); } return super.lerpFrom(a, t); } @override - Decoration lerpTo(Decoration b, double t) { + Decoration? lerpTo(Decoration? b, double t) { if (b is ASTabIndicator) { return ASTabIndicator( borderSide: BorderSide.lerp(borderSide, b.borderSide, t), - insets: EdgeInsetsGeometry.lerp(insets, b.insets, t), + insets: EdgeInsetsGeometry.lerp(insets, b.insets, t)!, ); } return super.lerpTo(b, t); } @override - _UnderlinePainter createBoxPainter([VoidCallback onChanged]) { + _UnderlinePainter createBoxPainter([VoidCallback? onChanged]) { return _UnderlinePainter(this, onChanged); } } class _UnderlinePainter extends BoxPainter { - _UnderlinePainter(this.decoration, VoidCallback onChanged) - : assert(decoration != null), - super(onChanged); + _UnderlinePainter(this.decoration, VoidCallback? onChanged) + : super(onChanged); final ASTabIndicator decoration; @@ -54,8 +52,6 @@ class _UnderlinePainter extends BoxPainter { EdgeInsetsGeometry get insets => decoration.insets; Rect _indicatorRectFor(Rect rect, TextDirection textDirection) { - assert(rect != null); - assert(textDirection != null); final Rect indicator = insets.resolve(textDirection).deflateRect(rect); return Rect.fromLTWH( indicator.left, @@ -67,10 +63,9 @@ class _UnderlinePainter extends BoxPainter { @override void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { - assert(configuration != null); assert(configuration.size != null); - final Rect rect = offset & configuration.size; - final TextDirection textDirection = configuration.textDirection; + final Rect rect = offset & configuration.size!; + final TextDirection textDirection = configuration.textDirection!; final Rect indicator = _indicatorRectFor(rect, textDirection).deflate(borderSide.width / 2.0); final Paint paint = borderSide.toPaint() diff --git a/lib/bar/as_tabbar.dart b/lib/bar/as_tabbar.dart index 0a5476c..06056e6 100644 --- a/lib/bar/as_tabbar.dart +++ b/lib/bar/as_tabbar.dart @@ -12,9 +12,9 @@ import 'package:velocity_x/velocity_x.dart'; /// [controller] see more TabController class ASTabBar extends StatelessWidget implements PreferredSizeWidget { ///items - final List items; + final List? items; - final List tabItems; + final List? tabItems; /// TabController final TabController controller; @@ -22,9 +22,9 @@ class ASTabBar extends StatelessWidget implements PreferredSizeWidget { ///可滚动 final bool isScrollable; ASTabBar( - {Key key, - @required this.items, - @required this.controller, + {Key? key, + required this.items, + required this.controller, this.isScrollable = false}) : tabItems = null, super(key: key); @@ -42,9 +42,9 @@ class ASTabBar extends StatelessWidget implements PreferredSizeWidget { ///``` /// ASTabBar.tag( - {Key key, - @required this.tabItems, - @required this.controller, + {Key? key, + required this.tabItems, + required this.controller, this.isScrollable = false}) : items = null, super(key: key); @@ -58,15 +58,15 @@ class ASTabBar extends StatelessWidget implements PreferredSizeWidget { isScrollable: isScrollable, controller: controller, tabs: isTag - ? tabItems.map((e) { + ? tabItems!.map((e) { return Tab( child: ASBadge( - child: e.title.text.make(), + child: e.title!.text.make(), tag: e.tag, ), ); }).toList() - : items + : items! .map((e) => Tab( child: e.text.make(), )) diff --git a/lib/bar/as_tabbar_item.dart b/lib/bar/as_tabbar_item.dart index f89ac89..c69ed81 100644 --- a/lib/bar/as_tabbar_item.dart +++ b/lib/bar/as_tabbar_item.dart @@ -1,6 +1,6 @@ class ASTabBarItem { - String title; - String tag; + String? title; + String? tag; ASTabBarItem({ this.title, this.tag, diff --git a/lib/box/as_check_box.dart b/lib/box/as_check_box.dart index 964bc74..e0bb7ad 100644 --- a/lib/box/as_check_box.dart +++ b/lib/box/as_check_box.dart @@ -8,12 +8,12 @@ class ASCheckBox extends StatelessWidget { final bool checkStyle; ///选中时颜色 - final Color color; - ASCheckBox({Key key, this.value = false, this.color}) + final Color? color; + ASCheckBox({Key? key, this.value = false, this.color}) : checkStyle = false, super(key: key); - ASCheckBox.checkStyle({Key key, this.value = false, this.color}) + ASCheckBox.checkStyle({Key? key, this.value = false, this.color}) : checkStyle = true, super(key: key); diff --git a/lib/buttons/as_back_button.dart b/lib/buttons/as_back_button.dart index bee91ef..5731fc4 100644 --- a/lib/buttons/as_back_button.dart +++ b/lib/buttons/as_back_button.dart @@ -9,9 +9,9 @@ import 'package:ansu_ui/styles/as_colors.dart'; ///ASBackButton.white 白色返回按钮 class ASBackButton extends StatelessWidget { final Color color; - const ASBackButton({Key key, this.color = kDarkColor}) : super(key: key); + const ASBackButton({Key? key, this.color = kDarkColor}) : super(key: key); - const ASBackButton.white({Key key}) + const ASBackButton.white({Key? key}) : color = kForegroundColor, super(key: key); diff --git a/lib/buttons/as_bottom_button.dart b/lib/buttons/as_bottom_button.dart index 07843a6..d8ad6e3 100644 --- a/lib/buttons/as_bottom_button.dart +++ b/lib/buttons/as_bottom_button.dart @@ -7,40 +7,40 @@ class ASBottomButton extends StatelessWidget { final dynamic title; ///颜色 - final Color bgcolor; + final Color? bgcolor; ///文字颜色 - final Color textColor; + final Color? textColor; ///文字风格 - final TextStyle textStyle; + final TextStyle? textStyle; ///内边距 - final EdgeInsetsGeometry padding; + final EdgeInsetsGeometry? padding; ///不可点击时颜色 - final Color disableColor; + final Color? disableColor; ///不可点击时文字颜色 - final Color disableTextColor; + final Color? disableTextColor; ///宽度 - final double width; + final double? width; ///渐变起始位置 - final AlignmentGeometry begin; + final AlignmentGeometry? begin; ///渐变结束位置 - final AlignmentGeometry end; + final AlignmentGeometry? end; ///渐变颜色 - final List colors; + final List? colors; ///点击事件 - final VoidCallback onPressed; + final VoidCallback? onPressed; ASBottomButton( - {Key key, + {Key? key, this.title, this.bgcolor, this.textColor, @@ -56,8 +56,8 @@ class ASBottomButton extends StatelessWidget { : super(key: key); ASBottomButton.infinity({ - Key key, - @required this.title, + Key? key, + required this.title, this.onPressed, this.textStyle, this.padding, @@ -72,8 +72,8 @@ class ASBottomButton extends StatelessWidget { super(key: key); ASBottomButton.gradient( - {Key key, - @required this.title, + {Key? key, + required this.title, this.onPressed, this.bgcolor, this.textStyle, @@ -87,8 +87,8 @@ class ASBottomButton extends StatelessWidget { width = double.infinity, super(key: key); ASBottomButton.shortWhite({ - Key key, - @required this.title, + Key? key, + required this.title, this.onPressed, this.bgcolor, this.textStyle, @@ -101,7 +101,7 @@ class ASBottomButton extends StatelessWidget { textColor = kPrimaryColor, width = double.infinity, super(key: key); - Widget get _title { + Widget? get _title { if (title is String) return Text( title, @@ -123,7 +123,7 @@ class ASBottomButton extends StatelessWidget { gradient: LinearGradient( begin: begin ?? Alignment.bottomRight, end: end ?? Alignment.topLeft, - colors: colors ?? [bgcolor, bgcolor], + colors: colors ?? [bgcolor!, bgcolor!], ), ), child: MaterialButton( diff --git a/lib/buttons/as_button.dart b/lib/buttons/as_button.dart index 6c13740..cd055b3 100644 --- a/lib/buttons/as_button.dart +++ b/lib/buttons/as_button.dart @@ -5,46 +5,46 @@ import 'package:ansu_ui/styles/as_colors.dart'; ///安速按钮 class ASButton extends StatelessWidget { ///按钮颜色 - final Color bgcolor; + final Color? bgcolor; ///按钮文字 ///动态类型,可以是string或者widget final dynamic title; ///按钮圆角 - final double radius; + final double? radius; ///按钮边框 final bool outline; ///按钮边框颜色 - final Color outlineColor; + final Color? outlineColor; ///按钮文字颜色 ///若已定义文字风格则此属性不生效 - final Color textColor; + final Color? textColor; ///按钮文字格式 - final TextStyle textStyle; + final TextStyle? textStyle; ///内边距 - final EdgeInsets padding; + final EdgeInsets? padding; ///点击事件 - final VoidCallback onPressed; + final VoidCallback? onPressed; ///宽度 - final double width; + final double? width; ///不可点击颜色 - final Color disableColor; + final Color? disableColor; ///不可点击时文字颜色 - final Color disableTextColor; + final Color? disableTextColor; - final Color splashColor; + final Color? splashColor; ASButton({ - Key key, + Key? key, this.bgcolor, this.radius, this.outline = false, @@ -52,7 +52,7 @@ class ASButton extends StatelessWidget { this.textColor, this.textStyle, this.padding, - @required this.title, + required this.title, this.onPressed, this.width, this.disableColor, @@ -61,13 +61,13 @@ class ASButton extends StatelessWidget { }) : super(key: key); ASButton.danger({ - Key key, + Key? key, this.textStyle, this.padding, this.radius, this.bgcolor, this.onPressed, - @required this.title, + required this.title, this.width, this.disableColor, this.disableTextColor, @@ -78,12 +78,12 @@ class ASButton extends StatelessWidget { super(key: key); ASButton.info( - {Key key, + {Key? key, this.bgcolor, this.radius, this.textStyle, this.padding, - @required this.title, + required this.title, this.onPressed, this.width, this.disableColor, @@ -95,12 +95,12 @@ class ASButton extends StatelessWidget { super(key: key); ASButton.warn({ - Key key, + Key? key, this.radius, this.outlineColor, this.textStyle, this.padding, - @required this.title, + required this.title, this.onPressed, this.width, this.disableColor, @@ -111,12 +111,12 @@ class ASButton extends StatelessWidget { this.splashColor = ColorTool.getSplashColor(kPrimaryColor), super(key: key); ASButton.operation( - {Key key, + {Key? key, this.radius, this.outlineColor, this.textStyle, this.padding, - @required this.title, + required this.title, this.onPressed, this.width, this.disableColor, @@ -127,8 +127,8 @@ class ASButton extends StatelessWidget { outline = false, super(key: key); ASButton.order({ - Key key, - @required this.title, + Key? key, + required this.title, this.onPressed, this.outlineColor, this.width, @@ -159,12 +159,12 @@ class ASButton extends StatelessWidget { shape: radius == null ? StadiumBorder( side: outline - ? BorderSide(color: outlineColor, width: 0.5.w) + ? BorderSide(color: outlineColor!, width: 0.5.w) : BorderSide.none, ) : RoundedRectangleBorder( side: outline - ? BorderSide(color: outlineColor, width: 0.5.w) + ? BorderSide(color: outlineColor!, width: 0.5.w) : BorderSide.none, borderRadius: BorderRadius.circular(radius ?? 15.5.w)), color: bgcolor ?? kForegroundColor, diff --git a/lib/buttons/as_gradient_button.dart b/lib/buttons/as_gradient_button.dart index 9f382a7..9814f08 100644 --- a/lib/buttons/as_gradient_button.dart +++ b/lib/buttons/as_gradient_button.dart @@ -9,40 +9,40 @@ class ASGradientButton extends StatelessWidget { ///按钮文字颜色 ///若已定义文字风格则此属性不生效 - final Color textColor; + final Color? textColor; ///圆角 - final double radius; + final double? radius; ///按钮文字风格 - final TextStyle textStyle; + final TextStyle? textStyle; ///内边距 - final EdgeInsetsGeometry padding; + final EdgeInsetsGeometry? padding; ///点击事件 - final VoidCallback onPressed; + final VoidCallback? onPressed; ///渐变颜色 - final List colors; + final List? colors; ///开始位置 - final AlignmentGeometry begin; + final AlignmentGeometry? begin; ///结束位置 - final AlignmentGeometry end; + final AlignmentGeometry? end; ///宽度 - final double width; + final double? width; ///不可点击颜色 - final Color disableColor; + final Color? disableColor; ///不可点击文字颜色 - final Color disableTextColor; + final Color? disableTextColor; ASGradientButton( - {Key key, - @required this.title, + {Key? key, + required this.title, this.textColor, this.radius, this.textStyle, @@ -56,8 +56,8 @@ class ASGradientButton extends StatelessWidget { this.disableTextColor}) : super(key: key); ASGradientButton.pay({ - Key key, - @required this.title, + Key? key, + required this.title, this.textStyle, this.onPressed, this.disableColor, @@ -72,8 +72,8 @@ class ASGradientButton extends StatelessWidget { super(key: key); ASGradientButton.operation( - {Key key, - @required this.title, + {Key? key, + required this.title, this.textColor, this.onPressed, this.disableColor, @@ -91,13 +91,13 @@ class ASGradientButton extends StatelessWidget { super(key: key); bool get isNullFunc => onPressed == null; - List get _colors { + List? get _colors { if (colors == null) return null; else { return List.generate( - colors.length, - (index) => colors[index].withOpacity(isNullFunc ? 0.5 : 1), + colors!.length, + (index) => colors![index].withOpacity(isNullFunc ? 0.5 : 1), ); } } diff --git a/lib/buttons/as_long_button.dart b/lib/buttons/as_long_button.dart index 757fed4..3360029 100644 --- a/lib/buttons/as_long_button.dart +++ b/lib/buttons/as_long_button.dart @@ -8,42 +8,42 @@ class ASLongButton extends StatelessWidget { final dynamic title; ///按钮背景颜色 - final Color bgColor; + final Color? bgColor; ///按钮文字颜色 ///若已定义文字风格则此属性不生效 - final Color textColor; + final Color? textColor; ///圆角 - final double radius; + final double? radius; ///按钮文字风格 - final TextStyle textStyle; + final TextStyle? textStyle; ///内边距 - final Padding padding; + final Padding? padding; ///是否有边框 final bool outline; ///边框颜色 - final Color outlineColor; + final Color? outlineColor; ///点击事件 - final VoidCallback onPressed; + final VoidCallback? onPressed; ///宽度 - final double width; + final double? width; ///不可点击颜色 - final Color disableColor; + final Color? disableColor; ///不可点击文字颜色 - final Color disableTextColor; + final Color? disableTextColor; ASLongButton( - {Key key, - @required this.title, + {Key? key, + required this.title, this.bgColor, this.textColor, this.radius, @@ -58,12 +58,12 @@ class ASLongButton extends StatelessWidget { : super(key: key); ASLongButton.solid({ - Key key, + Key? key, this.textStyle, this.padding, this.outlineColor, this.radius, - @required this.title, + required this.title, this.onPressed, this.width, this.disableTextColor, @@ -73,12 +73,12 @@ class ASLongButton extends StatelessWidget { disableColor = Color(0xFFC1BDB5), super(key: key); ASLongButton.hollow( - {Key key, + {Key? key, this.radius, this.textStyle, this.padding, this.onPressed, - @required this.title, + required this.title, this.width, this.disableColor, this.disableTextColor}) @@ -101,10 +101,10 @@ class ASLongButton extends StatelessWidget { ? Text(title, style: textStyle ?? TextStyle(fontSize: 20.sp)) : title, - padding: padding ?? EdgeInsets.symmetric(vertical: 8.w), + padding: padding as EdgeInsetsGeometry? ?? EdgeInsets.symmetric(vertical: 8.w), shape: RoundedRectangleBorder( side: outline - ? BorderSide(color: outlineColor, width: 1.w) + ? BorderSide(color: outlineColor!, width: 1.w) : BorderSide.none, borderRadius: BorderRadius.circular(radius ?? 22.5.w)), color: bgColor ?? kForegroundColor, diff --git a/lib/buttons/as_material_button.dart b/lib/buttons/as_material_button.dart index 1bddc6a..f99d806 100644 --- a/lib/buttons/as_material_button.dart +++ b/lib/buttons/as_material_button.dart @@ -14,30 +14,30 @@ import 'package:ansu_ui/extension/num_extension.dart'; /// ///padding = 0.edge class ASMaterialButton extends StatelessWidget { - final VoidCallback onPressed; - final double height; - final Widget icon; - final double radius; + final VoidCallback? onPressed; + final double? height; + final Widget? icon; + final double? radius; final Widget child; - final EdgeInsets padding; - final Color color; + final EdgeInsets? padding; + final Color? color; const ASMaterialButton({ - Key key, + Key? key, this.onPressed, this.height, this.icon, - @required this.child, + required this.child, this.radius, this.padding, this.color, }) : super(key: key); ASMaterialButton.dropdown({ - Key key, + Key? key, this.onPressed, this.height, - @required this.child, + required this.child, this.radius, this.padding, this.color, @@ -63,7 +63,7 @@ class ASMaterialButton extends StatelessWidget { children: [ child, 4.wb, - icon, + icon!, ], ), shape: RoundedRectangleBorder( diff --git a/lib/buttons/as_numeric_button.dart b/lib/buttons/as_numeric_button.dart index e15efcd..ae5f8a7 100644 --- a/lib/buttons/as_numeric_button.dart +++ b/lib/buttons/as_numeric_button.dart @@ -23,25 +23,25 @@ class ASNumericButton extends StatefulWidget { final int maxValue; ///后缀 - final String suffix; + final String? suffix; ///达到最大值 - final Function(int value) reachMax; + final Function(int value)? reachMax; ///达到最小值 - final Function(int value) reachMin; + final Function(int value)? reachMin; /// final Function(int value) onChange; ASNumericButton({ - Key key, - @required this.initValue, + Key? key, + required this.initValue, this.suffix, this.minValue = 0, this.maxValue = 9999, this.reachMax, this.reachMin, - @required this.onChange, + required this.onChange, }) : super(key: key); @override @@ -50,18 +50,18 @@ class ASNumericButton extends StatefulWidget { class _ASNumericButtonState extends State { FocusNode _focusNode = FocusNode(); - TextEditingController _controller; + TextEditingController? _controller; BorderSide _outline = BorderSide( color: Color(0xFFD8D4D4), width: 1.w, ); - int _displayValue; + late int _displayValue; Widget _buildButton({ - @required CustomPainter painter, - @required VoidCallback onPressed, - @required BorderRadius borderRadius, + required CustomPainter painter, + required VoidCallback onPressed, + required BorderRadius borderRadius, }) { return Container( height: 32.w, @@ -113,10 +113,10 @@ class _ASNumericButtonState extends State { if (_displayValue > widget.minValue) { _displayValue--; widget.onChange(_displayValue); - _controller.text = _displayValue.toString(); + _controller!.text = _displayValue.toString(); setState(() {}); } else { - if (widget.reachMin != null) widget.reachMin(_displayValue); + if (widget.reachMin != null) widget.reachMin!(_displayValue); } }, borderRadius: BorderRadius.horizontal(left: Radius.circular(16.w)), @@ -134,7 +134,7 @@ class _ASNumericButtonState extends State { keyboardType: TextInputType.number, controller: _controller, onChanged: (text) { - int value = int.tryParse(text); + int? value = int.tryParse(text); _displayValue = value ?? widget.initValue; setState(() {}); widget.onChange(_displayValue); @@ -173,10 +173,10 @@ class _ASNumericButtonState extends State { if (_displayValue < widget.maxValue) { _displayValue++; widget.onChange(_displayValue); - _controller.text = _displayValue.toString(); + _controller!.text = _displayValue.toString(); setState(() {}); } else { - if (widget.reachMax != null) widget.reachMax(_displayValue); + if (widget.reachMax != null) widget.reachMax!(_displayValue); } }, borderRadius: BorderRadius.horizontal(right: Radius.circular(16.w)), diff --git a/lib/buttons/as_radio_button.dart b/lib/buttons/as_radio_button.dart index f7536ee..361496c 100644 --- a/lib/buttons/as_radio_button.dart +++ b/lib/buttons/as_radio_button.dart @@ -5,18 +5,18 @@ import 'package:ansu_ui/extension/num_extension.dart'; class ASRadioButton extends StatefulWidget { /// 选中的值 - final T groupValue; + final T? groupValue; ///按钮标题 - final String title; + final String? title; /// 该按钮的值 - final T value; + final T? value; ///按钮回调 - final Function(T value) onTap; + final Function(T value)? onTap; ASRadioButton({ - Key key, + Key? key, this.groupValue, this.title, this.value, @@ -32,7 +32,7 @@ class _ASRadioButtonState extends State { @override Widget build(BuildContext context) { return InkWell( - onTap: () => widget.onTap(widget.value), + onTap: () => widget.onTap!(widget.value), borderRadius: 13.radius, child: AnimatedContainer( padding: EdgeInsets.symmetric( @@ -40,7 +40,7 @@ class _ASRadioButtonState extends State { vertical: _selected ? 5.w : 4.w, ), child: AnimatedDefaultTextStyle( - child: Text(widget.title), + child: Text(widget.title!), style: TextStyle( color: _selected ? kLightTextColor : kTextSubColor, ), diff --git a/lib/dialog/as_bottom_dialog.dart b/lib/dialog/as_bottom_dialog.dart index 2a60935..7b43cfa 100644 --- a/lib/dialog/as_bottom_dialog.dart +++ b/lib/dialog/as_bottom_dialog.dart @@ -11,8 +11,8 @@ import 'package:velocity_x/velocity_x.dart'; /// ///with auto cancel class ASBottomDialog extends StatelessWidget { - final List items; - ASBottomDialog({Key key, @required this.items}) : super(key: key); + final List? items; + ASBottomDialog({Key? key, required this.items}) : super(key: key); _buildCancel(BuildContext context) { return ASMaterialButton( @@ -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_bottom_dialog_item.dart b/lib/dialog/as_bottom_dialog_item.dart index cdb5641..5561fb8 100644 --- a/lib/dialog/as_bottom_dialog_item.dart +++ b/lib/dialog/as_bottom_dialog_item.dart @@ -7,8 +7,8 @@ import 'package:ansu_ui/extension/text_style_extension.dart'; ///ASBottomDialog item class ASBottomDialogItem extends StatelessWidget { final Widget title; - final VoidCallback onPressed; - const ASBottomDialogItem({Key key, @required this.title, this.onPressed}) + final VoidCallback? onPressed; + const ASBottomDialogItem({Key? key, required this.title, this.onPressed}) : super(key: key); @override @@ -18,7 +18,7 @@ class ASBottomDialogItem extends StatelessWidget { color: kForegroundColor, onPressed: () { Navigator.pop(context); - onPressed(); + onPressed!(); }, child: DefaultTextStyle( style: TextStyle().black.bold.size(18), diff --git a/lib/dialog/as_delete_dialog.dart b/lib/dialog/as_delete_dialog.dart index 14f5312..adc6b15 100644 --- a/lib/dialog/as_delete_dialog.dart +++ b/lib/dialog/as_delete_dialog.dart @@ -7,19 +7,19 @@ import 'package:ansu_ui/dialog/as_dialog_button.dart'; class ASDeleteDialog extends StatelessWidget { ///标题 - final String title; + final String? title; /// 内容,字符串或widget final dynamic body; ///删除按钮 - final Widget button; + final Widget? button; ///点击回调 - final VoidCallback onpressed; + final VoidCallback? onpressed; const ASDeleteDialog( - {Key key, this.title, this.body, this.button, this.onpressed}) + {Key? key, this.title, this.body, this.button, this.onpressed}) : super(key: key); @override @@ -61,7 +61,7 @@ class ASDeleteDialog extends StatelessWidget { : Container( margin: EdgeInsets.only(bottom: 15.w), child: Text( - this.title, + this.title!, style: TextStyle( color: kTextColor, fontSize: 18.sp, diff --git a/lib/dialog/as_dialog.dart b/lib/dialog/as_dialog.dart index 3148e5c..eaaeac5 100644 --- a/lib/dialog/as_dialog.dart +++ b/lib/dialog/as_dialog.dart @@ -2,31 +2,30 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:ansu_ui/styles/as_colors.dart'; -import 'package:ansu_ui/extension/num_extension.dart'; import 'package:ansu_ui/extension/list_extension.dart'; class ASDialog extends StatelessWidget { final bool close; ///按钮组 - final List items; + final List? items; ///按钮与按钮之间的间距 - final double spacer; + final double? spacer; - final EdgeInsets padding; + final EdgeInsets? padding; final Widget child; - final EdgeInsets childPadding; + final EdgeInsets? childPadding; ASDialog({ - Key key, + Key? key, this.close = false, this.items, this.spacer, this.padding, - @required this.child, + required this.child, this.childPadding, }) : super(key: key); @@ -75,7 +74,7 @@ class ASDialog extends StatelessWidget { ), ), ...items - .sepWidget(separate: SizedBox(height: _widgetSpacer)), + .sepWidget(separate: SizedBox(height: _widgetSpacer))!, ], ), ), diff --git a/lib/dialog/as_dialog_button.dart b/lib/dialog/as_dialog_button.dart index de943dd..17d9e1a 100644 --- a/lib/dialog/as_dialog_button.dart +++ b/lib/dialog/as_dialog_button.dart @@ -3,14 +3,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:ansu_ui/buttons/as_long_button.dart'; class ASDialogButton extends StatelessWidget { - final String title; - final VoidCallback onPressed; + final String? title; + final VoidCallback? onPressed; final bool outline; const ASDialogButton( - {Key key, this.title, this.onPressed, this.outline = false}) + {Key? key, this.title, this.onPressed, this.outline = false}) : super(key: key); - const ASDialogButton.outline({Key key, this.title, this.onPressed}) + const ASDialogButton.outline({Key? key, this.title, this.onPressed}) : outline = true, super(key: key); diff --git a/lib/dialog/as_show_bottom_dialog.dart b/lib/dialog/as_show_bottom_dialog.dart index a89a45f..717e7f0 100644 --- a/lib/dialog/as_show_bottom_dialog.dart +++ b/lib/dialog/as_show_bottom_dialog.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; ///`items` better with ASBottomDialogItem showASBottomDialog( BuildContext context, { - List items, + List? items, }) async { return await showModalBottomSheet( context: context, diff --git a/lib/divider/as_divider.dart b/lib/divider/as_divider.dart index c906d21..05de8ff 100644 --- a/lib/divider/as_divider.dart +++ b/lib/divider/as_divider.dart @@ -4,12 +4,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; ///安速水平分割线 class ASDivider extends StatelessWidget { final Color color; - final double height; - final double thickness; - final double indent; - final double endIndent; + final double? height; + final double? thickness; + final double? indent; + final double? endIndent; ASDivider({ - Key key, + Key? key, this.indent, this.endIndent, this.color = const Color(0xFFE9E9E9), @@ -34,12 +34,12 @@ class ASDivider extends StatelessWidget { ///安速 垂直分割线 class ASVDivider extends StatelessWidget { final Color color; - final double width; - final double thickness; - final double indent; - final double endIndent; + final double? width; + final double? thickness; + final double? indent; + final double? endIndent; ASVDivider({ - Key key, + Key? key, this.indent, this.endIndent, this.color = const Color(0xFFE9E9E9), diff --git a/lib/drawer/as_drawer.dart b/lib/drawer/as_drawer.dart index d225c92..bc0e197 100644 --- a/lib/drawer/as_drawer.dart +++ b/lib/drawer/as_drawer.dart @@ -8,7 +8,7 @@ import 'package:get/get.dart'; ///pass a value through navigator. /// ///example `Navigator.pop(context,true)` or `Get.back(result:true)` -Future showASDrawer(Widget drawer) async { +Future showASDrawer(Widget drawer) async { return await Get.generalDialog( pageBuilder: (context, animation, secondAnimation) { return drawer; @@ -39,7 +39,7 @@ class ASDrawer extends StatelessWidget { ///子组件List Children /// ///内部为ListView实现 - final List children; + final List? children; ///Padding /// @@ -54,18 +54,18 @@ class ASDrawer extends StatelessWidget { ///left: 26.w, ///right: 26.w, ///``` - final Widget bottom; + final Widget? bottom; ///子组件 /// ///使用该选项,`bottom`、`padding`、`children`将失效 - final Widget child; + final Widget? child; ///默认抽屉 /// ///默认Padding `EdgeInsets.fromLTRB(26.w, 24.w, 26.w, 90.w)` ASDrawer({ - Key key, + Key? key, this.children, this.bottom, this.child, @@ -76,7 +76,7 @@ class ASDrawer extends StatelessWidget { ///自定义Padding ASDrawer.padding({ - Key key, + Key? key, this.padding = EdgeInsets.zero, this.children, this.child, @@ -100,7 +100,7 @@ class ASDrawer extends StatelessWidget { children: [ ListView( padding: padding, - children: children, + children: children!, ), Positioned( child: bottom ?? SizedBox(), diff --git a/lib/extension/list_extension.dart b/lib/extension/list_extension.dart index f0dc735..d9b2fdb 100644 --- a/lib/extension/list_extension.dart +++ b/lib/extension/list_extension.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; import 'package:ansu_ui/extension/num_extension.dart'; -extension SeparateExt on List { - List sepWidget({Widget separate}) { +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) { + 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 edd88b3..289f444 100644 --- a/lib/list_tile/as_card_expandable.dart +++ b/lib/list_tile/as_card_expandable.dart @@ -18,8 +18,8 @@ class ASCardExpandable extends StatefulWidget { ///自定义children和extra的排序,extra不自动排列在children后面。 final bool custom; ASCardExpandable({ - Key key, - @required this.title, + Key? key, + required this.title, this.children = const [], this.extra = const [], this.mid = const [], @@ -28,8 +28,8 @@ class ASCardExpandable extends StatefulWidget { ///自定义children和extra的排序,extra不自动排列在children后面。 ASCardExpandable.custom({ - Key key, - @required this.title, + Key? key, + required this.title, this.children = const [], this.extra = const [], this.mid = const [], @@ -40,7 +40,7 @@ class ASCardExpandable extends StatefulWidget { _ASCardExpandableState createState() => _ASCardExpandableState(); static Widget tile( - {@required String title, @required Widget child, Widget suffix}) { + {required String title, required Widget child, Widget? suffix}) { return Row( textBaseline: TextBaseline.alphabetic, children: [ @@ -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/list_tile/as_edit_tile.dart b/lib/list_tile/as_edit_tile.dart index a6bab67..339d128 100644 --- a/lib/list_tile/as_edit_tile.dart +++ b/lib/list_tile/as_edit_tile.dart @@ -4,19 +4,19 @@ import 'package:ansu_ui/styles/as_colors.dart'; import 'package:ansu_ui/extension/num_extension.dart'; class ASEditTile extends StatelessWidget { - final Widget title; - final FocusNode node; - final String hintText; - final TextEditingController controller; + final Widget? title; + final FocusNode? node; + final String? hintText; + final TextEditingController? controller; ASEditTile({ - Key key, + Key? key, this.title, this.node, this.hintText, this.controller, }) : super(key: key); - FocusNode _node; + final FocusNode? _node = FocusNode(); @override Widget build(BuildContext context) { return GestureDetector( diff --git a/lib/list_tile/as_list_tile.dart b/lib/list_tile/as_list_tile.dart index 4ce5b92..ae2c73f 100644 --- a/lib/list_tile/as_list_tile.dart +++ b/lib/list_tile/as_list_tile.dart @@ -4,21 +4,21 @@ import 'package:ansu_ui/styles/as_colors.dart'; class ASListTile extends StatelessWidget { ///主标题 - final String title; + final String? title; ///动态类型,可传入widget final dynamic text; ///内容 - final Widget trail; + final Widget? trail; ///高度,默认32px - final double height; + final double? height; ///对齐方式 - final CrossAxisAlignment crossAxisAlignment; + final CrossAxisAlignment? crossAxisAlignment; ASListTile({ - Key key, + Key? key, this.title, this.text, this.trail, @@ -26,7 +26,7 @@ class ASListTile extends StatelessWidget { this.crossAxisAlignment, }) : super(key: key); ASListTile.option({ - Key key, + Key? key, this.title, this.text, this.trail, @@ -49,7 +49,7 @@ class ASListTile extends StatelessWidget { Container( width: 85.w, child: Text( - title, + title!, maxLines: 1, overflow: TextOverflow.visible, softWrap: false, diff --git a/lib/list_tile/as_list_tile_x.dart b/lib/list_tile/as_list_tile_x.dart index ba912a7..31e8028 100644 --- a/lib/list_tile/as_list_tile_x.dart +++ b/lib/list_tile/as_list_tile_x.dart @@ -4,14 +4,14 @@ import 'package:ansu_ui/extension/num_extension.dart'; class ASListTileX extends StatelessWidget { final Widget title; - final Widget suffix; - final double height; - final List prefixes; - final Widget child; - final List suffixes; + final Widget? suffix; + final double? height; + final List? prefixes; + final Widget? child; + final List? suffixes; const ASListTileX({ - Key key, - @required this.title, + Key? key, + required this.title, this.suffix, this.height, this.prefixes, diff --git a/lib/list_tile/as_option_tile.dart b/lib/list_tile/as_option_tile.dart index d94297a..8b308ba 100644 --- a/lib/list_tile/as_option_tile.dart +++ b/lib/list_tile/as_option_tile.dart @@ -6,32 +6,32 @@ import 'package:ansu_ui/divider/as_divider.dart'; ///菜单按钮Tile class ASOptionTile extends StatelessWidget { ///应使用 ASOptionTileItem - final List items; + final List? items; ///单个Widget - final Widget item; + final Widget? item; ///内边距 - final EdgeInsetsGeometry padding; + final EdgeInsetsGeometry? padding; ///标题 final dynamic leading; ///item 推荐使用`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile` - ASOptionTile({Key key, this.items, this.item, this.padding, this.leading}) + ASOptionTile({Key? key, this.items, this.item, this.padding, this.leading}) : super(key: key); ///单个子组件的Tile ASOptionTile.single( - {Key key, @required this.item, this.padding, this.leading}) + {Key? key, required this.item, this.padding, this.leading}) : items = [], super(key: key); - int get length => items.length; + int get length => items!.length; @override Widget build(BuildContext context) { if (this.leading != null) { - this.items.insert( + this.items!.insert( 0, Container( alignment: Alignment.centerLeft, @@ -61,7 +61,7 @@ class ASOptionTile extends StatelessWidget { children: List.generate(length * 2 - 1, (index) { final displayIndex = index ~/ 2; if (index.isEven) - return items[displayIndex]; + return items![displayIndex]; else return this.padding == null ? ASDivider(indent: 10.w, endIndent: 10.w) diff --git a/lib/list_tile/as_option_tile_item.dart b/lib/list_tile/as_option_tile_item.dart index 2c96915..b39b05e 100644 --- a/lib/list_tile/as_option_tile_item.dart +++ b/lib/list_tile/as_option_tile_item.dart @@ -4,11 +4,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:ansu_ui/extension/num_extension.dart'; class ASOptionTileItem extends StatelessWidget { - final Widget leading; - final Widget title; + final Widget? leading; + final Widget? title; final onPressed; const ASOptionTileItem({ - Key key, + Key? key, this.leading, this.title, this.onPressed, @@ -32,7 +32,7 @@ class ASOptionTileItem extends StatelessWidget { color: Colors.black.withOpacity(0.65), fontSize: 14.sp, ), - child: title, + child: title!, ), ), 14.wb, diff --git a/lib/list_tile/as_vertical_tile_item.dart b/lib/list_tile/as_vertical_tile_item.dart index ab7173d..e0ff1cd 100644 --- a/lib/list_tile/as_vertical_tile_item.dart +++ b/lib/list_tile/as_vertical_tile_item.dart @@ -9,12 +9,12 @@ class ASVerticalTileItem extends StatelessWidget { final Widget title; ///child - final Widget child; + final Widget? child; - final EdgeInsets padding; + final EdgeInsets? padding; ASVerticalTileItem({ - Key key, - @required this.title, + Key? key, + required this.title, this.child, this.padding, }) : super(key: key); @@ -43,7 +43,7 @@ class ASVerticalTileItem extends StatelessWidget { ), 13.hb, ASDivider(), - child, + child!, ], ), ); diff --git a/lib/pickers/as_city_picker.dart b/lib/pickers/as_city_picker.dart index 721dd27..cc07d4f 100644 --- a/lib/pickers/as_city_picker.dart +++ b/lib/pickers/as_city_picker.dart @@ -5,14 +5,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; class ASCityPicker extends StatefulWidget { - ASCityPicker({Key key}) : super(key: key); + ASCityPicker({Key? key}) : super(key: key); @override _ASCityPickerState createState() => _ASCityPickerState(); } class _ASCityPickerState extends State { - double getFontSize(String text) { + double getFontSize(String? text) { double fontSize = 13.sp; int len = text?.length ?? 0; if (len >= 1 && len <= 3) { @@ -31,9 +31,9 @@ class _ASCityPickerState extends State { return fontSize; } - ProvinceModel _selectedProvince; - CityModel _selectedCity; - CityModel _selectedDistrict; + late ProvinceModel _selectedProvince; + late CityModel _selectedCity; + CityModel? _selectedDistrict; FixedExtentScrollController _cityController = FixedExtentScrollController(); FixedExtentScrollController _districtController = @@ -48,7 +48,7 @@ class _ASCityPickerState extends State { @override void dispose() { - _cityController?.dispose(); + _cityController.dispose(); super.dispose(); } @@ -88,7 +88,7 @@ class _ASCityPickerState extends State { children: CityUtil.provinceModel .map((e) => Center( child: Text( - e.name, + e.name!, style: TextStyle( fontSize: getFontSize(e.name), ), @@ -122,7 +122,7 @@ class _ASCityPickerState extends State { children: CityUtil.getCityModelByCode(_selectedProvince.code) .map((e) => Center( child: Text( - e.name, + e.name!, style: TextStyle( fontSize: getFontSize(e.name), ), @@ -146,7 +146,7 @@ class _ASCityPickerState extends State { children: CityUtil.getCityModelByCode(_selectedCity.code) .map((e) => Center( child: Text( - e.name, + e.name!, style: TextStyle( fontSize: getFontSize(e.name), ), diff --git a/lib/pickers/as_date_picker.dart b/lib/pickers/as_date_picker.dart index bb50b03..64efd8a 100644 --- a/lib/pickers/as_date_picker.dart +++ b/lib/pickers/as_date_picker.dart @@ -5,14 +5,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; //时间选择器内部实现 class _ASDatePickerWidget extends StatefulWidget { - _ASDatePickerWidget({Key key}) : super(key: key); + _ASDatePickerWidget({Key? key}) : super(key: key); @override _ASDatePickerWidgetState createState() => _ASDatePickerWidgetState(); } class _ASDatePickerWidgetState extends State<_ASDatePickerWidget> { - DateTime _dateTime; + DateTime? _dateTime; @override void initState() { super.initState(); @@ -57,7 +57,7 @@ class _ASDatePickerWidgetState extends State<_ASDatePickerWidget> { ///```dart ///Navigator.pop(context,dateTime) ///``` -Future asDatePicker(BuildContext context) async { +Future asDatePicker(BuildContext context) async { return await showModalBottomSheet( context: context, builder: (context) { diff --git a/lib/pickers/as_date_range_picker_part.dart b/lib/pickers/as_date_range_picker_part.dart index 306058b..3f4ebe7 100644 --- a/lib/pickers/as_date_range_picker_part.dart +++ b/lib/pickers/as_date_range_picker_part.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:ansu_ui/pickers/as_two_date_picker.dart'; class RangeDate { - DateTime start; - DateTime end; + DateTime? start; + DateTime? end; RangeDate({ this.start, this.end, @@ -14,7 +14,7 @@ class RangeDate { /// ///否则返回`RangeDate` Future show2DatePicker(BuildContext context, - {bool isAnHour, RangeDate date}) async { + {bool? isAnHour, RangeDate? date}) async { return await showModalBottomSheet( context: context, builder: (context) { diff --git a/lib/pickers/as_picker_box.dart b/lib/pickers/as_picker_box.dart index af53715..8566491 100644 --- a/lib/pickers/as_picker_box.dart +++ b/lib/pickers/as_picker_box.dart @@ -4,22 +4,22 @@ import 'package:ansu_ui/styles/as_colors.dart'; import 'package:ansu_ui/divider/as_divider.dart'; class ASPickerBox extends StatelessWidget { - final VoidCallback onPressed; + final VoidCallback? onPressed; final String confirmString; - final String title; + final String? title; final Widget child; const ASPickerBox( - {Key key, + {Key? key, this.onPressed, this.confirmString = '完成', this.title, - @required this.child}) + required this.child}) : super(key: key); _buildButton({ - @required String title, - @required VoidCallback onPressed, + required String title, + required VoidCallback? onPressed, }) { return TextButton( style: ButtonStyle( diff --git a/lib/pickers/as_show_city_picker.dart b/lib/pickers/as_show_city_picker.dart index f8a8445..14948f8 100644 --- a/lib/pickers/as_show_city_picker.dart +++ b/lib/pickers/as_show_city_picker.dart @@ -2,8 +2,8 @@ import 'package:ansu_ui/utils/city_util.dart'; import 'package:flutter/material.dart'; import 'package:ansu_ui/pickers/as_city_picker.dart'; -Future showCityPicker(BuildContext context, - {String initCode}) async { +Future showCityPicker(BuildContext context, + {String? initCode}) async { return await showModalBottomSheet( context: context, builder: (context) { diff --git a/lib/pickers/as_two_date_picker.dart b/lib/pickers/as_two_date_picker.dart index a04d351..401de80 100644 --- a/lib/pickers/as_two_date_picker.dart +++ b/lib/pickers/as_two_date_picker.dart @@ -8,9 +8,9 @@ import 'package:ansu_ui/buttons/as_long_button.dart'; import 'package:velocity_x/velocity_x.dart'; class AS2DatePicker extends StatefulWidget { - final bool isAnHour; - final RangeDate date; - AS2DatePicker({Key key, this.isAnHour, this.date}) : super(key: key); + final bool? isAnHour; + final RangeDate? date; + AS2DatePicker({Key? key, this.isAnHour, this.date}) : super(key: key); @override _AS2DatePickerState createState() => _AS2DatePickerState(); @@ -20,8 +20,8 @@ class _AS2DatePickerState extends State { int _selectedDay = 0; DateTime get now => DateTime.now(); - DateTime _selectedDate; - PageController _pageController; + DateTime? _selectedDate; + PageController? _pageController; DateTimeRange get singleHour => DateTimeRange( start: now, @@ -99,8 +99,8 @@ class _AS2DatePickerState extends State { return ListView.builder( padding: 8.edge, itemBuilder: (context, index) { - bool sameItem = now.day == _selectedDate.day && - _selectedDate.hour == startHour + index; + bool sameItem = now.day == _selectedDate!.day && + _selectedDate!.hour == startHour + index; if (index == 0) { return _renderButton( '一小时内', @@ -134,8 +134,8 @@ class _AS2DatePickerState extends State { return ListView.builder( padding: 8.edge, itemBuilder: (context, index) { - bool sameItem = (now.day + offsetDay) == _selectedDate.day && - _selectedDate.hour == index; + bool sameItem = (now.day + offsetDay) == _selectedDate!.day && + _selectedDate!.hour == index; return _renderButton( '$index\:00-${index + 1}:00', () { @@ -220,7 +220,7 @@ class _AS2DatePickerState extends State { context, RangeDate( start: _selectedDate, - end: _selectedDate.add(Duration(hours: 1)), + end: _selectedDate!.add(Duration(hours: 1)), )); }, ), diff --git a/lib/pop_up_menu/pop_up_menu.dart b/lib/pop_up_menu/pop_up_menu.dart index 03ff631..8e67ea9 100644 --- a/lib/pop_up_menu/pop_up_menu.dart +++ b/lib/pop_up_menu/pop_up_menu.dart @@ -10,12 +10,12 @@ import 'package:flutter/material.dart'; /// ], /// ); /// ``` -Future showASPopUpMenu({ - @required BuildContext context, - @required List> items, - T initValue, +Future showASPopUpMenu({ + required BuildContext context, + required List> items, + T? initValue, }) async { - final RenderBox renderBox = context.findRenderObject(); + final RenderBox renderBox = context.findRenderObject() as RenderBox; Size size = renderBox.size; return await showMenu( context: context, @@ -23,10 +23,10 @@ Future showASPopUpMenu({ position: RelativeRect.fromRect( Rect.fromPoints( renderBox.localToGlobal(Offset.zero, - ancestor: Overlay.of(context).context.findRenderObject()), + ancestor: Overlay.of(context)!.context.findRenderObject()), renderBox.localToGlobal(size.bottomRight(Offset.zero)), ), - Offset.zero & Overlay.of(context).context.size, + Offset.zero & Overlay.of(context)!.context.size!, ), items: items, shape: RoundedRectangleBorder(borderRadius: 10.radius), diff --git a/lib/refresh/as_refresh.dart b/lib/refresh/as_refresh.dart index 0624a3c..bd762f2 100644 --- a/lib/refresh/as_refresh.dart +++ b/lib/refresh/as_refresh.dart @@ -4,16 +4,16 @@ import 'package:ansu_ui/styles/as_colors.dart'; class ASRefresh extends StatelessWidget { final Widget child; - final Future Function() onLoad; - final Future Function() onRefresh; - final EasyRefreshController controller; + final Future Function()? onLoad; + final Future Function()? onRefresh; + final EasyRefreshController? controller; final bool firstRefresh; - final Widget emptyWidget; - final Widget firstRefreshWidget; - final ScrollController scrollController; + final Widget? emptyWidget; + final Widget? firstRefreshWidget; + final ScrollController? scrollController; ASRefresh({ - Key key, - @required this.child, + Key? key, + required this.child, this.onLoad, this.onRefresh, this.controller, diff --git a/lib/scaffold/as_scaffold.dart b/lib/scaffold/as_scaffold.dart index 3851dac..ba6019f 100644 --- a/lib/scaffold/as_scaffold.dart +++ b/lib/scaffold/as_scaffold.dart @@ -19,33 +19,33 @@ class ASScaffold extends StatelessWidget { final dynamic title; /// `Scaffold` body - final Widget body; + final Widget? body; /// `Scaffold` leading - final Widget leading; + final Widget? leading; /// `Scaffold` actions - final List actions; + final List? actions; /// `Scaffold` bottomNavigationBar - final Widget bottomNavigationBar; + final Widget? bottomNavigationBar; /// `AppBar` appBarBottom - final PreferredSizeWidget appBarBottom; + final PreferredSizeWidget? appBarBottom; /// `EndDrawer` endDrawer /// /// 右方向的抽屉 - final Widget endDrawer; + final Widget? endDrawer; /// `AppBar` appBar - final Widget appBar; + final Widget? appBar; ///背景色 final Color backgroundColor; - final Widget floatingActionButton; + final Widget? floatingActionButton; ASScaffold({ - Key key, + Key? key, this.title, this.leading, this.body, @@ -63,7 +63,7 @@ class ASScaffold extends StatelessWidget { return title ?? SizedBox(); } - Widget get _appBar { + Widget? get _appBar { if (title == null && appBar == null && appBarBottom == null) return null; return appBar ?? AppBar( @@ -97,7 +97,7 @@ class ASScaffold extends StatelessWidget { backgroundColor: backgroundColor, bottomNavigationBar: bottomNavigationBar, floatingActionButton: floatingActionButton, - appBar: _appBar, + appBar: _appBar as PreferredSizeWidget?, body: body, ); } diff --git a/lib/styles/as_colors.dart b/lib/styles/as_colors.dart index 0925b76..54f77bd 100644 --- a/lib/styles/as_colors.dart +++ b/lib/styles/as_colors.dart @@ -37,7 +37,7 @@ const Color kLightTextColor = Color(0xD9FFFFFF); const Color kSecondaryColor = Color(0xFFE50112); class ColorTool { - static Color getSplashColor(Color color) { + static Color getSplashColor(Color? color) { if (color == null) return Colors.transparent; int r = color.red; int g = color.green; diff --git a/lib/tag/as_check_tag.dart b/lib/tag/as_check_tag.dart index a5f1520..8cf3ce7 100644 --- a/lib/tag/as_check_tag.dart +++ b/lib/tag/as_check_tag.dart @@ -7,9 +7,9 @@ class ASCheckTag extends StatelessWidget { final bool checked; final Widget text; const ASCheckTag({ - Key key, + Key? key, this.checked = false, - @required this.text, + required this.text, }) : super(key: key); @override diff --git a/lib/tag/as_tag.dart b/lib/tag/as_tag.dart index c018132..d8fce21 100644 --- a/lib/tag/as_tag.dart +++ b/lib/tag/as_tag.dart @@ -5,36 +5,36 @@ import 'package:ansu_ui/extension/num_extension.dart'; class ASTag extends StatelessWidget { ///宽度 - final double width; + final double? width; ///高度 - final double height; + final double? height; ///背景色 - final Color bgColor; + final Color? bgColor; ///标签内容 - final String text; + final String? text; ///标签文字颜色 - final Color textColor; + final Color? textColor; ///标签文字风格 - final TextStyle textStyle; + final TextStyle? textStyle; ///是否有边框 final bool outline; ///边框颜色 - final Color outlineColor; + final Color? outlineColor; ///圆角 - final double radius; + final double? radius; ///内边距 - final EdgeInsetsGeometry padding; + final EdgeInsetsGeometry? padding; ASTag( - {Key key, + {Key? key, this.width, this.height, this.bgColor, @@ -48,7 +48,7 @@ class ASTag extends StatelessWidget { : super(key: key); ASTag.yellowSolid(this.text, - {Key key, + {Key? key, this.width, this.height, this.textStyle, @@ -62,7 +62,7 @@ class ASTag extends StatelessWidget { ASTag.redHollow( this.text, { - Key key, + Key? key, this.width, this.height, this.textStyle, @@ -75,7 +75,7 @@ class ASTag extends StatelessWidget { super(key: key); ASTag.yellowHollow(this.text, - {Key key, + {Key? key, this.width, this.height, this.textStyle, @@ -88,7 +88,7 @@ class ASTag extends StatelessWidget { super(key: key); ASTag.yellowHollowS(this.text, - {Key key, + {Key? key, this.width, this.height, this.textStyle, @@ -99,7 +99,7 @@ class ASTag extends StatelessWidget { outline = true, outlineColor = kDarkPrimaryColor, super(key: key); - ASTag.transport(this.text, {Key key, this.textStyle, this.padding}) + ASTag.transport(this.text, {Key? key, this.textStyle, this.padding}) : bgColor = kForegroundColor, textColor = Color(0xFF00B0FF), outline = true, @@ -131,7 +131,7 @@ class ASTag extends StatelessWidget { ), alignment: Alignment.center, child: Text( - text, + text!, style: textStyle ?? TextStyle( color: textColor, diff --git a/lib/text_field/as_search_text_field.dart b/lib/text_field/as_search_text_field.dart index 10bfb5b..9dff27a 100644 --- a/lib/text_field/as_search_text_field.dart +++ b/lib/text_field/as_search_text_field.dart @@ -5,7 +5,7 @@ import 'package:ansu_ui/styles/as_colors.dart'; ///TextFiled class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { ASSearchTextField({ - Key key, + Key? key, this.controller, this.hintText, this.onChanged, @@ -19,7 +19,7 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { /// ASSearchTextField.button({ - Key key, + Key? key, this.controller, this.hintText, this.onChanged, @@ -35,27 +35,27 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { final bool button; ///控制器 - final TextEditingController controller; + final TextEditingController? controller; ///hint Text - final String hintText; + final String? hintText; ///文字变化回调 - final ValueChanged onChanged; + final ValueChanged? onChanged; ///完成输入回调 - final ValueChanged onSubmitted; + final ValueChanged? onSubmitted; ///焦点 - final FocusNode focusNode; + final FocusNode? focusNode; ///margin - final EdgeInsets margin; + final EdgeInsets? margin; - final VoidCallback onPressed; + final VoidCallback? onPressed; ///高度 - final double height; + final double? height; @override _ASSearchTextFieldState createState() => _ASSearchTextFieldState(); diff --git a/lib/utils/camera_util.dart b/lib/utils/camera_util.dart index 6af7016..09f9d8d 100644 --- a/lib/utils/camera_util.dart +++ b/lib/utils/camera_util.dart @@ -5,7 +5,7 @@ import 'package:image_picker/image_picker.dart'; import 'package:ansu_ui/utils/camera_view.dart'; ///获取相机文件 -Future camFile({double maxHeight = 3000, double maxWidth = 3000}) async { +Future camFile({double maxHeight = 3000, double maxWidth = 3000}) async { var pickedFile = await ImagePicker().getImage( source: ImageSource.camera, maxHeight: maxHeight, @@ -15,13 +15,13 @@ Future camFile({double maxHeight = 3000, double maxWidth = 3000}) async { return File(pickedFile.path); } -Future camView( +Future camView( BuildContext context, { double maxHeight = 3000, double maxWidth = 3000, - @required String title, + required String title, }) async { - File file = await camFile(maxHeight: maxHeight, maxWidth: maxWidth); + File? file = await camFile(maxHeight: maxHeight, maxWidth: maxWidth); if (file == null) return null; return await Navigator.push(context, PageRouteBuilder( pageBuilder: (context, animation, secondAnimation) { diff --git a/lib/utils/camera_view.dart b/lib/utils/camera_view.dart index 2684c58..66c6593 100644 --- a/lib/utils/camera_view.dart +++ b/lib/utils/camera_view.dart @@ -13,16 +13,16 @@ import 'package:ansu_ui/divider/as_divider.dart'; import 'package:velocity_x/velocity_x.dart'; class CameraView extends StatefulWidget { - final File file; - final String title; - CameraView({Key key, this.file, this.title}) : super(key: key); + final File? file; + final String? title; + CameraView({Key? key, this.file, this.title}) : super(key: key); @override _CameraViewState createState() => _CameraViewState(); } class _CameraViewState extends State { - _buildButton({String title, Color color = kTextColor, onPressed}) { + _buildButton({required String title, Color color = kTextColor, onPressed}) { return MaterialButton( child: title.text.bold.size(18).color(color).make(), onPressed: onPressed, @@ -45,10 +45,10 @@ class _CameraViewState extends State { }, child: Hero( child: Image.file( - widget.file, + widget.file!, fit: BoxFit.cover, ), - tag: widget.title, + tag: widget.title!, ), ), ), @@ -63,7 +63,7 @@ class _CameraViewState extends State { _buildButton( title: '重拍', onPressed: () async { - File file = await camFile(); + File? file = await camFile(); if (file == null) Navigator.pop(context); else @@ -86,7 +86,7 @@ class _CameraViewState extends State { title: '确认', onPressed: () => Navigator.pop(context, widget.file), ), - ].sepWidget(separate: ASDivider()), + ].sepWidget(separate: ASDivider())!, ), ), ); diff --git a/lib/utils/city_util.dart b/lib/utils/city_util.dart index 8776e1d..f8d57a8 100644 --- a/lib/utils/city_util.dart +++ b/lib/utils/city_util.dart @@ -10,16 +10,16 @@ class CityUtil { .toList(); } - static List getCityModelByCode(String code) { - Map temp = citiesData[code]; - if (temp?.entries?.isEmpty ?? true) + static List getCityModelByCode(String? code) { + Map? temp = citiesData[code!]; + if (temp?.entries.isEmpty ?? true) return [ CityModel( code: code, name: provincesData[code] ?? citiesData[code] ?? '', ) ]; - return temp.entries + return temp!.entries .map((e) => CityModel( code: e.key, name: e.value['name'], @@ -29,8 +29,8 @@ class CityUtil { } class ProvinceModel { - String code; - String name; + String? code; + String? name; ProvinceModel({ this.code, this.name, @@ -38,8 +38,8 @@ class ProvinceModel { } class CityModel { - String code; - String name; + String? code; + String? name; CityModel({ this.code, this.name, diff --git a/lib/utils/photo_viewer.dart b/lib/utils/photo_viewer.dart index 59c607e..498e705 100644 --- a/lib/utils/photo_viewer.dart +++ b/lib/utils/photo_viewer.dart @@ -4,9 +4,9 @@ import 'package:flutter/material.dart'; import 'package:ansu_ui/extension/num_extension.dart'; class PhotoViewer extends StatefulWidget { - final File file; - final String tag; - PhotoViewer({Key key, this.file, this.tag}) : super(key: key); + final File? file; + final String? tag; + PhotoViewer({Key? key, this.file, this.tag}) : super(key: key); @override _PhotoViewerState createState() => _PhotoViewerState(); @@ -23,8 +23,8 @@ class _PhotoViewerState extends State { child: InteractiveViewer( boundaryMargin: 100.edge, child: Hero( - tag: widget.tag, - child: Image.file(widget.file), + tag: widget.tag!, + child: Image.file(widget.file!), ), ), ), @@ -33,7 +33,7 @@ class _PhotoViewerState extends State { } } -toPhotoViewer(BuildContext context, {String tag, File file}) { +toPhotoViewer(BuildContext context, {String? tag, File? file}) { Navigator.push( context, PageRouteBuilder( diff --git a/pubspec.lock b/pubspec.lock index 800be4b..28695ab 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,77 +14,77 @@ packages: dependency: transitive description: name: animator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.0" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" bot_toast: dependency: "direct main" description: name: bot_toast - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.15.0" expandable: dependency: "direct main" description: name: expandable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" flutter: @@ -105,14 +105,14 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" flutter_test: @@ -129,98 +129,98 @@ packages: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.4" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.1" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.3" lpinyin: dependency: "direct main" description: name: lpinyin - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.10" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" sky_engine: @@ -232,77 +232,77 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" states_rebuilder: dependency: transitive description: name: states_rebuilder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0+1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.19" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" velocity_x: dependency: "direct main" description: name: velocity_x - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.6.1" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 9fda783..c6a9a22 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.4 author: environment: - sdk: ">=2.7.0 <3.0.0" + sdk: '>=2.12.0 <3.0.0' flutter: ">=1.17.0" dependencies: