null_safety
小赖 4 years ago
parent e835e9052e
commit 9ed9003805

@ -70,6 +70,7 @@ class _ExamplePickerState extends State<ExamplePicker> {
title: '图片选择器',
onPressed: () async {
File file = await camView(context, title: '图片选择器');
print(file.lengthSync());
},
),
),

@ -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

@ -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';

@ -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<BottomNavigationBarItem> items;

@ -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) {

@ -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
///

@ -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;

@ -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';
///
///

@ -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 {
///

@ -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<ASButton> {
? 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)

@ -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 {
///

@ -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 {
///

@ -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 {

@ -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<T> extends StatefulWidget {
///

@ -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,
],
),
],

@ -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;

@ -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;

@ -1,4 +1,5 @@
part of ansu_ui;
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
///线
class ASDivider extends StatelessWidget {

@ -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 {

@ -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<Widget> {
List<Widget> sepWidget({Widget separate}) {
@ -9,5 +10,4 @@ extension SeparateExt on List<Widget> {
return separate ?? 10.wb;
});
}
}

@ -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

@ -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 {

@ -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(

@ -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

@ -1,4 +1,4 @@
part of ansu_ui;
import 'package:flutter/material.dart';
extension WidgetExt on Widget {
Widget get expanded => Expanded(child: this);

@ -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;

@ -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 {
///

@ -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,

@ -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;

@ -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 {
///

@ -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);

@ -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 {

@ -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<dynamic> show2DatePicker(BuildContext context,
return await showModalBottomSheet(
context: context,
builder: (context) {
return AS2DatePicker(isAnHour:isAnHour,date:date);
return AS2DatePicker(isAnHour: isAnHour, date: date);
},
);
}

@ -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;

@ -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<CityModel> showCityPicker(BuildContext context,
{String initCode}) async {

@ -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;

@ -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;

@ -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
///

@ -1,4 +1,4 @@
part of ansu_ui;
import 'package:flutter/material.dart';
///
const Color kDarkColor = Color(0xFF333333);

@ -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<ASTag> {
@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(

@ -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 {

@ -1,4 +1,5 @@
part of ansu_ui;
import 'package:bot_toast/bot_toast.dart';
class ASToast {
static show(String text) {

@ -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<File> camFile({double maxHeight = 3000, double maxWidth = 3000}) async {

@ -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;

@ -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;

@ -1,4 +1,4 @@
part of ansu_ui;
import 'package:flutter_screenutil/flutter_screenutil.dart';
double statusBarHeight = ScreenUtil().statusBarHeight;
double screenHeight = ScreenUtil().screenHeight;

@ -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

Loading…
Cancel
Save