From 9ed9003805170fda8ff288078266f8107a3b8d49 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Tue, 22 Dec 2020 09:32:23 +0800 Subject: [PATCH] use export --- example/lib/example_picker.dart | 1 + example/pubspec.yaml | 37 -------- lib/ansu_ui.dart | 98 ++++++++++------------ lib/bar/as_navigation_bar.dart | 4 +- lib/bar/as_navigation_item.dart | 3 +- lib/bar/as_tabbar.dart | 4 +- lib/box/as_check_box.dart | 3 +- lib/buttons/as_back_button.dart | 4 +- lib/buttons/as_bottom_button.dart | 5 +- lib/buttons/as_button.dart | 8 +- lib/buttons/as_gradientbutton.dart | 5 +- lib/buttons/as_longbutton.dart | 5 +- lib/buttons/as_numeric_button.dart | 6 +- lib/buttons/as_radio_button.dart | 5 +- lib/dialog/as_delete_dialog.dart | 20 +++-- lib/dialog/as_dialog.dart | 7 +- lib/dialog/as_dialog_button.dart | 4 +- lib/divider/as_divider.dart | 3 +- lib/drawer/as_drawer.dart | 4 +- lib/extension/list_extension.dart | 4 +- lib/extension/num_extension.dart | 3 +- lib/extension/string_extension.dart | 3 +- lib/extension/text_extension.dart | 3 +- lib/extension/text_style_extension.dart | 5 +- lib/extension/widget_extension.dart | 2 +- lib/list_tile/as_edit_tile.dart | 5 +- lib/list_tile/as_list_tile.dart | 5 +- lib/list_tile/as_option_tile.dart | 35 ++++---- lib/list_tile/as_option_tile_item.dart | 6 +- lib/list_tile/as_vertical_tile_item.dart | 6 +- lib/pickers/as_city_picker.dart | 6 +- lib/pickers/as_date_picker.dart | 5 +- lib/pickers/as_date_range_picker_part.dart | 5 +- lib/pickers/as_picker_box.dart | 6 +- lib/pickers/as_show_city_picker.dart | 4 +- lib/pickers/as_two_date_picker.dart | 12 ++- lib/refresh/as_refresh.dart | 5 +- lib/scaffold/as_scaffold.dart | 6 +- lib/styles/as_colors.dart | 2 +- lib/tag/as_tag.dart | 8 +- lib/text_field/as_search_text_field.dart | 5 +- lib/toast/as_toast.dart | 3 +- lib/utils/camera_util.dart | 6 +- lib/utils/camera_view.dart | 15 +++- lib/utils/photo_viewer.dart | 6 +- lib/utils/screen_adapter.dart | 2 +- pubspec.yaml | 34 -------- 47 files changed, 238 insertions(+), 195 deletions(-) diff --git a/example/lib/example_picker.dart b/example/lib/example_picker.dart index fd2aa94..1c57678 100644 --- a/example/lib/example_picker.dart +++ b/example/lib/example_picker.dart @@ -70,6 +70,7 @@ class _ExamplePickerState extends State { title: '图片选择器', onPressed: () async { File file = await camView(context, title: '图片选择器'); + print(file.lengthSync()); }, ), ), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 85ffc69..9b18d46 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -35,44 +35,7 @@ dependencies: dev_dependencies: flutter_test: - sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg assets: - assets/logo.webp - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/lib/ansu_ui.dart b/lib/ansu_ui.dart index 4bbf264..7f97d90 100644 --- a/lib/ansu_ui.dart +++ b/lib/ansu_ui.dart @@ -1,76 +1,64 @@ library ansu_ui; -import 'dart:io'; -import 'dart:ui'; - -import 'package:ansu_ui/bar/as_tab_indicator.dart'; -import 'package:ansu_ui/painters/as_numeric_painter.dart'; -import 'package:ansu_ui/utils/city_util.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:image_picker/image_picker.dart'; -import 'package:bot_toast/bot_toast.dart'; export 'package:flutter_screenutil/flutter_screenutil.dart'; export 'package:flutter_easyrefresh/easy_refresh.dart'; export 'package:bot_toast/bot_toast.dart'; //buttons -part 'buttons/as_button.dart'; -part 'buttons/as_longbutton.dart'; -part 'buttons/as_back_button.dart'; -part 'buttons/as_numeric_button.dart'; -part 'buttons/as_bottom_button.dart'; -part 'buttons/as_gradientbutton.dart'; -part 'buttons/as_radio_button.dart'; +export 'buttons/as_button.dart'; +export 'buttons/as_longbutton.dart'; +export 'buttons/as_back_button.dart'; +export 'buttons/as_numeric_button.dart'; +export 'buttons/as_bottom_button.dart'; +export 'buttons/as_gradientbutton.dart'; +export 'buttons/as_radio_button.dart'; //scaffold -part 'scaffold/as_scaffold.dart'; +export 'scaffold/as_scaffold.dart'; -part 'styles/as_colors.dart'; +export 'styles/as_colors.dart'; -part 'bar/as_tabbar.dart'; -part 'bar/as_navigation_bar.dart'; -part 'bar/as_navigation_item.dart'; +export 'bar/as_tabbar.dart'; +export 'bar/as_navigation_bar.dart'; +export 'bar/as_navigation_item.dart'; -part 'drawer/as_drawer.dart'; +export 'drawer/as_drawer.dart'; -part 'toast/as_toast.dart'; +export 'toast/as_toast.dart'; -part 'pickers/as_date_picker.dart'; -part 'pickers/as_picker_box.dart'; -part 'pickers/as_city_picker.dart'; -part 'pickers/as_show_city_picker.dart'; -part 'pickers/as_two_date_picker.dart'; -part 'pickers/as_date_range_picker_part.dart'; +export 'pickers/as_date_picker.dart'; +export 'pickers/as_picker_box.dart'; +export 'pickers/as_city_picker.dart'; +export 'pickers/as_show_city_picker.dart'; +export 'pickers/as_two_date_picker.dart'; +export 'pickers/as_date_range_picker_part.dart'; -part 'dialog/as_dialog.dart'; -part 'dialog/as_dialog_button.dart'; -part 'dialog/as_delete_dialog.dart'; +export 'dialog/as_dialog.dart'; +export 'dialog/as_dialog_button.dart'; +export 'dialog/as_delete_dialog.dart'; -part 'list_tile/as_list_tile.dart'; -part 'list_tile/as_option_tile.dart'; -part 'list_tile/as_edit_tile.dart'; -part 'list_tile/as_option_tile_item.dart'; -part 'list_tile/as_vertical_tile_item.dart'; +export 'list_tile/as_list_tile.dart'; +export 'list_tile/as_option_tile.dart'; +export 'list_tile/as_edit_tile.dart'; +export 'list_tile/as_option_tile_item.dart'; +export 'list_tile/as_vertical_tile_item.dart'; -part 'refresh/as_refresh.dart'; +export 'refresh/as_refresh.dart'; -part 'box/as_check_box.dart'; +export 'box/as_check_box.dart'; -part 'tag/as_tag.dart'; -part 'divider/as_divider.dart'; -part 'text_field/as_search_text_field.dart'; +export 'tag/as_tag.dart'; +export 'divider/as_divider.dart'; +export 'text_field/as_search_text_field.dart'; -part 'utils/screen_adapter.dart'; -part 'utils/camera_util.dart'; -part 'utils/camera_view.dart'; -part 'utils/photo_viewer.dart'; +export 'utils/screen_adapter.dart'; +export 'utils/camera_util.dart'; +export 'utils/camera_view.dart'; +export 'utils/photo_viewer.dart'; -part 'extension/num_extension.dart'; -part 'extension/list_extension.dart'; -part 'extension/widget_extension.dart'; -part 'extension/string_extension.dart'; -part 'extension/text_style_extension.dart'; -part 'extension/text_extension.dart'; +export 'extension/num_extension.dart'; +export 'extension/list_extension.dart'; +export 'extension/widget_extension.dart'; +export 'extension/string_extension.dart'; +export 'extension/text_style_extension.dart'; +export 'extension/text_extension.dart'; diff --git a/lib/bar/as_navigation_bar.dart b/lib/bar/as_navigation_bar.dart index a611656..33349d7 100644 --- a/lib/bar/as_navigation_bar.dart +++ b/lib/bar/as_navigation_bar.dart @@ -1,4 +1,6 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; class ASNavigationBar extends StatefulWidget { final List items; diff --git a/lib/bar/as_navigation_item.dart b/lib/bar/as_navigation_item.dart index a025666..c6df77d 100644 --- a/lib/bar/as_navigation_item.dart +++ b/lib/bar/as_navigation_item.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; BottomNavigationBarItem asNavigationItem( String path1, String path2, String title) { diff --git a/lib/bar/as_tabbar.dart b/lib/bar/as_tabbar.dart index de801c9..fcf37aa 100644 --- a/lib/bar/as_tabbar.dart +++ b/lib/bar/as_tabbar.dart @@ -1,4 +1,6 @@ -part of ansu_ui; +import 'package:ansu_ui/bar/as_tab_indicator.dart'; +import 'package:flutter/material.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; /// ## 安速Tabbar /// diff --git a/lib/box/as_check_box.dart b/lib/box/as_check_box.dart index 250be23..00e8f67 100644 --- a/lib/box/as_check_box.dart +++ b/lib/box/as_check_box.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class ASCheckBox extends StatefulWidget { final bool value; diff --git a/lib/buttons/as_back_button.dart b/lib/buttons/as_back_button.dart index 130ecd3..bee91ef 100644 --- a/lib/buttons/as_back_button.dart +++ b/lib/buttons/as_back_button.dart @@ -1,4 +1,6 @@ -part of ansu_ui; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; ///安速返回按钮 /// diff --git a/lib/buttons/as_bottom_button.dart b/lib/buttons/as_bottom_button.dart index ed27af6..7bc7b7a 100644 --- a/lib/buttons/as_bottom_button.dart +++ b/lib/buttons/as_bottom_button.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + class ASBottomButton extends StatefulWidget { ///动态组件,可以是字符或组件 diff --git a/lib/buttons/as_button.dart b/lib/buttons/as_button.dart index 9390b47..e0186e0 100644 --- a/lib/buttons/as_button.dart +++ b/lib/buttons/as_button.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + ///安速按钮 class ASButton extends StatefulWidget { ///按钮颜色 @@ -158,7 +161,8 @@ class _ASButtonState extends State { ? Text(widget.title, style: widget.textStyle ?? TextStyle(fontSize: 13.sp)) : widget.title, - padding: widget.padding ?? EdgeInsets.symmetric(vertical: 6.w,horizontal: 12.w), + padding: widget.padding ?? + EdgeInsets.symmetric(vertical: 6.w, horizontal: 12.w), shape: RoundedRectangleBorder( side: widget.outline ? BorderSide(color: widget.outlineColor, width: 0.5.w) diff --git a/lib/buttons/as_gradientbutton.dart b/lib/buttons/as_gradientbutton.dart index fff9e35..5e28cc7 100644 --- a/lib/buttons/as_gradientbutton.dart +++ b/lib/buttons/as_gradientbutton.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + class ASGradientButton extends StatefulWidget { ///按钮文字 diff --git a/lib/buttons/as_longbutton.dart b/lib/buttons/as_longbutton.dart index cd4c8ab..bad43c8 100644 --- a/lib/buttons/as_longbutton.dart +++ b/lib/buttons/as_longbutton.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + class ASLongButton extends StatefulWidget { ///按钮文字 diff --git a/lib/buttons/as_numeric_button.dart b/lib/buttons/as_numeric_button.dart index 563abee..bd49235 100644 --- a/lib/buttons/as_numeric_button.dart +++ b/lib/buttons/as_numeric_button.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'package:ansu_ui/painters/as_numeric_painter.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + ///## 数量选择组件 class ASNumericButton extends StatefulWidget { diff --git a/lib/buttons/as_radio_button.dart b/lib/buttons/as_radio_button.dart index f9968fb..f7536ee 100644 --- a/lib/buttons/as_radio_button.dart +++ b/lib/buttons/as_radio_button.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +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'; class ASRadioButton extends StatefulWidget { /// 选中的值 diff --git a/lib/dialog/as_delete_dialog.dart b/lib/dialog/as_delete_dialog.dart index ca2139f..62b3e26 100644 --- a/lib/dialog/as_delete_dialog.dart +++ b/lib/dialog/as_delete_dialog.dart @@ -1,4 +1,9 @@ -part of ansu_ui; +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/dialog/as_dialog_button.dart'; class ASDeleteDialog extends StatelessWidget { ///标题 @@ -47,7 +52,7 @@ class ASDeleteDialog extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Container( - margin:EdgeInsets.fromLTRB(24.w, 45.w, 24.w, 20.w) , + margin: EdgeInsets.fromLTRB(24.w, 45.w, 24.w, 20.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -73,15 +78,14 @@ class ASDeleteDialog extends StatelessWidget { ) : this.boyd, ], - ), ), this.button ?? - ASDialogButton.outline( - title: '确认删除', - onPressed: this.onpressed, - ), - 20.hb + ASDialogButton.outline( + title: '确认删除', + onPressed: this.onpressed, + ), + 20.hb, ], ), ], diff --git a/lib/dialog/as_dialog.dart b/lib/dialog/as_dialog.dart index badff4c..de58419 100644 --- a/lib/dialog/as_dialog.dart +++ b/lib/dialog/as_dialog.dart @@ -1,4 +1,9 @@ -part of ansu_ui; +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'; + class ASDialog extends StatefulWidget { final bool close; diff --git a/lib/dialog/as_dialog_button.dart b/lib/dialog/as_dialog_button.dart index a685cfa..747710d 100644 --- a/lib/dialog/as_dialog_button.dart +++ b/lib/dialog/as_dialog_button.dart @@ -1,4 +1,6 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/buttons/as_longbutton.dart'; class ASDialogButton extends StatelessWidget { final String title; diff --git a/lib/divider/as_divider.dart b/lib/divider/as_divider.dart index b9f19ee..c906d21 100644 --- a/lib/divider/as_divider.dart +++ b/lib/divider/as_divider.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; ///安速水平分割线 class ASDivider extends StatelessWidget { diff --git a/lib/drawer/as_drawer.dart b/lib/drawer/as_drawer.dart index c6e9fd9..72784fa 100644 --- a/lib/drawer/as_drawer.dart +++ b/lib/drawer/as_drawer.dart @@ -1,4 +1,6 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/utils/screen_adapter.dart'; ///安速抽屉 class ASDrawer extends StatefulWidget { diff --git a/lib/extension/list_extension.dart b/lib/extension/list_extension.dart index c791e44..4756bf3 100644 --- a/lib/extension/list_extension.dart +++ b/lib/extension/list_extension.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; extension SeparateExt on List { List sepWidget({Widget separate}) { @@ -9,5 +10,4 @@ extension SeparateExt on List { return separate ?? 10.wb; }); } - } diff --git a/lib/extension/num_extension.dart b/lib/extension/num_extension.dart index c2a14b7..5e0533b 100644 --- a/lib/extension/num_extension.dart +++ b/lib/extension/num_extension.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; extension NumExt on num { ///获取宽 SizedBox diff --git a/lib/extension/string_extension.dart b/lib/extension/string_extension.dart index 83407c0..bc8b325 100644 --- a/lib/extension/string_extension.dart +++ b/lib/extension/string_extension.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:ansu_ui/toast/as_toast.dart'; extension PhoneExt on String { List get _parsePhone { diff --git a/lib/extension/text_extension.dart b/lib/extension/text_extension.dart index 154d683..e5108e1 100644 --- a/lib/extension/text_extension.dart +++ b/lib/extension/text_extension.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:ansu_ui/extension/text_style_extension.dart'; extension TextExtension on Text { Text get bold => Text( diff --git a/lib/extension/text_style_extension.dart b/lib/extension/text_style_extension.dart index 985b57d..50d9b6d 100644 --- a/lib/extension/text_style_extension.dart +++ b/lib/extension/text_style_extension.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + extension TextStyleExtension on TextStyle { ///Bold text diff --git a/lib/extension/widget_extension.dart b/lib/extension/widget_extension.dart index d398cc6..9b98b91 100644 --- a/lib/extension/widget_extension.dart +++ b/lib/extension/widget_extension.dart @@ -1,4 +1,4 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; extension WidgetExt on Widget { Widget get expanded => Expanded(child: this); diff --git a/lib/list_tile/as_edit_tile.dart b/lib/list_tile/as_edit_tile.dart index 13a1178..fbc21e9 100644 --- a/lib/list_tile/as_edit_tile.dart +++ b/lib/list_tile/as_edit_tile.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +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'; class ASEditTile extends StatefulWidget { final Widget title; diff --git a/lib/list_tile/as_list_tile.dart b/lib/list_tile/as_list_tile.dart index af8c5c2..c75a4fe 100644 --- a/lib/list_tile/as_list_tile.dart +++ b/lib/list_tile/as_list_tile.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + class ASListTile extends StatefulWidget { ///主标题 diff --git a/lib/list_tile/as_option_tile.dart b/lib/list_tile/as_option_tile.dart index 67b3fc8..a192cc6 100644 --- a/lib/list_tile/as_option_tile.dart +++ b/lib/list_tile/as_option_tile.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; +import 'package:ansu_ui/divider/as_divider.dart'; ///菜单按钮Tile class ASOptionTile extends StatelessWidget { @@ -29,21 +32,21 @@ class ASOptionTile extends StatelessWidget { Widget build(BuildContext context) { if (this.leading != null) { this.items.insert( - 0, - Container( - padding: EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 10.w), - alignment: Alignment.centerLeft, - child: this.leading is String - ? Text( - this.leading, - style: TextStyle( - color: kTextColor, - fontSize: 16.sp, - fontWeight: FontWeight.bold), - ) - : this.leading, - ), - ); + 0, + Container( + padding: EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 10.w), + alignment: Alignment.centerLeft, + child: this.leading is String + ? Text( + this.leading, + style: TextStyle( + color: kTextColor, + fontSize: 16.sp, + fontWeight: FontWeight.bold), + ) + : this.leading, + ), + ); } return Material( color: kForegroundColor, diff --git a/lib/list_tile/as_option_tile_item.dart b/lib/list_tile/as_option_tile_item.dart index b50a347..5c55dca 100644 --- a/lib/list_tile/as_option_tile_item.dart +++ b/lib/list_tile/as_option_tile_item.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; + class ASOptionTileItem extends StatelessWidget { final Widget leading; diff --git a/lib/list_tile/as_vertical_tile_item.dart b/lib/list_tile/as_vertical_tile_item.dart index 1bc8a12..ab7173d 100644 --- a/lib/list_tile/as_vertical_tile_item.dart +++ b/lib/list_tile/as_vertical_tile_item.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; +import 'package:ansu_ui/divider/as_divider.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; class ASVerticalTileItem extends StatelessWidget { ///标题 diff --git a/lib/pickers/as_city_picker.dart b/lib/pickers/as_city_picker.dart index c047662..721dd27 100644 --- a/lib/pickers/as_city_picker.dart +++ b/lib/pickers/as_city_picker.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'package:ansu_ui/utils/city_util.dart'; +import 'package:ansu_ui/pickers/as_picker_box.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class ASCityPicker extends StatefulWidget { ASCityPicker({Key key}) : super(key: key); diff --git a/lib/pickers/as_date_picker.dart b/lib/pickers/as_date_picker.dart index a15a2fa..bb50b03 100644 --- a/lib/pickers/as_date_picker.dart +++ b/lib/pickers/as_date_picker.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:ansu_ui/pickers/as_picker_box.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; //时间选择器内部实现 class _ASDatePickerWidget extends StatefulWidget { diff --git a/lib/pickers/as_date_range_picker_part.dart b/lib/pickers/as_date_range_picker_part.dart index 678a3e3..306058b 100644 --- a/lib/pickers/as_date_range_picker_part.dart +++ b/lib/pickers/as_date_range_picker_part.dart @@ -1,4 +1,5 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:ansu_ui/pickers/as_two_date_picker.dart'; class RangeDate { DateTime start; @@ -17,7 +18,7 @@ Future show2DatePicker(BuildContext context, return await showModalBottomSheet( context: context, builder: (context) { - return AS2DatePicker(isAnHour:isAnHour,date:date); + return AS2DatePicker(isAnHour: isAnHour, date: date); }, ); } diff --git a/lib/pickers/as_picker_box.dart b/lib/pickers/as_picker_box.dart index 163587e..17d21e3 100644 --- a/lib/pickers/as_picker_box.dart +++ b/lib/pickers/as_picker_box.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; +import 'package:ansu_ui/divider/as_divider.dart'; + class ASPickerBox extends StatelessWidget { final VoidCallback onPressed; diff --git a/lib/pickers/as_show_city_picker.dart b/lib/pickers/as_show_city_picker.dart index f6f0dce..f8a8445 100644 --- a/lib/pickers/as_show_city_picker.dart +++ b/lib/pickers/as_show_city_picker.dart @@ -1,4 +1,6 @@ -part of ansu_ui; +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 { diff --git a/lib/pickers/as_two_date_picker.dart b/lib/pickers/as_two_date_picker.dart index a70a7ea..75feaff 100644 --- a/lib/pickers/as_two_date_picker.dart +++ b/lib/pickers/as_two_date_picker.dart @@ -1,4 +1,14 @@ -part of ansu_ui; +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/string_extension.dart'; +import 'package:ansu_ui/extension/widget_extension.dart'; +import 'package:ansu_ui/extension/text_extension.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; +import 'package:ansu_ui/extension/text_style_extension.dart'; +import 'package:ansu_ui/pickers/as_date_range_picker_part.dart'; +import 'package:ansu_ui/buttons/as_longbutton.dart'; + class AS2DatePicker extends StatefulWidget { final bool isAnHour; diff --git a/lib/refresh/as_refresh.dart b/lib/refresh/as_refresh.dart index d1d82e9..d6eb3a5 100644 --- a/lib/refresh/as_refresh.dart +++ b/lib/refresh/as_refresh.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + class ASRefresh extends StatefulWidget { final Widget child; diff --git a/lib/scaffold/as_scaffold.dart b/lib/scaffold/as_scaffold.dart index 68e2c6e..855afd6 100644 --- a/lib/scaffold/as_scaffold.dart +++ b/lib/scaffold/as_scaffold.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; +import 'package:ansu_ui/buttons/as_back_button.dart'; + ///ASScaffold /// diff --git a/lib/styles/as_colors.dart b/lib/styles/as_colors.dart index aa0a845..0925b76 100644 --- a/lib/styles/as_colors.dart +++ b/lib/styles/as_colors.dart @@ -1,4 +1,4 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; ///主要暗色 const Color kDarkColor = Color(0xFF333333); diff --git a/lib/tag/as_tag.dart b/lib/tag/as_tag.dart index 9b350df..cca2911 100644 --- a/lib/tag/as_tag.dart +++ b/lib/tag/as_tag.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + class ASTag extends StatefulWidget { ///宽度 @@ -113,7 +116,8 @@ class _ASTagState extends State { @override Widget build(BuildContext context) { return Container( - padding: widget.padding ?? EdgeInsets.symmetric(horizontal: 6.w,vertical: 2.w), + padding: widget.padding ?? + EdgeInsets.symmetric(horizontal: 6.w, vertical: 2.w), width: widget.width, height: widget.height, decoration: BoxDecoration( diff --git a/lib/text_field/as_search_text_field.dart b/lib/text_field/as_search_text_field.dart index ac65942..2e04ae0 100644 --- a/lib/text_field/as_search_text_field.dart +++ b/lib/text_field/as_search_text_field.dart @@ -1,4 +1,7 @@ -part of ansu_ui; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; + ///TextFiled class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { diff --git a/lib/toast/as_toast.dart b/lib/toast/as_toast.dart index 8915c50..8f9a9d1 100644 --- a/lib/toast/as_toast.dart +++ b/lib/toast/as_toast.dart @@ -1,4 +1,5 @@ -part of ansu_ui; + +import 'package:bot_toast/bot_toast.dart'; class ASToast { static show(String text) { diff --git a/lib/utils/camera_util.dart b/lib/utils/camera_util.dart index 6f82f97..5ea3fe3 100644 --- a/lib/utils/camera_util.dart +++ b/lib/utils/camera_util.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:ansu_ui/utils/camera_view.dart'; ///获取相机文件 Future camFile({double maxHeight = 3000, double maxWidth = 3000}) async { diff --git a/lib/utils/camera_view.dart b/lib/utils/camera_view.dart index 124ea64..953cb30 100644 --- a/lib/utils/camera_view.dart +++ b/lib/utils/camera_view.dart @@ -1,4 +1,17 @@ -part of ansu_ui; +import 'dart:io'; +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/styles/as_colors.dart'; +import 'package:ansu_ui/scaffold/as_scaffold.dart'; +import 'package:ansu_ui/extension/string_extension.dart'; +import 'package:ansu_ui/extension/text_extension.dart'; +import 'package:ansu_ui/utils/photo_viewer.dart'; +import 'package:ansu_ui/utils/camera_util.dart'; +import 'package:ansu_ui/extension/list_extension.dart'; +import 'package:ansu_ui/divider/as_divider.dart'; + class CameraView extends StatefulWidget { final File file; diff --git a/lib/utils/photo_viewer.dart b/lib/utils/photo_viewer.dart index 9e1de31..475bd3c 100644 --- a/lib/utils/photo_viewer.dart +++ b/lib/utils/photo_viewer.dart @@ -1,4 +1,8 @@ -part of ansu_ui; +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; + class PhotoViewer extends StatefulWidget { final File file; diff --git a/lib/utils/screen_adapter.dart b/lib/utils/screen_adapter.dart index 32f1fe2..6b1531f 100644 --- a/lib/utils/screen_adapter.dart +++ b/lib/utils/screen_adapter.dart @@ -1,4 +1,4 @@ -part of ansu_ui; +import 'package:flutter_screenutil/flutter_screenutil.dart'; double statusBarHeight = ScreenUtil().statusBarHeight; double screenHeight = ScreenUtil().screenHeight; diff --git a/pubspec.yaml b/pubspec.yaml index ecd77c9..a1a46e7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,38 +19,4 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. flutter: - # To add assets to your package, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # - # For details regarding assets in packages, see - # https://flutter.dev/assets-and-images/#from-packages - # - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware. - # To add custom fonts to your package, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts in packages, see - # https://flutter.dev/custom-fonts/#from-packages