Compare commits

..

No commits in common. 'master' and 'null_safety' have entirely different histories.

@ -1,4 +1,3 @@
{ {
"flutterSdkVersion": "2.8.1", "flutterSdkVersion": "stable"
"flavors": {}
} }

@ -1,3 +1,3 @@
{ {
"dart.flutterSdkPath": "/Users/zhangmeng/fvm/versions/2.0.2" "dart.flutterSdkPath": "/Users/akufe/fvm/versions/stable"
} }

@ -1,4 +0,0 @@
{
"flutterSdkVersion": "2.2.0",
"flavors": {}
}

@ -14,20 +14,20 @@ class CodeStyle extends InheritedWidget {
this.punctuationStyle, this.punctuationStyle,
this.classStyle, this.classStyle,
this.constantStyle, this.constantStyle,
required Widget child, @required Widget child,
}) : super(child: child); }) : super(child: child);
final TextStyle? baseStyle; final TextStyle baseStyle;
final TextStyle? numberStyle; final TextStyle numberStyle;
final TextStyle? commentStyle; final TextStyle commentStyle;
final TextStyle? keywordStyle; final TextStyle keywordStyle;
final TextStyle? stringStyle; final TextStyle stringStyle;
final TextStyle? punctuationStyle; final TextStyle punctuationStyle;
final TextStyle? classStyle; final TextStyle classStyle;
final TextStyle? constantStyle; final TextStyle constantStyle;
static CodeStyle of(BuildContext context) { static CodeStyle of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<CodeStyle>()!; return context.dependOnInheritedWidgetOfExactType<CodeStyle>();
} }
@override @override
@ -40,4 +40,4 @@ class CodeStyle extends InheritedWidget {
oldWidget.punctuationStyle != punctuationStyle || oldWidget.punctuationStyle != punctuationStyle ||
oldWidget.classStyle != classStyle || oldWidget.classStyle != classStyle ||
oldWidget.constantStyle != constantStyle; oldWidget.constantStyle != constantStyle;
} }

@ -6,12 +6,12 @@ import 'code_view.dart';
class BasePage extends StatelessWidget { class BasePage extends StatelessWidget {
final String title; final String title;
final Widget body; final Widget body;
final List<Widget>? actions; final List<Widget> actions;
final CodeBuilder? codeBuilder; final CodeBuilder codeBuilder;
const BasePage( const BasePage(
{Key? key, {Key key,
required this.title, @required this.title,
required this.body, @required this.body,
this.actions, this.actions,
this.codeBuilder}) this.codeBuilder})
: super(key: key); : super(key: key);

@ -4,10 +4,10 @@ import 'package:get/get.dart';
import 'code_view.dart'; import 'code_view.dart';
class CodeTile extends StatelessWidget { class CodeTile extends StatelessWidget {
final Widget? title; final Widget title;
final Widget? subTitle; final Widget subTitle;
final CodeBuilder? builder; final CodeBuilder builder;
const CodeTile({Key? key, this.title, this.subTitle, this.builder}) const CodeTile({Key key, this.title, this.subTitle, this.builder})
: super(key: key); : super(key: key);
@override @override

@ -5,9 +5,9 @@ import '../codeviewer/code_style.dart';
typedef CodeBuilder = TextSpan Function(BuildContext context); typedef CodeBuilder = TextSpan Function(BuildContext context);
class CodeView extends StatefulWidget { class CodeView extends StatefulWidget {
final CodeBuilder? text; final CodeBuilder text;
final String title; final String title;
CodeView({Key? key, required this.text, this.title = 'Code'}) CodeView({Key key, @required this.text, this.title = 'Code'})
: super(key: key); : super(key: key);
@override @override
@ -33,7 +33,7 @@ class _CodeViewState extends State<CodeView> {
classStyle: codeTheme.copyWith(color: Colors.yellow), classStyle: codeTheme.copyWith(color: Colors.yellow),
constantStyle: codeTheme.copyWith(color: Colors.pink), constantStyle: codeTheme.copyWith(color: Colors.pink),
child: child:
Builder(builder: (context) => Text.rich(widget.text!(context))), Builder(builder: (context) => Text.rich(widget.text(context))),
)), )),
); );
} }

@ -5,13 +5,13 @@ import 'package:get/get.dart';
class ExampleScaffold extends StatelessWidget { class ExampleScaffold extends StatelessWidget {
final String title; final String title;
final CodeBuilder? text; final CodeBuilder text;
final List<Widget> children; final List<Widget> children;
const ExampleScaffold({ const ExampleScaffold({
Key? key, Key key,
required this.title, @required this.title,
this.text, this.text,
required this.children, @required this.children,
}) : super(key: key); }) : super(key: key);
@override @override

@ -2,9 +2,9 @@ import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ColorObject { class ColorObject {
Color? color; Color color;
String? name; String name;
String? codeName; String codeName;
ColorObject({ ColorObject({
this.color, this.color,
this.name, this.name,

@ -1,61 +0,0 @@
import 'package:ansu_ui/extension/list_extension.dart';
import 'package:example/codeviewer/code_segments.dart';
import 'package:example/component/example_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class ExampleListExt extends StatefulWidget {
const ExampleListExt({Key? key}) : super(key: key);
@override
_ExampleListExtState createState() => _ExampleListExtState();
}
class _ExampleListExtState extends State<ExampleListExt> {
@override
Widget build(BuildContext context) {
return ExampleScaffold(
title: 'String Ext',
text: (context) => CodeSegments.stringExt(context),
children: [
Container(
color: Colors.blue,
child: Column(
children: [
Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: Text('1'),
),
Visibility(
visible: true,
child: Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: Text('2'),
),
),
Offstage(
offstage: true,
child: Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: Text('2'),
),
),
Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: Text('3'),
),
].sepWidget(separate: 10.w.heightBox),
),
),
]);
}
}

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExampleNumExt extends StatefulWidget { class ExampleNumExt extends StatefulWidget {
ExampleNumExt({Key? key}) : super(key: key); ExampleNumExt({Key key}) : super(key: key);
@override @override
_ExampleNumExtState createState() => _ExampleNumExtState(); _ExampleNumExtState createState() => _ExampleNumExtState();
@ -103,17 +103,6 @@ class _ExampleNumExtState extends State<ExampleNumExt> {
child: Container(color: Colors.green), child: Container(color: Colors.green),
), ),
), ),
ListTile(title: Text('add0')),
ListTile(
leading: Chip(label: Text('.add0')),
title: Text('1'),
subtitle: Text(1.add0(3)),
),
ListTile(
leading: Chip(label: Text('.add0')),
title: Text('1000'),
subtitle: Text(1000.add0(3)),
),
// END // END
], ],
); );

@ -4,7 +4,7 @@ import 'package:example/component/example_scaffold.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExampleStringExt extends StatefulWidget { class ExampleStringExt extends StatefulWidget {
ExampleStringExt({Key? key}) : super(key: key); ExampleStringExt({Key key}) : super(key: key);
@override @override
_ExampleStringExtState createState() => _ExampleStringExtState(); _ExampleStringExtState createState() => _ExampleStringExtState();

@ -37,14 +37,14 @@ class MyApp extends StatelessWidget {
} }
class MyHomePage extends StatefulWidget { class MyHomePage extends StatefulWidget {
MyHomePage({Key? key}) : super(key: key); MyHomePage({Key key}) : super(key: key);
@override @override
_MyHomePageState createState() => _MyHomePageState(); _MyHomePageState createState() => _MyHomePageState();
} }
class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin { class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
TabController? _tabController; TabController _tabController;
@override @override
void initState() { void initState() {
@ -56,9 +56,9 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
print(Theme.of(context).textTheme.headline1!.fontFamily); print(Theme.of(context).textTheme.headline1.fontFamily);
return ASScaffold( return ASScaffold(
leading: navigator!.canPop() leading: navigator.canPop()
? IconButton( ? IconButton(
icon: Icon(Icons.backpack, color: Colors.black), icon: Icon(Icons.backpack, color: Colors.black),
onPressed: () {}, onPressed: () {},
@ -74,7 +74,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
], ],
), ),
bottomNavigationBar: ASNavigationBar( bottomNavigationBar: ASNavigationBar(
controller: _tabController!, controller: _tabController,
items: [ items: [
BottomNavigationBarItem( BottomNavigationBarItem(
icon: Icon(Icons.home), icon: Icon(Icons.home),

@ -1,12 +1,11 @@
import 'package:example/extension/example_list_ext.dart';
import 'package:example/extension/example_num_ext.dart'; import 'package:example/extension/example_num_ext.dart';
import 'package:example/extension/example_string_ext.dart'; import 'package:example/extension/example_string_ext.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class MainExtention extends StatefulWidget { class MainExtention extends StatefulWidget {
MainExtention({Key? key}) : super(key: key); MainExtention({Key key}) : super(key: key);
@override @override
_MainExtentionState createState() => _MainExtentionState(); _MainExtentionState createState() => _MainExtentionState();
@ -14,9 +13,9 @@ class MainExtention extends StatefulWidget {
class _MainExtentionState extends State<MainExtention> { class _MainExtentionState extends State<MainExtention> {
_innerButton({ _innerButton({
VoidCallback? onPressed, VoidCallback onPressed,
required Widget child, Widget child,
Widget? icon, Widget icon,
}) { }) {
return TextButton( return TextButton(
onPressed: onPressed, onPressed: onPressed,
@ -45,11 +44,6 @@ class _MainExtentionState extends State<MainExtention> {
child: Text('String Ext'), child: Text('String Ext'),
icon: Icon(Icons.text_fields), icon: Icon(Icons.text_fields),
), ),
_innerButton(
onPressed: () => Get.to(ExampleListExt()),
child: Text('list Ext'),
icon: Icon(Icons.text_fields),
),
], ],
); );
} }

@ -1,9 +1,7 @@
import 'package:example/widgets/example_bottom_button.dart'; import 'package:example/widgets/example_bottom_button.dart';
import 'package:example/widgets/example_box.dart'; import 'package:example/widgets/example_box.dart';
import 'package:example/widgets/example_button.dart'; import 'package:example/widgets/example_button.dart';
import 'package:example/widgets/example_chart.dart';
import 'package:example/widgets/example_dialog.dart'; import 'package:example/widgets/example_dialog.dart';
import 'package:example/widgets/example_divider.dart';
import 'package:example/widgets/example_drawer.dart'; import 'package:example/widgets/example_drawer.dart';
import 'package:example/widgets/example_listtile.dart'; import 'package:example/widgets/example_listtile.dart';
import 'package:example/widgets/example_numeric_button.dart'; import 'package:example/widgets/example_numeric_button.dart';
@ -17,11 +15,12 @@ import 'package:example/widgets/example_tag.dart';
import 'package:example/widgets/example_text_field.dart'; import 'package:example/widgets/example_text_field.dart';
import 'package:example/widgets/example_toast.dart'; import 'package:example/widgets/example_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class MainHome extends StatefulWidget { class MainHome extends StatefulWidget {
MainHome({Key? key}) : super(key: key); MainHome({Key key}) : super(key: key);
@override @override
_MainHomeState createState() => _MainHomeState(); _MainHomeState createState() => _MainHomeState();
@ -29,15 +28,15 @@ class MainHome extends StatefulWidget {
class _MainHomeState extends State<MainHome> { class _MainHomeState extends State<MainHome> {
_innerButton({ _innerButton({
VoidCallback? onPressed, VoidCallback onPressed,
required String title, String title,
IconData? icon, IconData icon,
}) { }) {
return TextButton( return TextButton(
onPressed: onPressed, onPressed: onPressed,
child: Row( child: Row(
children: [ children: [
Expanded(child: icon != null ? Icon(icon) : SizedBox()), Expanded(child: Icon(icon) ?? SizedBox()),
Text(title), Text(title),
Spacer(), Spacer(),
], ],
@ -110,14 +109,6 @@ class _MainHomeState extends State<MainHome> {
title: 'Toast', title: 'Toast',
onPressed: () => Get.to(ExampleToast()), onPressed: () => Get.to(ExampleToast()),
), ),
_innerButton(
title: 'Divider',
onPressed: () => Get.to(ExampleDivider()),
),
_innerButton(
title: 'chart',
onPressed: () => Get.to(ExampleChart()),
),
], ],
); );
} }

@ -4,7 +4,7 @@ import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class MainUtils extends StatefulWidget { class MainUtils extends StatefulWidget {
MainUtils({Key? key}) : super(key: key); MainUtils({Key key}) : super(key: key);
@override @override
_MainUtilsState createState() => _MainUtilsState(); _MainUtilsState createState() => _MainUtilsState();
@ -12,9 +12,9 @@ class MainUtils extends StatefulWidget {
class _MainUtilsState extends State<MainUtils> { class _MainUtilsState extends State<MainUtils> {
_innerButton({ _innerButton({
VoidCallback? onPressed, VoidCallback onPressed,
required Widget child, Widget child,
Widget? icon, Widget icon,
}) { }) {
return TextButton( return TextButton(
onPressed: onPressed, onPressed: onPressed,

@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class ExampleCameraView extends StatefulWidget { class ExampleCameraView extends StatefulWidget {
ExampleCameraView({Key? key}) : super(key: key); ExampleCameraView({Key key}) : super(key: key);
@override @override
_ExampleCameraViewState createState() => _ExampleCameraViewState(); _ExampleCameraViewState createState() => _ExampleCameraViewState();
@ -24,8 +24,8 @@ class _ExampleCameraViewState extends State<ExampleCameraView> {
ListTile( ListTile(
title: 'CameraView'.text.make(), title: 'CameraView'.text.make(),
onTap: () async { onTap: () async {
File? file = await camView(context, title: 'TEST'); File file = await camView(context, title: 'TEST');
print(await file?.length()); print(await file.length());
}, },
), ),
// END // END

@ -8,7 +8,7 @@ import 'package:get/get.dart';
class ExampleBottomButton extends StatefulWidget { class ExampleBottomButton extends StatefulWidget {
ExampleBottomButton({Key? key}) : super(key: key); ExampleBottomButton({Key key}) : super(key: key);
@override @override
_ExampleBottomButtonState createState() => _ExampleBottomButtonState(); _ExampleBottomButtonState createState() => _ExampleBottomButtonState();

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExampleBox extends StatefulWidget { class ExampleBox extends StatefulWidget {
ExampleBox({Key? key}) : super(key: key); ExampleBox({Key key}) : super(key: key);
@override @override
_ExampleBoxState createState() => _ExampleBoxState(); _ExampleBoxState createState() => _ExampleBoxState();

@ -7,7 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
class ExampleButton extends StatefulWidget { class ExampleButton extends StatefulWidget {
ExampleButton({Key? key}) : super(key: key); ExampleButton({Key key}) : super(key: key);
@override @override
_ExampleButtonState createState() => _ExampleButtonState(); _ExampleButtonState createState() => _ExampleButtonState();
@ -69,12 +69,6 @@ class _ExampleButtonState extends State<ExampleButton> {
trailing: ASButton.order( trailing: ASButton.order(
title: '立即下单', title: '立即下单',
)), )),
ListTile(
title: Text('yellowHollow'),
trailing: ASButton.yellowHollow(
title: '立即下单',
onPressed: () {},
)),
SizedBox(height: 12.w), SizedBox(height: 12.w),
Row( Row(
children: [ children: [
@ -153,25 +147,25 @@ class _ExampleButtonState extends State<ExampleButton> {
groupValue: groupValue, groupValue: groupValue,
value: 0, value: 0,
title: '候选0', title: '候选0',
onTap: (dynamic _) => setState(() => groupValue = 0), onTap: (_) => setState(() => groupValue = 0),
), ),
ASRadioButton( ASRadioButton(
groupValue: groupValue, groupValue: groupValue,
value: 1, value: 1,
title: '候选1', title: '候选1',
onTap: (dynamic _) => setState(() => groupValue = 1), onTap: (_) => setState(() => groupValue = 1),
), ),
ASRadioButton( ASRadioButton(
groupValue: groupValue, groupValue: groupValue,
value: 2, value: 2,
title: '候选2', title: '候选2',
onTap: (dynamic _) => setState(() => groupValue = 2), onTap: (_) => setState(() => groupValue = 2),
), ),
ASRadioButton( ASRadioButton(
groupValue: groupValue, groupValue: groupValue,
value: 3, value: 3,
title: '候选3', title: '候选3',
onTap: (dynamic _) => setState(() => groupValue = 3), onTap: (_) => setState(() => groupValue = 3),
), ),
], ],
), ),

@ -1,48 +0,0 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:ansu_ui/chart/circle_chart_widget.dart';
import 'package:example/codeviewer/code_segments.dart';
import 'package:example/common/code_view.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ExampleChart extends StatefulWidget {
const ExampleChart({Key? key}) : super(key: key);
@override
_ExampleChartState createState() => _ExampleChartState();
}
class _ExampleChartState extends State<ExampleChart> {
@override
Widget build(BuildContext context) {
return ASScaffold(
title: 'chart',
actions: [
IconButton(
icon: Icon(Icons.code, color: Colors.black54),
onPressed: () => Get.to(CodeView(
text: (context) => CodeSegments.button(context),
)),
),
],
body: ListView(
children: [
20.hb,
ListTile(
title: Text('circle chart'),
trailing: Container(
width: 50.w,
height: 50.w,
child: CircleChart(
size: 40.w,
color: Colors.red,
aboveStrokeWidth: 10.w,
core: '65%'.text.size(20.sp).color(kTextColor).make(),
aspectRato: 0.65,
),
)),
],
),
);
}
}

@ -1,84 +0,0 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:ansu_ui/divider/as_dotted_divider.dart';
import 'package:example/codeviewer/code_segments.dart';
import 'package:example/common/code_view.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class ExampleDivider extends StatefulWidget {
ExampleDivider({Key? key}) : super(key: key);
@override
_ExampleDividerState createState() => _ExampleDividerState();
}
class _ExampleDividerState extends State<ExampleDivider> {
@override
Widget build(BuildContext context) {
return ASScaffold(
title: '分割线',
actions: [
IconButton(
icon: Icon(Icons.code, color: Colors.black54),
onPressed: () => Get.to(CodeView(
text: (context) => CodeSegments.button(context),
)),
),
],
body: Center(
child: Column(
children: [
Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: 'ASDivider'.text.make(),
),
ASDivider(
color: Colors.black,
),
Row(
children: [
Container(
height: 50.w,
color: Colors.red,
).expand(),
ASVDivider(),
Container(
height: 50.w,
color: Colors.red,
).expand(),
],
),
ASDivider(),
Container(
width: double.infinity,
height: 50.w,
color: Colors.red,
child: 'ASDottedDivider'.text.make(),
),
ASDottedDivider.horizontal(
color: Colors.black,
),
Container(
height: 100.w,
child: Row(
children: [
Container(
color: Colors.red,
).expand(),
ASDottedDivider.vertical(
color: Colors.black,
),
Container(
color: Colors.red,
).expand(),
],
),
),
],
),
),
);
}
}

@ -2,7 +2,7 @@ import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExampleDrawer extends StatefulWidget { class ExampleDrawer extends StatefulWidget {
ExampleDrawer({Key? key}) : super(key: key); ExampleDrawer({Key key}) : super(key: key);
@override @override
_ExampleDrawerState createState() => _ExampleDrawerState(); _ExampleDrawerState createState() => _ExampleDrawerState();

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExampleListTile extends StatefulWidget { class ExampleListTile extends StatefulWidget {
ExampleListTile({Key? key}) : super(key: key); ExampleListTile({Key key}) : super(key: key);
@override @override
_ExampleListTileState createState() => _ExampleListTileState(); _ExampleListTileState createState() => _ExampleListTileState();
@ -20,12 +20,6 @@ class _ExampleListTileState extends State<ExampleListTile> {
SizedBox( SizedBox(
height: 8.w, height: 8.w,
), ),
Row(
children: [
'ASOptionTile'.text.size(18.sp).black.make(),
'-ASListTile'.text.size(14.sp).black.make()
],
),
ASOptionTile( ASOptionTile(
items: [ items: [
ASListTile( ASListTile(
@ -60,12 +54,6 @@ class _ExampleListTileState extends State<ExampleListTile> {
], ],
), ),
20.hb, 20.hb,
Row(
children: [
'ASOptionTile'.text.size(18.sp).black.make(),
'-ASOptionTileItem'.text.size(14.sp).black.make()
],
),
ASOptionTile( ASOptionTile(
items: List.generate( items: List.generate(
3, 3,
@ -77,24 +65,12 @@ class _ExampleListTileState extends State<ExampleListTile> {
), ),
), ),
20.hb, 20.hb,
Row(
children: [
'ASOptionTile.single'.text.size(18.sp).black.make(),
'-ASEditTile'.text.size(14.sp).black.make()
],
),
ASOptionTile.single( ASOptionTile.single(
item: ASEditTile( item: ASEditTile(
title: Text('TEST'), title: Text('TEST'),
), ),
), ),
20.hb, 20.hb,
Row(
children: [
'ASOptionTile.single'.text.size(18.sp).black.make(),
'-ASVerticalTileItem'.text.size(14.sp).black.make()
],
),
ASOptionTile.single( ASOptionTile.single(
item: ASVerticalTileItem( item: ASVerticalTileItem(
title: Text('AS Vertical Tile'), title: Text('AS Vertical Tile'),
@ -102,9 +78,6 @@ class _ExampleListTileState extends State<ExampleListTile> {
), ),
), ),
20.hb, 20.hb,
Row(
children: ['ASOptionTile.single'.text.size(18.sp).black.make()],
),
ASOptionTile( ASOptionTile(
leading: '基础信息', leading: '基础信息',
items: [], items: [],

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
class ExampleNumericButton extends StatefulWidget { class ExampleNumericButton extends StatefulWidget {
ExampleNumericButton({Key? key}) : super(key: key); ExampleNumericButton({Key key}) : super(key: key);
@override @override
_ExampleNumericButtonState createState() => _ExampleNumericButtonState(); _ExampleNumericButtonState createState() => _ExampleNumericButtonState();
@ -19,7 +19,6 @@ class _ExampleNumericButtonState extends State<ExampleNumericButton> {
} }
int _pickedValue = 0; int _pickedValue = 0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
@ -61,6 +60,7 @@ class _ExampleNumericButtonState extends State<ExampleNumericButton> {
}, },
), ),
), ),
// END // END
], ],
); );

@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
class ExamplePicker extends StatefulWidget { class ExamplePicker extends StatefulWidget {
ExamplePicker({Key? key}) : super(key: key); ExamplePicker({Key key}) : super(key: key);
@override @override
_ExamplePickerState createState() => _ExamplePickerState(); _ExamplePickerState createState() => _ExamplePickerState();
@ -36,18 +36,18 @@ class _ExamplePickerState extends State<ExamplePicker> {
// BEGIN picker // BEGIN picker
ListTile( ListTile(
title: Text('日期选择器'), title: Text('日期选择器'),
subtitle: Text('DatePicker/asDatePicker'), subtitle: Text('DatePicker'),
trailing: ASButton( trailing: ASButton(
title: '日期选择器', title: '日期选择器',
onPressed: () async { onPressed: () async {
DateTime? date = await showAsDatePicker(context); DateTime date = await asDatePicker(context);
Get.snackbar(date.toString(), 'MESSAGE'); Get.snackbar(date.toString(), 'MESSAGE');
}, },
), ),
), ),
ListTile( ListTile(
title: Text('自定义选择器'), title: Text('自定义选择器'),
subtitle: Text('CustomPicker/ASPickerBox'), subtitle: Text('CustomPicker'),
trailing: ASButton( trailing: ASButton(
title: '自定义选择器', title: '自定义选择器',
onPressed: () async { onPressed: () async {
@ -60,7 +60,7 @@ class _ExamplePickerState extends State<ExamplePicker> {
), ),
ListTile( ListTile(
title: Text('时间区间选择器'), title: Text('时间区间选择器'),
subtitle: Text('DateRangePicker/show2DatePicker'), subtitle: Text('DateRangePicker'),
trailing: ASButton( trailing: ASButton(
title: '时间区间选择器', title: '时间区间选择器',
onPressed: () async { onPressed: () async {
@ -71,22 +71,22 @@ class _ExamplePickerState extends State<ExamplePicker> {
), ),
ListTile( ListTile(
title: Text('图片选择器'), title: Text('图片选择器'),
subtitle: Text('ImagePicker/camView'), subtitle: Text('ImagePicker'),
trailing: ASButton( trailing: ASButton(
title: '图片选择器', title: '图片选择器',
onPressed: () async { onPressed: () async {
File? file = await camView(context, title: '图片选择器'); File file = await camView(context, title: '图片选择器');
print(file?.lengthSync()); print(file.lengthSync());
}, },
), ),
), ),
ListTile( ListTile(
title: Text('图片选择器'), title: Text('图片选择器'),
subtitle: Text('ImagePicker/pickImageFile'), subtitle: Text('ImagePicker'),
trailing: ASButton( trailing: ASButton(
title: '图片选择器', title: '图片选择器',
onPressed: () async { onPressed: () async {
File? file = await pickImageFile(); File file = await pickImageFile();
}, },
), ),
), ),

@ -3,14 +3,14 @@ import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class ExamplePopUpMenu extends StatefulWidget { class ExamplePopUpMenu extends StatefulWidget {
ExamplePopUpMenu({Key? key}) : super(key: key); ExamplePopUpMenu({Key key}) : super(key: key);
@override @override
_ExamplePopUpMenuState createState() => _ExamplePopUpMenuState(); _ExamplePopUpMenuState createState() => _ExamplePopUpMenuState();
} }
class _ExamplePopUpMenuState extends State<ExamplePopUpMenu> { class _ExamplePopUpMenuState extends State<ExamplePopUpMenu> {
int? _value; int _value;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
@ -25,7 +25,7 @@ class _ExamplePopUpMenuState extends State<ExamplePopUpMenu> {
return TextButton( return TextButton(
child: '$_value'.text.make(), child: '$_value'.text.make(),
onPressed: () async { onPressed: () async {
int? result = await showASPopUpMenu<int>( int result = await showASPopUpMenu<int>(
context: context, context: context,
initValue: _value, initValue: _value,
items: List.generate( items: List.generate(

@ -2,7 +2,7 @@ import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExampleRefresh extends StatefulWidget { class ExampleRefresh extends StatefulWidget {
ExampleRefresh({Key? key}) : super(key: key); ExampleRefresh({Key key}) : super(key: key);
@override @override
_ExampleRefreshState createState() => _ExampleRefreshState(); _ExampleRefreshState createState() => _ExampleRefreshState();

@ -6,7 +6,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
class ExampleScaffold extends StatefulWidget { class ExampleScaffold extends StatefulWidget {
ExampleScaffold({Key? key}) : super(key: key); ExampleScaffold({Key key}) : super(key: key);
@override @override
_ExampleScaffoldState createState() => _ExampleScaffoldState(); _ExampleScaffoldState createState() => _ExampleScaffoldState();
@ -14,15 +14,15 @@ class ExampleScaffold extends StatefulWidget {
class _ExampleScaffoldState extends State<ExampleScaffold> class _ExampleScaffoldState extends State<ExampleScaffold>
with TickerProviderStateMixin { with TickerProviderStateMixin {
late TabController _tabController; TabController _tabController;
List<String>? tabs; List<String> tabs;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
tabs = List.generate(10, (index) => 'Tab $index'); tabs = List.generate(10, (index) => 'Tab $index');
_tabController = TabController( _tabController = TabController(
length: tabs!.length, length: tabs.length,
vsync: this, vsync: this,
); );
} }

@ -4,7 +4,7 @@ import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class ExampleStyleColor extends StatefulWidget { class ExampleStyleColor extends StatefulWidget {
ExampleStyleColor({Key? key}) : super(key: key); ExampleStyleColor({Key key}) : super(key: key);
@override @override
_ExampleStyleColorState createState() => _ExampleStyleColorState(); _ExampleStyleColorState createState() => _ExampleStyleColorState();
@ -26,7 +26,7 @@ class _ExampleStyleColorState extends State<ExampleStyleColor> {
], ],
), ),
), ),
subtitle: Text(object.codeName!), subtitle: Text(object.codeName),
trailing: Card( trailing: Card(
color: object.color, color: object.color,
child: SizedBox(height: 50.w, width: 50.w), child: SizedBox(height: 50.w, width: 50.w),

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
class ExampleTabBar extends StatefulWidget { class ExampleTabBar extends StatefulWidget {
ExampleTabBar({Key? key}) : super(key: key); ExampleTabBar({Key key}) : super(key: key);
@override @override
_ExampleTabBarState createState() => _ExampleTabBarState(); _ExampleTabBarState createState() => _ExampleTabBarState();
@ -13,10 +13,10 @@ class ExampleTabBar extends StatefulWidget {
class _ExampleTabBarState extends State<ExampleTabBar> class _ExampleTabBarState extends State<ExampleTabBar>
with TickerProviderStateMixin { with TickerProviderStateMixin {
TabController? _tabController1; TabController _tabController1;
TabController? _tabController2; TabController _tabController2;
TabController? _tabController3; TabController _tabController3;
TabController? _tabController4; TabController _tabController4;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -58,23 +58,23 @@ class _ExampleTabBarState extends State<ExampleTabBar>
// BEGIN tabBar // BEGIN tabBar
ASTabBar( ASTabBar(
items: ['全部', 'Part1', 'Part2'], items: ['全部', 'Part1', 'Part2'],
controller: _tabController1!, controller: _tabController1,
), ),
ASTabBar( ASTabBar(
items: List.generate(5, (index) => 'Tab $index'), items: List.generate(5, (index) => 'Tab $index'),
controller: _tabController2!, controller: _tabController2,
), ),
ASTabBar( ASTabBar(
isScrollable: true, isScrollable: true,
items: List.generate(10, (index) => 'Tab $index'), items: List.generate(10, (index) => 'Tab $index'),
controller: _tabController3!, controller: _tabController3,
), ),
ASTabBar.tag( ASTabBar.tag(
isScrollable: true, isScrollable: true,
tabItems: List.generate(10, (index) => 'Tab $index') tabItems: List.generate(10, (index) => 'Tab $index')
.map((e) => ASTabBarItem(title: e, tag: e)) .map((e) => ASTabBarItem(title: e, tag: e))
.toList(), .toList(),
controller: _tabController4!, controller: _tabController4,
), ),
// END // END

@ -6,7 +6,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class ExampleTag extends StatefulWidget { class ExampleTag extends StatefulWidget {
ExampleTag({Key? key}) : super(key: key); ExampleTag({Key key}) : super(key: key);
@override @override
_ExampaleTagState createState() => _ExampaleTagState(); _ExampaleTagState createState() => _ExampaleTagState();
@ -64,7 +64,7 @@ class _ExampaleTagState extends State<ExampleTag> {
), ),
ListTile( ListTile(
onTap: () => setState(() => _checked = !_checked), onTap: () => setState(() => _checked = !_checked),
title: Text('ASCheckTag'), title: Text('ASCheckedTag'),
trailing: ASCheckTag( trailing: ASCheckTag(
checked: _checked, checked: _checked,
text: 'TAG'.text.make(), text: 'TAG'.text.make(),

@ -2,14 +2,14 @@ import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ExampleTextFiled extends StatefulWidget { class ExampleTextFiled extends StatefulWidget {
ExampleTextFiled({Key? key}) : super(key: key); ExampleTextFiled({Key key}) : super(key: key);
@override @override
_ExampleTextFiledState createState() => _ExampleTextFiledState(); _ExampleTextFiledState createState() => _ExampleTextFiledState();
} }
class _ExampleTextFiledState extends State<ExampleTextFiled> { class _ExampleTextFiledState extends State<ExampleTextFiled> {
TextEditingController? _controller; TextEditingController _controller;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ASScaffold( return ASScaffold(
@ -17,13 +17,10 @@ class _ExampleTextFiledState extends State<ExampleTextFiled> {
backgroundColor: kForegroundColor, backgroundColor: kForegroundColor,
body: ListView( body: ListView(
children: [ children: [
'ASSearchTextField'.text.size(18.sp).make(),
ASSearchTextField( ASSearchTextField(
controller: _controller, controller: _controller,
hintText: '搜索', hintText: '搜索',
), ),
40.w.heightBox,
'ASSearchTextField.button'.text.size(18.sp).black.make(),
ASSearchTextField.button( ASSearchTextField.button(
hintText: '搜索', hintText: '搜索',
onPressed: () {}, onPressed: () {},

@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class ExampleToast extends StatelessWidget { class ExampleToast extends StatelessWidget {
const ExampleToast({Key? key}) : super(key: key); const ExampleToast({Key key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

@ -7,100 +7,107 @@ packages:
path: "." path: "."
ref: HEAD ref: HEAD
resolved-ref: d724abf91595f58ed58f6c722ebe60acdb750c67 resolved-ref: d724abf91595f58ed58f6c722ebe60acdb750c67
url: "https://git.oa00.com/flutter_pub/animated_collection.git" url: "http://159.75.73.143:8080/laiiihz/animated_collection.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
animator:
dependency: transitive
description:
name: animator
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
ansu_ui: ansu_ui:
dependency: "direct main" dependency: "direct main"
description: description:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "1.0.0" version: "0.0.4"
args: args:
dependency: "direct main" dependency: "direct main"
description: description:
name: args name: args
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.3.1" version: "2.0.0"
async: async:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.9.0" version: "2.5.0"
auto_size_text_pk: auto_size_text_pk:
dependency: transitive dependency: transitive
description: description:
name: auto_size_text_pk name: auto_size_text_pk
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
bot_toast: bot_toast:
dependency: transitive dependency: transitive
description: description:
name: bot_toast name: bot_toast
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.3" version: "4.0.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters 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.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
cli_util: cli_util:
dependency: transitive dependency: transitive
description: description:
name: cli_util name: cli_util
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.3.5" version: "0.3.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3+2"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.5" version: "1.0.2"
expandable: expandable:
dependency: transitive dependency: transitive
description: description:
name: expandable name: expandable
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.0.1" version: "5.0.1"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "6.1.4" version: "6.1.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -110,9 +117,9 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: flutter_easyrefresh name: flutter_easyrefresh
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.2" version: "2.2.1"
flutter_localizations: flutter_localizations:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -122,16 +129,16 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: flutter_plugin_android_lifecycle name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.7" version: "2.0.1"
flutter_screenutil: flutter_screenutil:
dependency: transitive dependency: transitive
description: description:
name: flutter_screenutil name: flutter_screenutil
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.5.4" version: "5.0.0"
flutter_web_plugins: flutter_web_plugins:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -141,100 +148,107 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: get name: get
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.6.5" version: "4.1.4"
glob: glob:
dependency: transitive dependency: transitive
description: description:
name: glob name: glob
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.0.1"
grinder: grinder:
dependency: "direct main" dependency: "direct main"
description: description:
name: grinder name: grinder
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.9.1" version: "0.9.0"
http: http:
dependency: transitive dependency: transitive
description: description:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.13.5" version: "0.13.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.1" version: "4.0.0"
image_picker: image_picker:
dependency: transitive dependency: transitive
description: description:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.7.5+4" version: "0.7.4"
image_picker_for_web: image_picker_for_web:
dependency: transitive dependency: transitive
description: description:
name: image_picker_for_web name: image_picker_for_web
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.8" version: "2.0.0"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.6.1" version: "2.0.1"
intl: intl:
dependency: transitive dependency: transitive
description: description:
name: intl name: intl
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.17.0" version: "0.17.0"
js: js:
dependency: transitive dependency: transitive
description: description:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.6.3" version: "0.6.3"
lpinyin: lpinyin:
dependency: transitive dependency: transitive
description: description:
name: lpinyin name: lpinyin
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.3" version: "2.0.1"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.7.0" version: "1.3.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.11.0"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.3" version: "2.0.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -244,51 +258,58 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.9.1" version: "1.8.1"
states_rebuilder:
dependency: transitive
description:
name: states_rebuilder
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0+1"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.1" version: "1.2.0"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.0"
velocity_x: velocity_x:
dependency: transitive dependency: transitive
description: description:
name: velocity_x name: velocity_x
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.5.1" version: "2.6.1"
vxstate: vxstate:
dependency: transitive dependency: transitive
description: description:
name: vxstate name: vxstate
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.0" version: "2.0.1"
sdks: sdks:
dart: ">=2.15.0 <3.0.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=2.8.0" flutter: ">=2.0.0"

@ -4,7 +4,7 @@ publish_to: "none"
version: 1.0.0+1 version: 1.0.0+1
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: ">=2.7.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:
@ -17,7 +17,7 @@ dependencies:
cupertino_icons: ^1.0.0 cupertino_icons: ^1.0.0
ansu_ui: ansu_ui:
path: ../ path: ../
get: ^4.1.3 get:
grinder: grinder:
args: args:

@ -25,7 +25,7 @@ void main(List<String> arguments) {
writeSegments( writeSegments(
sourceDirectoryPath: path.join(Directory.current.path, 'lib'), sourceDirectoryPath: path.join(Directory.current.path, 'lib'),
targetFilePath: argResults['target'] as String?, targetFilePath: argResults['target'] as String,
isDryRun: argResults['dry-run'] as bool, isDryRun: argResults['dry-run'] as bool,
); );
} }

@ -76,15 +76,15 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
'bool', 'bool',
]; ];
String? _src; String _src;
late StringScanner _scanner; StringScanner _scanner;
late List<_HighlightSpan> _spans; List<_HighlightSpan> _spans;
@override @override
List<CodeSpan> format(String? src) { List<CodeSpan> format(String src) {
_src = src; _src = src;
_scanner = StringScanner(_src!); _scanner = StringScanner(_src);
if (_generateSpans()) { if (_generateSpans()) {
// Successfully parsed the code // Successfully parsed the code
@ -93,19 +93,19 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
for (final span in _spans) { for (final span in _spans) {
if (currentPosition != span.start) { if (currentPosition != span.start) {
formattedText.add( formattedText
CodeSpan(text: _src!.substring(currentPosition, span.start))); .add(CodeSpan(text: _src.substring(currentPosition, span.start)));
} }
formattedText formattedText
.add(CodeSpan(type: span.type, text: span.textForSpan(_src!))); .add(CodeSpan(type: span.type, text: span.textForSpan(_src)));
currentPosition = span.end; currentPosition = span.end;
} }
if (currentPosition != _src!.length) { if (currentPosition != _src.length) {
formattedText.add( formattedText
CodeSpan(text: _src!.substring(currentPosition, _src!.length))); .add(CodeSpan(text: _src.substring(currentPosition, _src.length)));
} }
return formattedText; return formattedText;
@ -126,23 +126,23 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'/\*(.|\n)*\*/'))) { if (_scanner.scan(RegExp(r'/\*(.|\n)*\*/'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.comment, _HighlightType.comment,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
// Line comments // Line comments
if (_scanner.scan('//')) { if (_scanner.scan('//')) {
final startComment = _scanner.lastMatch!.start; final startComment = _scanner.lastMatch.start;
var eof = false; var eof = false;
int endComment; int endComment;
if (_scanner.scan(RegExp(r'.*\n'))) { if (_scanner.scan(RegExp(r'.*\n'))) {
endComment = _scanner.lastMatch!.end - 1; endComment = _scanner.lastMatch.end - 1;
} else { } else {
eof = true; eof = true;
endComment = _src!.length; endComment = _src.length;
} }
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
@ -162,8 +162,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'r".*"'))) { if (_scanner.scan(RegExp(r'r".*"'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.string, _HighlightType.string,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -172,8 +172,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r"r'.*'"))) { if (_scanner.scan(RegExp(r"r'.*'"))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.string, _HighlightType.string,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -182,8 +182,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'"""(?:[^"\\]|\\(.|\n))*"""'))) { if (_scanner.scan(RegExp(r'"""(?:[^"\\]|\\(.|\n))*"""'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.string, _HighlightType.string,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -192,8 +192,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r"'''(?:[^'\\]|\\(.|\n))*'''"))) { if (_scanner.scan(RegExp(r"'''(?:[^'\\]|\\(.|\n))*'''"))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.string, _HighlightType.string,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -202,8 +202,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'"(?:[^"\\]|\\.)*"'))) { if (_scanner.scan(RegExp(r'"(?:[^"\\]|\\.)*"'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.string, _HighlightType.string,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -212,8 +212,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r"'(?:[^'\\]|\\.)*'"))) { if (_scanner.scan(RegExp(r"'(?:[^'\\]|\\.)*'"))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.string, _HighlightType.string,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -222,8 +222,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'\d+\.\d+'))) { if (_scanner.scan(RegExp(r'\d+\.\d+'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.number, _HighlightType.number,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -231,7 +231,7 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
// Integer // Integer
if (_scanner.scan(RegExp(r'\d+'))) { if (_scanner.scan(RegExp(r'\d+'))) {
_spans.add(_HighlightSpan(_HighlightType.number, _spans.add(_HighlightSpan(_HighlightType.number,
_scanner.lastMatch!.start, _scanner.lastMatch!.end)); _scanner.lastMatch.start, _scanner.lastMatch.end));
continue; continue;
} }
@ -239,8 +239,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'[\[\]{}().!=<>&\|\?\+\-\*/%\^~;:,]'))) { if (_scanner.scan(RegExp(r'[\[\]{}().!=<>&\|\?\+\-\*/%\^~;:,]'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.punctuation, _HighlightType.punctuation,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
@ -249,17 +249,17 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (_scanner.scan(RegExp(r'@\w+'))) { if (_scanner.scan(RegExp(r'@\w+'))) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
_HighlightType.keyword, _HighlightType.keyword,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
continue; continue;
} }
// Words // Words
if (_scanner.scan(RegExp(r'\w+'))) { if (_scanner.scan(RegExp(r'\w+'))) {
_HighlightType? type; _HighlightType type;
var word = _scanner.lastMatch![0]!; var word = _scanner.lastMatch[0];
if (word.startsWith('_')) { if (word.startsWith('_')) {
word = word.substring(1); word = word.substring(1);
} }
@ -279,8 +279,8 @@ class DartSyntaxPrehighlighter extends SyntaxPrehighlighter {
if (type != null) { if (type != null) {
_spans.add(_HighlightSpan( _spans.add(_HighlightSpan(
type, type,
_scanner.lastMatch!.start, _scanner.lastMatch.start,
_scanner.lastMatch!.end, _scanner.lastMatch.end,
)); ));
} }
} }
@ -346,13 +346,13 @@ class CodeSpan {
CodeSpan({this.type = _HighlightType.base, this.text}); CodeSpan({this.type = _HighlightType.base, this.text});
final _HighlightType type; final _HighlightType type;
final String? text; final String text;
@override @override
String toString() { String toString() {
return 'TextSpan(' return 'TextSpan('
'style: codeStyle.${_styleNameOf(type)}, ' 'style: codeStyle.${_styleNameOf(type)}, '
"text: '${_escape(text!)}'" "text: '${_escape(text)}'"
')'; ')';
} }
} }
@ -376,6 +376,7 @@ String _styleNameOf(_HighlightType type) {
case _HighlightType.base: case _HighlightType.base:
return 'baseStyle'; return 'baseStyle';
} }
return '';
} }
String _escape(String text) { String _escape(String text) {
@ -408,4 +409,4 @@ String _encode(int charCode) {
String _encodeAndPad(int charCode) { String _encodeAndPad(int charCode) {
final encoded = _encode(charCode); final encoded = _encode(charCode);
return '0' * (4 - encoded.length) + encoded; return '0' * (4 - encoded.length) + encoded;
} }

@ -4,7 +4,6 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'prehighlighter.dart'; import 'prehighlighter.dart';
const _globalPrologue = const _globalPrologue =
@ -31,7 +30,7 @@ enum _FileReadStatus {
/// Returns the new status of the scanner whose previous status was /// Returns the new status of the scanner whose previous status was
/// [oldStatus], after scanning the line [line]. /// [oldStatus], after scanning the line [line].
_FileReadStatus? _updatedStatus(_FileReadStatus? oldStatus, String line) { _FileReadStatus _updatedStatus(_FileReadStatus oldStatus, String line) {
_FileReadStatus lineStatus; _FileReadStatus lineStatus;
if (line.trim().startsWith('//')) { if (line.trim().startsWith('//')) {
lineStatus = _FileReadStatus.comments; lineStatus = _FileReadStatus.comments;
@ -41,7 +40,7 @@ _FileReadStatus? _updatedStatus(_FileReadStatus? oldStatus, String line) {
lineStatus = _FileReadStatus.finished; lineStatus = _FileReadStatus.finished;
} }
_FileReadStatus? newStatus; _FileReadStatus newStatus;
switch (oldStatus) { switch (oldStatus) {
case _FileReadStatus.comments: case _FileReadStatus.comments:
newStatus = newStatus =
@ -57,8 +56,6 @@ _FileReadStatus? _updatedStatus(_FileReadStatus? oldStatus, String line) {
case _FileReadStatus.finished: case _FileReadStatus.finished:
newStatus = oldStatus; newStatus = oldStatus;
break; break;
default:
newStatus = oldStatus;
} }
return newStatus; return newStatus;
} }
@ -80,7 +77,7 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
final content = file.readAsStringSync(); final content = file.readAsStringSync();
final lines = const LineSplitter().convert(content); final lines = const LineSplitter().convert(content);
_FileReadStatus? status = _FileReadStatus.comments; var status = _FileReadStatus.comments;
final prologue = StringBuffer(); final prologue = StringBuffer();
@ -138,7 +135,7 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
// Simple line. // Simple line.
for (final name in activeSubsegments) { for (final name in activeSubsegments) {
subsegments[name]!.writeln(line); subsegments[name].writeln(line);
} }
} }
} }
@ -149,7 +146,7 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
} }
var segments = <String, List<TaggedString>>{}; var segments = <String, List<TaggedString>>{};
var segmentPrologues = <String, String?>{}; var segmentPrologues = <String, String>{};
// Sometimes a code segment is made up of subsegments. They are marked by // Sometimes a code segment is made up of subsegments. They are marked by
// names with a "#" symbol in it, such as "bottomSheetDemoModal#1" and // names with a "#" symbol in it, such as "bottomSheetDemoModal#1" and
@ -171,7 +168,7 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
if (!segments.containsKey(name)) { if (!segments.containsKey(name)) {
segments[name] = []; segments[name] = [];
} }
segments[name]!.add( segments[name].add(
TaggedString( TaggedString(
text: value.toString(), text: value.toString(),
order: order, order: order,
@ -182,7 +179,7 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
}); });
segments.forEach((key, value) { segments.forEach((key, value) {
value.sort((ts1, ts2) => (ts1.order! - ts2.order!).sign.round()); value.sort((ts1, ts2) => (ts1.order - ts2.order).sign.round());
}); });
var answer = <String, String>{}; var answer = <String, String>{};
@ -190,11 +187,11 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
for (final name in segments.keys) { for (final name in segments.keys) {
final buffer = StringBuffer(); final buffer = StringBuffer();
buffer.write(segmentPrologues[name]!.trim()); buffer.write(segmentPrologues[name].trim());
buffer.write('\n\n'); buffer.write('\n\n');
for (final ts in segments[name]!) { for (final ts in segments[name]) {
buffer.write(ts.text!.trim()); buffer.write(ts.text.trim());
buffer.write('\n\n'); buffer.write('\n\n');
} }
@ -211,8 +208,8 @@ Map<String, String> _createSegments(String sourceDirectoryPath) {
class TaggedString { class TaggedString {
TaggedString({this.text, this.order}); TaggedString({this.text, this.order});
final String? text; final String text;
final double? order; final double order;
} }
void _formatSegments(Map<String, String> segments, IOSink output) { void _formatSegments(Map<String, String> segments, IOSink output) {
@ -257,15 +254,13 @@ void _formatSegments(Map<String, String> segments, IOSink output) {
/// ///
/// The target file is overwritten. /// The target file is overwritten.
void writeSegments( void writeSegments(
{required String sourceDirectoryPath, {String sourceDirectoryPath, String targetFilePath, bool isDryRun}) {
String? targetFilePath,
required bool isDryRun}) {
final segments = _createSegments(sourceDirectoryPath); final segments = _createSegments(sourceDirectoryPath);
final output = isDryRun ? stdout : File(targetFilePath!).openWrite(); final output = isDryRun ? stdout : File(targetFilePath).openWrite();
_formatSegments(segments, output); _formatSegments(segments, output);
} }
class PreformatterException implements Exception { class PreformatterException implements Exception {
PreformatterException(this.cause); PreformatterException(this.cause);
String cause; String cause;
} }

@ -63,7 +63,7 @@ Future<void> _runProcess(String executable, List<String> arguments) async {
// Function to make sure we capture all of the stdout. // Function to make sure we capture all of the stdout.
// Reference: https://github.com/dart-lang/sdk/issues/31666 // Reference: https://github.com/dart-lang/sdk/issues/31666
Future<String> _startProcess(String executable, Future<String> _startProcess(String executable,
{List<String> arguments = const [], String? input}) async { {List<String> arguments = const [], String input}) async {
final output = <int>[]; final output = <int>[];
final completer = Completer<int>(); final completer = Completer<int>();
final process = await Process.start(executable, arguments); final process = await Process.start(executable, arguments);

@ -1,63 +1,77 @@
library ansu_ui; library ansu_ui;
export 'package:flutter_screenutil/flutter_screenutil.dart';
//third party
export 'package:velocity_x/velocity_x.dart';
export 'badge/as_badge.dart';
export 'bar/as_navigation_bar.dart';
export 'bar/as_navigation_item.dart';
export 'bar/as_tabbar.dart';
export 'bar/as_tabbar_item.dart';
export 'box/as_check_box.dart';
export 'buttons/as_back_button.dart';
export 'buttons/as_bottom_button.dart';
//buttons //buttons
export 'buttons/as_button.dart'; export 'buttons/as_button.dart';
export 'buttons/as_check_button.dart';
export 'buttons/as_gradient_button.dart';
export 'buttons/as_long_button.dart'; export 'buttons/as_long_button.dart';
export 'buttons/as_material_button.dart'; export 'buttons/as_back_button.dart';
export 'buttons/as_numeric_button.dart'; export 'buttons/as_numeric_button.dart';
export 'buttons/as_bottom_button.dart';
export 'buttons/as_gradient_button.dart';
export 'buttons/as_radio_button.dart'; export 'buttons/as_radio_button.dart';
export 'dialog/as_bottom_dialog.dart'; export 'buttons/as_material_button.dart';
export 'dialog/as_bottom_dialog_item.dart'; export 'buttons/as_check_button.dart';
export 'dialog/as_delete_dialog.dart';
//scaffold
export 'scaffold/as_scaffold.dart';
export 'styles/as_colors.dart';
export 'bar/as_tabbar.dart';
export 'bar/as_tabbar_item.dart';
export 'bar/as_navigation_bar.dart';
export 'bar/as_navigation_item.dart';
export 'drawer/as_drawer.dart';
export 'toast/as_toast.dart';
export 'pickers/as_date_picker.dart';
export 'pickers/as_picker_box.dart';
export 'pickers/as_two_date_picker.dart';
export 'pickers/as_date_range_picker_part.dart';
export 'dialog/as_dialog.dart'; export 'dialog/as_dialog.dart';
export 'dialog/as_dialog_button.dart'; export 'dialog/as_dialog_button.dart';
export 'dialog/as_delete_dialog.dart';
export 'dialog/as_bottom_dialog.dart';
export 'dialog/as_bottom_dialog_item.dart';
export 'dialog/as_show_bottom_dialog.dart'; export 'dialog/as_show_bottom_dialog.dart';
export 'divider/as_divider.dart';
export 'drawer/as_drawer.dart';
export 'extension/Text_extension.dart';
export 'extension/image_extension.dart';
export 'extension/list_extension.dart';
export 'extension/num_extension.dart';
export 'extension/string_extension.dart';
export 'extension/text_style_extension.dart';
export 'extension/widget_extension.dart';
export 'list_tile/as_card_expandable.dart';
export 'list_tile/as_edit_tile.dart';
export 'list_tile/as_list_tile.dart'; export 'list_tile/as_list_tile.dart';
export 'list_tile/as_list_tile_x.dart';
export 'list_tile/as_option_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_option_tile_item.dart';
export 'list_tile/as_vertical_tile_item.dart'; export 'list_tile/as_vertical_tile_item.dart';
export 'pickers/as_date_picker.dart'; export 'list_tile/as_list_tile_x.dart';
export 'pickers/as_date_range_picker_part.dart'; export 'list_tile/as_card_expandable.dart';
export 'pickers/as_picker_box.dart';
export 'pickers/as_two_date_picker.dart';
export 'pop_up_menu/pop_up_menu.dart';
export 'refresh/as_refresh.dart'; export 'refresh/as_refresh.dart';
//scaffold
export 'scaffold/as_scaffold.dart'; export 'box/as_check_box.dart';
export 'styles/as_colors.dart';
export 'tag/as_check_tag.dart'; export 'pop_up_menu/pop_up_menu.dart';
export 'tag/as_tag.dart'; export 'tag/as_tag.dart';
export 'tag/as_check_tag.dart';
export 'divider/as_divider.dart';
export 'text_field/as_search_text_field.dart'; export 'text_field/as_search_text_field.dart';
export 'theme/as_theme.dart'; export 'badge/as_badge.dart';
export 'toast/as_toast.dart';
export 'utils/as_grid_image_view.dart'; export 'utils/screen_adapter.dart';
export 'utils/camera_util.dart'; export 'utils/camera_util.dart';
export 'utils/camera_view.dart'; export 'utils/camera_view.dart';
export 'utils/photo_viewer.dart'; export 'utils/photo_viewer.dart';
export 'utils/screen_adapter.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/image_extension.dart';
export 'theme/as_theme.dart';
//third party
export 'package:velocity_x/velocity_x.dart';
export 'package:flutter_screenutil/flutter_screenutil.dart';

@ -1,6 +1,6 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart';
/// ///
class ASButton extends StatelessWidget { class ASButton extends StatelessWidget {
@ -43,10 +43,6 @@ class ASButton extends StatelessWidget {
final Color? disableTextColor; final Color? disableTextColor;
final Color? splashColor; final Color? splashColor;
///
final double? height;
ASButton({ ASButton({
Key? key, Key? key,
this.bgcolor, this.bgcolor,
@ -62,7 +58,6 @@ class ASButton extends StatelessWidget {
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
this.splashColor, this.splashColor,
this.height,
}) : super(key: key); }) : super(key: key);
ASButton.danger({ ASButton.danger({
@ -76,7 +71,6 @@ class ASButton extends StatelessWidget {
this.width, this.width,
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
this.height,
}) : outline = true, }) : outline = true,
outlineColor = kDangerColor, outlineColor = kDangerColor,
textColor = kDangerColor, textColor = kDangerColor,
@ -94,8 +88,7 @@ class ASButton extends StatelessWidget {
this.width, this.width,
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
this.splashColor, this.splashColor})
this.height})
: outline = true, : outline = true,
outlineColor = kDarkColor, outlineColor = kDarkColor,
textColor = kTextColor, textColor = kTextColor,
@ -112,13 +105,11 @@ class ASButton extends StatelessWidget {
this.width, this.width,
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
this.height,
}) : bgcolor = kLightPrimaryColor, }) : bgcolor = kLightPrimaryColor,
textColor = kLightTextColor, textColor = kLightTextColor,
outline = false, outline = false,
this.splashColor = ColorTool.getSplashColor(kPrimaryColor), this.splashColor = ColorTool.getSplashColor(kPrimaryColor),
super(key: key); super(key: key);
ASButton.operation( ASButton.operation(
{Key? key, {Key? key,
this.radius, this.radius,
@ -130,13 +121,11 @@ class ASButton extends StatelessWidget {
this.width, this.width,
this.disableColor, this.disableColor,
this.disableTextColor, this.disableTextColor,
this.splashColor, this.splashColor})
this.height})
: bgcolor = Color(0xFFF2F2F2), : bgcolor = Color(0xFFF2F2F2),
textColor = kTextColor, textColor = kTextColor,
outline = false, outline = false,
super(key: key); super(key: key);
ASButton.order({ ASButton.order({
Key? key, Key? key,
required this.title, required this.title,
@ -144,7 +133,6 @@ class ASButton extends StatelessWidget {
this.outlineColor, this.outlineColor,
this.width, this.width,
this.splashColor, this.splashColor,
this.height,
}) : bgcolor = kLightPrimaryColor, }) : bgcolor = kLightPrimaryColor,
textColor = kTextColor, textColor = kTextColor,
textStyle = TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold), textStyle = TextStyle(fontSize: 14.sp, fontWeight: FontWeight.bold),
@ -155,24 +143,6 @@ class ASButton extends StatelessWidget {
padding = EdgeInsets.symmetric(vertical: 8.w), padding = EdgeInsets.symmetric(vertical: 8.w),
super(key: key); super(key: key);
ASButton.yellowHollow(
{Key? key,
this.radius,
this.textStyle,
this.padding,
required this.title,
this.onPressed,
this.width,
this.disableColor,
this.splashColor,
this.height})
: outline = true,
outlineColor = kPrimaryColor,
bgcolor = Colors.white,
textColor = kPrimaryColor,
disableTextColor = kPrimaryColor,
super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialButton( return MaterialButton(
@ -180,7 +150,6 @@ class ASButton extends StatelessWidget {
disabledTextColor: disableTextColor, disabledTextColor: disableTextColor,
textColor: textColor ?? kLightPrimaryColor, textColor: textColor ?? kLightPrimaryColor,
minWidth: width, minWidth: width,
height: height,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: onPressed, onPressed: onPressed,
child: title is String child: title is String

@ -1,6 +1,6 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart';
class ASLongButton extends StatelessWidget { class ASLongButton extends StatelessWidget {
/// ///
@ -21,7 +21,7 @@ class ASLongButton extends StatelessWidget {
final TextStyle? textStyle; final TextStyle? textStyle;
/// ///
final EdgeInsetsGeometry? padding; final Padding? padding;
/// ///
final bool outline; final bool outline;
@ -98,9 +98,10 @@ class ASLongButton extends StatelessWidget {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: onPressed, onPressed: onPressed,
child: title is String child: title is String
? Text(title, style: textStyle ?? TextStyle(fontSize: 20.sp)) ? Text(title,
style: textStyle ?? TextStyle(fontSize: 20.sp))
: title, : title,
padding: padding ?? EdgeInsets.symmetric(vertical: 8.w), padding: padding as EdgeInsetsGeometry? ?? EdgeInsets.symmetric(vertical: 8.w),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: outline side: outline
? BorderSide(color: outlineColor!, width: 1.w) ? BorderSide(color: outlineColor!, width: 1.w)

@ -1,8 +1,7 @@
import 'package:ansu_ui/painters/as_numeric_painter.dart'; import 'package:ansu_ui/painters/as_numeric_painter.dart';
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart';
///## ///##
class ASNumericButton extends StatefulWidget { class ASNumericButton extends StatefulWidget {
@ -132,7 +131,6 @@ class _ASNumericButtonState extends State<ASNumericButton> {
alignment: Alignment.center, alignment: Alignment.center,
child: IntrinsicWidth( child: IntrinsicWidth(
child: TextField( child: TextField(
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
controller: _controller, controller: _controller,
onChanged: (text) { onChanged: (text) {
@ -150,7 +148,6 @@ class _ASNumericButtonState extends State<ASNumericButton> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.zero,
isDense: true, isDense: true,
suffixText: widget.suffix, suffixText: widget.suffix,
suffixStyle: TextStyle( suffixStyle: TextStyle(

@ -5,7 +5,7 @@ import 'package:ansu_ui/extension/num_extension.dart';
class ASRadioButton<T> extends StatefulWidget { class ASRadioButton<T> extends StatefulWidget {
/// ///
final dynamic groupValue; final T? groupValue;
/// ///
final String? title; final String? title;
@ -15,37 +15,20 @@ class ASRadioButton<T> extends StatefulWidget {
/// ///
final Function(T value)? onTap; final Function(T value)? onTap;
///
final bool mulitpleChoice;
ASRadioButton({ ASRadioButton({
Key? key, Key? key,
this.groupValue, this.groupValue,
this.title, this.title,
this.value, this.value,
this.onTap, this.onTap,
}) : this.mulitpleChoice = false, }) : super(key: key);
super(key: key);
ASRadioButton.mult({
Key? key,
this.groupValue,
this.title,
this.value,
this.onTap,
}) : this.mulitpleChoice = true,
super(key: key);
@override @override
_ASRadioButtonState createState() => _ASRadioButtonState(); _ASRadioButtonState createState() => _ASRadioButtonState();
} }
class _ASRadioButtonState extends State<ASRadioButton> { class _ASRadioButtonState extends State<ASRadioButton> {
bool get _selected { bool get _selected => widget.value == widget.groupValue;
if (widget.mulitpleChoice) {
return (widget.groupValue as List).contains(widget.value);
} else {
return widget.value == widget.groupValue;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(

@ -1,56 +0,0 @@
import 'package:ansu_ui/painters/circle_chart_painter.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class CircleChart extends StatelessWidget {
final double? size;
///
final double aspectRato;
///
final double? underStrokeWidth;
///
final double? aboveStrokeWidth;
///
final Color color;
///
final Widget core;
const CircleChart(
{Key? key,
this.size,
required this.aspectRato,
this.underStrokeWidth,
this.aboveStrokeWidth,
required this.color,
required this.core})
: super(key: key);
double get customSize => size ?? 100.w;
double get customUnderWidth => underStrokeWidth ?? 5.w;
double get customAboveWidth => aboveStrokeWidth ?? 15.w;
@override
Widget build(BuildContext context) {
return SizedBox(
width: customSize,
height: customSize,
child: CustomPaint(
painter: CircleChartPainter(
underStrokeWidth: customUnderWidth,
aboveStrokeWidth: customAboveWidth,
radius: aspectRato,
aboveColor: color),
child: Align(
alignment: Alignment.center,
child: core,
)),
);
}
}

@ -1,60 +0,0 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ASDottedDivider extends StatelessWidget {
final Axis axis;
final List<int>? dash;
final Color? color;
final double? dashWidth;
final double? strokeWidth;
const ASDottedDivider({
required this.axis,
this.dash = const <int>[2, 1],
this.color = const Color(0xFFD8D8D8),
this.dashWidth,
this.strokeWidth,
});
ASDottedDivider.horizontal({
this.dashWidth,
this.strokeWidth,
this.color = const Color(0xFFD8D8D8),
}) : this.axis = Axis.horizontal,
this.dash = const <int>[2, 1];
ASDottedDivider.vertical({
this.dashWidth,
this.strokeWidth,
this.color = const Color(0xFFD8D8D8),
}) : this.axis = Axis.vertical,
this.dash = const <int>[2, 1];
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, boxConstraints) {
final boxWidth = this.axis == Axis.horizontal
? boxConstraints.constrainWidth()
: boxConstraints.constrainHeight();
final _dashWidth = dashWidth ?? 10.w;
final _dashPattern = (1 + dash![1] / dash![0]);
final int count =
(( boxWidth) / (_dashWidth * _dashPattern)).floor();
return Flex(
direction: axis,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
count,
(_) => SizedBox(
width: this.axis == Axis.horizontal
? _dashWidth
: strokeWidth ?? 1.w,
height: this.axis == Axis.horizontal
? strokeWidth ?? 1.w
: _dashWidth,
child:
DecoratedBox(decoration: BoxDecoration(color: color)),
)));
});
}
}

@ -1,9 +0,0 @@
import 'package:ansu_ui/utils/match_text.dart';
import 'package:flutter/material.dart';
extension TextSpanExt on TextSpan {
TextSpan match(String match) {
return MatchText(matchText: match, text: this.text ?? '', style: this.style)
.matchSpan();
}
}

@ -1,25 +1,9 @@
import 'package:ansu_ui/extension/num_extension.dart';
import 'package:ansu_ui/list_tile/as_list_tile.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:ansu_ui/extension/num_extension.dart';
extension SeparateExt on List<Widget> { extension SeparateExt on List<Widget> {
List<Widget> sepWidget({ List<Widget> sepWidget({Widget? separate}) {
Widget? separate,
}) {
if (this.isEmpty) return []; if (this.isEmpty) return [];
this.removeWhere((element) {
if (element.runtimeType == Offstage) {
return (element as Offstage).offstage;
}
if (element.runtimeType == Visibility) {
return !(element as Visibility).visible;
}
if (element.runtimeType == ASListTile) {
return !(element as ASListTile).visible;
}
return false;
});
return List.generate(this.length * 2 - 1, (index) { return List.generate(this.length * 2 - 1, (index) {
if (index.isEven) if (index.isEven)
return this[index ~/ 2]; return this[index ~/ 2];

@ -17,15 +17,12 @@ extension NumExt on num {
BorderRadius get topRadius => BorderRadius.vertical( BorderRadius get topRadius => BorderRadius.vertical(
top: Radius.circular(this.w), top: Radius.circular(this.w),
); );
BorderRadius get bottomRadius => BorderRadius.vertical( BorderRadius get bottomRadius => BorderRadius.vertical(
bottom: Radius.circular(this.w), bottom: Radius.circular(this.w),
); );
BorderRadius get leftRadius => BorderRadius.horizontal( BorderRadius get leftRadius => BorderRadius.horizontal(
left: Radius.circular(this.w), left: Radius.circular(this.w),
); );
BorderRadius get rightRadius => BorderRadius.horizontal( BorderRadius get rightRadius => BorderRadius.horizontal(
right: Radius.circular(this.w), right: Radius.circular(this.w),
); );
@ -60,20 +57,4 @@ extension NumExt on num {
return str; return str;
} }
} }
///0
///
///
String add0(int num) {
var str = this.toString();
if (str.length >= num) {
return str;
} else {
int dif = num - str.length;
for (var i = 0; i < dif; i++) {
str = '0' + str;
}
return str;
}
}
} }

@ -1,6 +1,4 @@
import 'package:ansu_ui/toast/as_toast.dart'; import 'package:ansu_ui/toast/as_toast.dart';
import 'package:ansu_ui/utils/match_text.dart';
import 'package:flutter/material.dart';
extension PhoneExt on String { extension PhoneExt on String {
List get _parsePhone { List get _parsePhone {
@ -36,8 +34,4 @@ extension PhoneExt on String {
get toast { get toast {
ASToast.show(this); ASToast.show(this);
} }
MatchText matchStr(String match, {TextStyle? style}) {
return MatchText(matchText: match, text: this);
}
} }

@ -1,45 +1,11 @@
import 'package:ansu_ui/utils/match_text.dart';
import 'package:auto_size_text_pk/auto_size_text_pk.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'Text_extension.dart';
extension WidgetExt on Widget { extension WidgetExt on Widget {
Widget paddingExt(double horizontal, [double vertical = 0]) => Widget paddingExt(double horizontal, [double vertical = 0]) => Padding(
Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: horizontal, horizontal: horizontal,
vertical: vertical, vertical: vertical,
), ),
child: this, child: this,
); );
Widget match(String match) {
if (this.runtimeType == Text) {
// var spans = (this as Text).textSpan;
// if (spans != null) {
// spans = spans.match(match);
// return Text.rich(spans);
// }
return MatchText(
matchText: match,
text: (this as Text).data ?? '',
style: (this as Text).style,
);
}
if (this.runtimeType == AutoSizeText) {
var spans = (this as AutoSizeText).textSpan;
if (spans != null) {
spans = spans.match(match);
return AutoSizeText.rich(spans);
}
return MatchText(
matchText: match,
text: (this as AutoSizeText).data ?? '',
style: (this as AutoSizeText).style,
);
}
return this;
}
} }

@ -1,9 +1,7 @@
import 'package:ansu_ui/extension/num_extension.dart';
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.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 StatelessWidget { class ASEditTile extends StatelessWidget {
final Widget? title; final Widget? title;
@ -12,14 +10,6 @@ class ASEditTile extends StatelessWidget {
final TextEditingController? controller; final TextEditingController? controller;
final Function(String text)? onChange; final Function(String text)? onChange;
final Function(String text)? onSubmitted; final Function(String text)? onSubmitted;
final List<TextInputFormatter>? inputFormatters;
final TextInputType? keyBoardType;
final TextStyle? hintTextStyle;
final Widget? suffix;
final bool? obscureText;
final String? obscuringCharacter;
final bool enableEdit;
ASEditTile({ ASEditTile({
Key? key, Key? key,
this.title, this.title,
@ -28,21 +18,12 @@ class ASEditTile extends StatelessWidget {
this.prefix, this.prefix,
this.onChange, this.onChange,
this.onSubmitted, this.onSubmitted,
this.inputFormatters,
this.keyBoardType,
this.hintTextStyle,
this.suffix,
this.obscureText,
this.obscuringCharacter,
this.enableEdit = true,
}) : super(key: key); }) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ConstrainedBox( return ConstrainedBox(
constraints: BoxConstraints(minHeight: 46.w), constraints: BoxConstraints(minHeight: 46.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
10.wb, 10.wb,
InkWell( InkWell(
@ -54,19 +35,11 @@ class ASEditTile extends StatelessWidget {
child: title ?? Text(''), child: title ?? Text(''),
), ),
), ),
Offstage( prefix ?? SizedBox(),
offstage: prefix == null,
child: prefix,
),
Expanded( Expanded(
child: TextField( child: TextField(
controller: controller, controller: controller,
enabled: enableEdit,
onChanged: onChange, onChanged: onChange,
inputFormatters: inputFormatters,
keyboardType: keyBoardType,
obscureText: obscureText ?? false,
obscuringCharacter: obscuringCharacter ?? '*',
onSubmitted: onSubmitted, onSubmitted: onSubmitted,
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle( style: TextStyle(
@ -75,23 +48,18 @@ class ASEditTile extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
decoration: InputDecoration( decoration: InputDecoration(
suffix: 10.wb,
border: InputBorder.none, border: InputBorder.none,
isDense: true, isDense: true,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
hintText: '$hintText', hintText: hintText,
hintStyle: hintTextStyle ?? hintStyle: TextStyle(
TextStyle( color: kTextSubColor,
color: kTextSubColor, fontSize: 14.sp,
fontSize: 14.sp, ),
),
), ),
), ),
), ),
Offstage( 10.wb,
offstage: suffix == null,
child: suffix,
)
], ],
), ),
); );

@ -17,10 +17,6 @@ class ASListTile extends StatelessWidget {
/// ///
final CrossAxisAlignment? crossAxisAlignment; final CrossAxisAlignment? crossAxisAlignment;
///
final bool visible;
ASListTile({ ASListTile({
Key? key, Key? key,
this.title, this.title,
@ -28,56 +24,51 @@ class ASListTile extends StatelessWidget {
this.trail, this.trail,
this.height, this.height,
this.crossAxisAlignment, this.crossAxisAlignment,
this.visible = true,
}) : super(key: key); }) : super(key: key);
ASListTile.option({ ASListTile.option({
Key? key, Key? key,
this.title, this.title,
this.text, this.text,
this.trail, this.trail,
this.visible = true,
}) : height = 32.w, }) : height = 32.w,
crossAxisAlignment = CrossAxisAlignment.center, crossAxisAlignment = CrossAxisAlignment.center,
super(key: key); super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Offstage( return Container(
offstage: !visible, margin: height == null
child: Container( ? EdgeInsets.symmetric(vertical: 8.w, horizontal: 10.w)
margin: height == null : EdgeInsets.symmetric(horizontal: 10.w),
? EdgeInsets.symmetric(vertical: 8.w, horizontal: 10.w) height: height,
: EdgeInsets.symmetric(horizontal: 10.w), alignment: Alignment.centerLeft,
height: height, child: Row(
alignment: Alignment.centerLeft, crossAxisAlignment:
child: Row( crossAxisAlignment ?? CrossAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.start, children: [
children: [ Container(
Container( width: 85.w,
width: 85.w, child: Text(
child: Text( title!,
title!, maxLines: 1,
maxLines: 1, overflow: TextOverflow.visible,
overflow: TextOverflow.visible, softWrap: false,
softWrap: false, style: TextStyle(color: kTextColor, fontSize: 14.sp),
style: TextStyle(color: kTextColor, fontSize: 14.sp),
),
),
Expanded(
child: text == null
? Text('')
: text is String
? Text(
text,
maxLines: 2,
style: TextStyle(color: kTextSubColor, fontSize: 14.sp),
)
: text,
), ),
trail ?? SizedBox() ),
], Expanded(
), child: text == null
? Text('')
: text is String
? Text(
text,
maxLines: 2,
style: TextStyle(color: kTextSubColor, fontSize: 14.sp),
)
: text,
),
trail ?? SizedBox()
],
), ),
); );
} }

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:ansu_ui/extension/text_style_extension.dart'; import 'package:ansu_ui/extension/text_style_extension.dart';
import 'package:ansu_ui/extension/num_extension.dart'; import 'package:ansu_ui/extension/num_extension.dart';
///list tile
class ASListTileX extends StatelessWidget { class ASListTileX extends StatelessWidget {
final Widget title; final Widget title;
final Widget? suffix; final Widget? suffix;

@ -1,8 +1,7 @@
import 'package:ansu_ui/divider/as_divider.dart';
import 'package:ansu_ui/extension/list_extension.dart';
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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 ///Tile
class ASOptionTile extends StatelessWidget { class ASOptionTile extends StatelessWidget {
@ -16,7 +15,6 @@ class ASOptionTile extends StatelessWidget {
final EdgeInsetsGeometry? padding; final EdgeInsetsGeometry? padding;
/// ///
///leading!=null items!=null
final dynamic leading; final dynamic leading;
///item 使`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile` ///item 使`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile`
@ -28,36 +26,27 @@ class ASOptionTile extends StatelessWidget {
{Key? key, required this.item, this.padding, this.leading}) {Key? key, required this.item, this.padding, this.leading})
: items = [], : items = [],
super(key: key); super(key: key);
int get length => items!.length; int get length => items!.length;
List<Widget> get _widgets {
var list = <Widget>[];
if (leading == null) {
return list = items ?? [];
} else {
list.add(Container(
alignment: Alignment.centerLeft,
child: leading is String
? Padding(
padding: EdgeInsets.symmetric(vertical: 14.w, horizontal: 10.w),
child: Text(
this.leading,
style: TextStyle(
color: kTextColor,
fontSize: 16.sp,
fontWeight: FontWeight.bold),
),
)
: leading,
));
list.addAll((items ?? []));
return list;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (this.leading != null) {
this.items!.insert(
0,
Container(
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( return Material(
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
color: kForegroundColor, color: kForegroundColor,
@ -69,13 +58,15 @@ class ASOptionTile extends StatelessWidget {
child: item ?? child: item ??
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: _widgets.sepWidget( children: List.generate(length * 2 - 1, (index) {
separate: this.padding == null final displayIndex = index ~/ 2;
? ASDivider( if (index.isEven)
indent: 10.w, return items![displayIndex];
endIndent: 10.w, else
) return this.padding == null
: ASDivider()), ? ASDivider(indent: 10.w, endIndent: 10.w)
: ASDivider();
}),
), ),
)); ));
} }

@ -1,12 +1,12 @@
import 'package:ansu_ui/extension/num_extension.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/extension/num_extension.dart';
class ASOptionTileItem extends StatelessWidget { class ASOptionTileItem extends StatelessWidget {
final Widget? leading; final Widget? leading;
final Widget? title; final Widget? title;
final VoidCallback? onPressed; final onPressed;
const ASOptionTileItem({ const ASOptionTileItem({
Key? key, Key? key,
this.leading, this.leading,

@ -1,37 +0,0 @@
import 'dart:math';
import 'package:flutter/material.dart';
class CircleChartPainter extends CustomPainter {
final double underStrokeWidth;
final double aboveStrokeWidth;
final double radius;
final Color aboveColor;
CircleChartPainter(
{required this.underStrokeWidth,
required this.aboveStrokeWidth,
required this.radius,
required this.aboveColor});
@override
void paint(Canvas canvas, Size size) {
var offset = Offset(size.width / 2, size.height / 2);
var paint = Paint()
..strokeWidth = underStrokeWidth
..style = PaintingStyle.stroke
..color = Color(0xFFCECECE);
canvas.drawCircle(offset, size.width / 2, paint);
paint
..strokeWidth = aboveStrokeWidth
..strokeCap = StrokeCap.round
..color = aboveColor;
var rect = Rect.fromCircle(center: offset, radius: size.width / 2);
canvas.drawArc(rect, -pi / 2, 2 * pi * radius, false, paint);
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return false;
}
}

@ -5,19 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
// //
class _ASDatePickerWidget extends StatefulWidget { class _ASDatePickerWidget extends StatefulWidget {
final CupertinoDatePickerMode mode; _ASDatePickerWidget({Key? key}) : super(key: key);
_ASDatePickerWidget({Key? key})
: mode = CupertinoDatePickerMode.date,
super(key: key);
_ASDatePickerWidget.time({Key? key})
: mode = CupertinoDatePickerMode.time,
super(key: key);
_ASDatePickerWidget.dateAndTime({Key? key})
: mode = CupertinoDatePickerMode.dateAndTime,
super(key: key);
@override @override
_ASDatePickerWidgetState createState() => _ASDatePickerWidgetState(); _ASDatePickerWidgetState createState() => _ASDatePickerWidgetState();
@ -25,7 +13,6 @@ class _ASDatePickerWidget extends StatefulWidget {
class _ASDatePickerWidgetState extends State<_ASDatePickerWidget> { class _ASDatePickerWidgetState extends State<_ASDatePickerWidget> {
DateTime? _dateTime; DateTime? _dateTime;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -42,10 +29,11 @@ class _ASDatePickerWidgetState extends State<_ASDatePickerWidget> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 18.w), padding: EdgeInsets.symmetric(horizontal: 18.w),
child: CupertinoDatePicker( child: CupertinoDatePicker(
onDateTimeChanged: (dateTime) { onDateTimeChanged: (dateTime) {
_dateTime = dateTime; _dateTime = dateTime;
}, },
mode: widget.mode), mode: CupertinoDatePickerMode.date,
),
), ),
); );
} }
@ -69,7 +57,7 @@ class _ASDatePickerWidgetState extends State<_ASDatePickerWidget> {
///```dart ///```dart
///Navigator.pop(context,dateTime) ///Navigator.pop(context,dateTime)
///``` ///```
Future<DateTime?> showAsDatePicker(BuildContext context) async { Future<DateTime?> asDatePicker(BuildContext context) async {
return await showModalBottomSheet( return await showModalBottomSheet(
context: context, context: context,
builder: (context) { builder: (context) {
@ -77,21 +65,3 @@ Future<DateTime?> showAsDatePicker(BuildContext context) async {
}, },
); );
} }
Future<DateTime?> showAsTimePicker(BuildContext context) async {
return await showModalBottomSheet(
context: context,
builder: (context) {
return _ASDatePickerWidget.time();
},
);
}
Future<DateTime?> showAsDateAndTimePicker(BuildContext context) async {
return await showModalBottomSheet(
context: context,
builder: (context) {
return _ASDatePickerWidget.dateAndTime();
},
);
}

@ -3,22 +3,22 @@ import 'package:ansu_ui/pickers/as_two_date_picker.dart';
class RangeDate { class RangeDate {
DateTime? start; DateTime? start;
DateTime end; DateTime? end;
RangeDate({ RangeDate({
this.start, this.start,
required this.end, this.end,
}); });
} }
/// start null ///`bool``true`,
/// ///
/// ///`RangeDate`
Future<RangeDate> show2DatePicker(BuildContext context, Future<dynamic> show2DatePicker(BuildContext context,
{ RangeDate? date}) async { {bool? isAnHour, RangeDate? date}) async {
return await showModalBottomSheet( return await showModalBottomSheet(
context: context, context: context,
builder: (context) { builder: (context) {
return AS2DatePicker( date: date); return AS2DatePicker(isAnHour: isAnHour, date: date);
}, },
); );
} }

@ -8,8 +8,9 @@ import 'package:ansu_ui/buttons/as_long_button.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class AS2DatePicker extends StatefulWidget { class AS2DatePicker extends StatefulWidget {
final bool? isAnHour;
final RangeDate? date; final RangeDate? date;
AS2DatePicker({Key? key, this.date}) : super(key: key); AS2DatePicker({Key? key, this.isAnHour, this.date}) : super(key: key);
@override @override
_AS2DatePickerState createState() => _AS2DatePickerState(); _AS2DatePickerState createState() => _AS2DatePickerState();
@ -27,6 +28,7 @@ class _AS2DatePickerState extends State<AS2DatePicker> {
end: now.add(Duration(hours: 1)), end: now.add(Duration(hours: 1)),
); );
bool _inAnHour = false;
Widget _buildDayButton(int index, String title) { Widget _buildDayButton(int index, String title) {
bool sameDay = _selectedDay == index; bool sameDay = _selectedDay == index;
return MaterialButton( return MaterialButton(
@ -103,14 +105,17 @@ class _AS2DatePickerState extends State<AS2DatePicker> {
return _renderButton( return _renderButton(
'一小时内', '一小时内',
() { () {
_inAnHour = true;
setState(() => {_selectedDate = now}); setState(() => {_selectedDate = now});
}, },
sameItem, sameItem,
); );
} }
_inAnHour = false;
return _renderButton( return _renderButton(
'${startHour + index}:00-${startHour + index + 1}:00', '${startHour + index}:00-${startHour + index + 1}:00',
() { () {
_inAnHour = false;
setState(() => _selectedDate = DateTime( setState(() => _selectedDate = DateTime(
now.year, now.year,
now.month, now.month,
@ -134,6 +139,7 @@ class _AS2DatePickerState extends State<AS2DatePicker> {
return _renderButton( return _renderButton(
'$index\:00-${index + 1}:00', '$index\:00-${index + 1}:00',
() { () {
_inAnHour = false;
setState(() => _selectedDate = DateTime( setState(() => _selectedDate = DateTime(
now.year, now.year,
now.month, now.month,
@ -152,6 +158,8 @@ class _AS2DatePickerState extends State<AS2DatePicker> {
void initState() { void initState() {
super.initState(); super.initState();
_pageController = PageController(); _pageController = PageController();
_selectedDate = now;
_inAnHour = widget.isAnHour ?? true;
_selectedDate = widget.date?.start ?? now; _selectedDate = widget.date?.start ?? now;
} }
@ -205,17 +213,8 @@ class _AS2DatePickerState extends State<AS2DatePicker> {
child: ASLongButton.solid( child: ASLongButton.solid(
title: '确认', title: '确认',
onPressed: () { onPressed: () {
if (_selectedDate!.hour==now.hour) if (_inAnHour)
Navigator.pop( Navigator.pop(context, true);
context,
RangeDate(
start: null,
end: DateTime(
_selectedDate!.year,
_selectedDate!.month,
_selectedDate!.day,
_selectedDate!.hour + 1),
));
else else
Navigator.pop( Navigator.pop(
context, context,

@ -5,11 +5,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
class ASCheckTag extends StatelessWidget { class ASCheckTag extends StatelessWidget {
final bool checked; final bool checked;
final Widget? text; final Widget text;
const ASCheckTag({ const ASCheckTag({
Key? key, Key? key,
this.checked = false, this.checked = false,
this.text, required this.text,
}) : super(key: key); }) : super(key: key);
@override @override
@ -39,16 +39,15 @@ class ASCheckTag extends StatelessWidget {
), ),
), ),
), ),
if (text != null) 6.wb, 6.wb,
if (text != null) AnimatedDefaultTextStyle(
AnimatedDefaultTextStyle( duration: Duration(milliseconds: 300),
duration: Duration(milliseconds: 300), curve: Curves.easeInOutCubic,
curve: Curves.easeInOutCubic, style: TextStyle(
style: TextStyle( color: checked ? Color(0xFF00BF44) : Color(0xFFFF0000),
color: checked ? Color(0xFF00BF44) : Color(0xFFFF0000),
),
child: text!,
), ),
child: text,
),
], ],
); );
} }

@ -1,7 +1,7 @@
import 'package:ansu_ui/extension/num_extension.dart';
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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 ASTag extends StatelessWidget { class ASTag extends StatelessWidget {
/// ///
@ -135,7 +135,6 @@ class ASTag extends StatelessWidget {
style: textStyle ?? style: textStyle ??
TextStyle( TextStyle(
color: textColor, color: textColor,
height: 1,
fontSize: 10.sp, fontSize: 10.sp,
), ),
), ),

@ -1,6 +1,6 @@
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:ansu_ui/styles/as_colors.dart';
///TextFiled ///TextFiled
class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget { class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
@ -14,8 +14,6 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
this.margin, this.margin,
this.onPressed, this.onPressed,
this.height, this.height,
this.prefix,
this.suffix,
}) : button = false, }) : button = false,
super(key: key); super(key: key);
@ -30,8 +28,6 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
this.margin, this.margin,
this.onPressed, this.onPressed,
this.height, this.height,
this.prefix,
this.suffix,
}) : button = true, }) : button = true,
super(key: key); super(key: key);
@ -61,12 +57,6 @@ class ASSearchTextField extends StatefulWidget implements PreferredSizeWidget {
/// ///
final double? height; final double? height;
///
final Widget? prefix;
/// widget button
final Widget? suffix;
@override @override
_ASSearchTextFieldState createState() => _ASSearchTextFieldState(); _ASSearchTextFieldState createState() => _ASSearchTextFieldState();
@ -147,35 +137,28 @@ class _ASSearchTextFieldState extends State<ASSearchTextField> {
cursorColor: kPrimaryColor, cursorColor: kPrimaryColor,
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
decoration: InputDecoration( decoration: InputDecoration(
fillColor: Color(0xFFF8F8F8), fillColor: Color(0xFFF8F8F8),
filled: true, filled: true,
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
color: kTextSubColor, color: kTextSubColor,
fontSize: 14.sp, fontSize: 14.sp,
), ),
border: _border, border: _border,
enabledBorder: _border, enabledBorder: _border,
focusedBorder: _border, focusedBorder: _border,
focusedErrorBorder: _border, focusedErrorBorder: _border,
prefixIcon: Padding( prefixIcon: Padding(
padding: EdgeInsets.only(left: 13.w, right: 8.w), padding: EdgeInsets.only(left: 13.w, right: 8.w),
child: Row( child: Icon(
mainAxisSize: MainAxisSize.min, Icons.search,
children: [ size: 16.w,
Icon( color: Colors.black,
Icons.search,
size: 16.w,
color: Colors.black,
),
widget.prefix ?? SizedBox(),
],
),
), ),
prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0), ),
contentPadding: EdgeInsets.zero, prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0),
suffixIcon: widget.suffix, contentPadding: EdgeInsets.zero,
suffixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0)), ),
), ),
); );
} }

@ -1,98 +0,0 @@
import 'dart:io';
import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class AsGridImageView extends StatelessWidget {
final List<File>? files;
final List<String>? nets;
final String? placeholder;
final void Function(dynamic value)? onDelete;
final double? iconSize;
const AsGridImageView.fromFile({Key? key,
required this.files,
this.placeholder,
this.onDelete,
this.iconSize})
: nets = null,
super(key: key);
const AsGridImageView.fromNets({Key? key,
required this.nets,
this.placeholder,
this.onDelete,
this.iconSize})
: files = null,
super(key: key);
@override
Widget build(BuildContext context) {
var size = iconSize ?? 16.w;
return GridView(
padding: EdgeInsets.all(10.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisSpacing: 10.w,
crossAxisSpacing: 10.w,
),
shrinkWrap: true,
children: files == null
? nets!
.map((e) =>
GestureDetector(
onTap: () =>
PhotoViewer.fromNet(
context,
tag: e,
net: e,
),
child: Stack(
children: [
Hero(
tag: e,
child: FadeInImage.assetNetwork(
placeholder: placeholder ?? '', image: e),
),
if(onDelete != null) Positioned(
top: size / 2,
right: size / 2,
child: GestureDetector(
onTap: () {
onDelete!(e);
},
child: Icon(
CupertinoIcons.xmark_circle_fill,
color: Colors.black45,
),
))
],
),
))
.toList()
: files!
.map((e) =>
Stack(children: [
if(onDelete != null) Positioned(
top: 0,
right: 0,
child: GestureDetector(
onTap: () {
onDelete!(e);
},
child: Icon(
CupertinoIcons.xmark_circle_fill,
color: Colors.black45,
),
)),
GestureDetector(
onTap: () =>
PhotoViewer.fromFile(context,
tag: e.path, file: e),
child: Hero(tag: e.path, child: Image.file(e)))
]))
.toList());
}
}

@ -1,20 +1,20 @@
import 'dart:io'; import 'dart:io';
import 'dart:ui'; import 'dart:ui';
import 'package:ansu_ui/divider/as_divider.dart';
import 'package:ansu_ui/extension/list_extension.dart';
import 'package:ansu_ui/scaffold/as_scaffold.dart';
import 'package:ansu_ui/styles/as_colors.dart';
import 'package:ansu_ui/utils/camera_util.dart';
import 'package:ansu_ui/utils/photo_viewer.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.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/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';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class CameraView extends StatefulWidget { class CameraView extends StatefulWidget {
final File? file; final File? file;
final String? title; final String? title;
CameraView({Key? key, this.file, this.title}) : super(key: key); CameraView({Key? key, this.file, this.title}) : super(key: key);
@override @override
@ -41,8 +41,7 @@ class _CameraViewState extends State<CameraView> {
alignment: Alignment.center, alignment: Alignment.center,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
PhotoViewer.fromFile(context, toPhotoViewer(context, tag: widget.title, file: widget.file);
tag: widget.title ?? '', file: widget.file!);
}, },
child: Hero( child: Hero(
child: Image.file( child: Image.file(

@ -1,41 +0,0 @@
import 'package:ansu_ui/ansu_ui.dart';
import 'package:flutter/material.dart';
class MatchText extends StatelessWidget {
final String matchText;
final String text;
final TextStyle? style;
const MatchText({
Key? key,
required this.matchText,
required this.text,
this.style,
}) : super(key: key);
TextSpan matchSpan() {
return TextSpan(children: getSpans());
}
List<TextSpan> getSpans() {
var textStyle = style ?? TextStyle(color: kTextColor, fontSize: 14.sp);
if (matchText.isEmpty) {
return [TextSpan(text: text, style: textStyle)];
}
List<TextSpan> allSpan = text
.replaceAllMapped(matchText, (Match mt) => '\r${mt[0]}\r')
.split('\r')
.map<TextSpan>(
(e) => (matchText.matchAsPrefix(e) == null || e.length == text.length)
? TextSpan(text: e, style: textStyle)
: TextSpan(text: e, style: textStyle.copyWith(color: Colors.red)),
)
.toList();
return allSpan;
}
@override
Widget build(BuildContext context) {
return RichText(text: TextSpan(children: getSpans()));
}
}

@ -1,118 +1,30 @@
import 'dart:io'; import 'dart:io';
import 'package:ansu_ui/extension/num_extension.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:ansu_ui/extension/num_extension.dart';
class PhotoViewer extends StatefulWidget { class PhotoViewer extends StatefulWidget {
final File? file; final File? file;
final String? net; final String? tag;
final String tag; PhotoViewer({Key? key, this.file, this.tag}) : super(key: key);
static fromFile(BuildContext context,
{required String tag, required File file}) {
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation, secondAnimation) {
return PhotoViewer.toFile(file: file, tag: tag);
},
opaque: false,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(opacity: animation, child: child);
},
),
);
}
static fromNet(BuildContext context,
{required String tag, required String net}) {
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation, secondAnimation) {
return PhotoViewer.toNet(net: net, tag: tag);
},
opaque: false,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(opacity: animation, child: child);
},
),
);
}
PhotoViewer.toFile({
Key? key,
this.file,
required this.tag,
}) : net = null,
super(key: key);
PhotoViewer.toNet({Key? key, required this.tag, this.net})
: file = null,
super(key: key);
@override @override
_PhotoViewerState createState() => _PhotoViewerState(); _PhotoViewerState createState() => _PhotoViewerState();
} }
class _PhotoViewerState extends State<PhotoViewer> class _PhotoViewerState extends State<PhotoViewer> {
with SingleTickerProviderStateMixin {
TransformationController _controller = TransformationController();
Animation? _animationReset;
late AnimationController _controllerReset;
void reset() {
_controllerReset.reset();
_animationReset = Matrix4Tween(
begin: _controller.value,
end: Matrix4.identity(),
).animate(_controllerReset);
_animationReset!.addListener(_onAnimateReset);
_controllerReset.forward();
}
void _onAnimateReset() {
_controller.value = _animationReset!.value;
if (!_controllerReset.isAnimating) {
_animationReset?.removeListener(_onAnimateReset);
_animationReset = null;
_controllerReset.reset();
}
}
@override
void initState() {
_controllerReset =
AnimationController(vsync: this, duration: Duration(milliseconds: 400));
super.initState();
}
@override
void dispose() {
_controllerReset.dispose();
_controller.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return Scaffold(
onTap: () => Navigator.pop(context), backgroundColor: Colors.black54,
onDoubleTap: () => reset(), body: GestureDetector(
child: Scaffold( onTap: () => Navigator.pop(context),
backgroundColor: Colors.black54, child: Center(
body: InteractiveViewer( child: InteractiveViewer(
transformationController: _controller, boundaryMargin: 100.edge,
boundaryMargin: 100.edge,
child: Container(
width: double.infinity,
height: double.infinity,
alignment: Alignment.center,
child: Hero( child: Hero(
tag: widget.tag, tag: widget.tag!,
child: widget.file != null child: Image.file(widget.file!),
? Image.file(widget.file!)
: Image.network(widget.net!),
), ),
), ),
), ),
@ -120,3 +32,18 @@ class _PhotoViewerState extends State<PhotoViewer>
); );
} }
} }
toPhotoViewer(BuildContext context, {String? tag, File? file}) {
Navigator.push(
context,
PageRouteBuilder(
pageBuilder: (context, animation, secondAnimation) {
return PhotoViewer(file: file, tag: tag);
},
opaque: false,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(opacity: animation, child: child);
},
),
);
}

@ -7,84 +7,84 @@ packages:
path: "." path: "."
ref: HEAD ref: HEAD
resolved-ref: d724abf91595f58ed58f6c722ebe60acdb750c67 resolved-ref: d724abf91595f58ed58f6c722ebe60acdb750c67
url: "https://git.oa00.com/flutter_pub/animated_collection.git" url: "http://159.75.73.143:8080/laiiihz/animated_collection.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
animator:
dependency: transitive
description:
name: animator
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.0.0"
async: async:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.8.2" version: "2.5.0"
auto_size_text_pk: auto_size_text_pk:
dependency: "direct main" dependency: transitive
description: description:
name: auto_size_text_pk name: auto_size_text_pk
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
bot_toast: bot_toast:
dependency: "direct main" dependency: "direct main"
description: description:
name: bot_toast name: bot_toast
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.3" version: "4.0.1"
characters: characters:
dependency: transitive dependency: transitive
description: description:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.1.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.15.0"
cross_file:
dependency: transitive
description:
name: cross_file
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.3+2"
expandable: expandable:
dependency: "direct main" dependency: "direct main"
description: description:
name: expandable name: expandable
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.0.1" version: "5.0.1"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
flutter: flutter:
@ -96,23 +96,23 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_easyrefresh name: flutter_easyrefresh
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.2" version: "2.2.1"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
name: flutter_plugin_android_lifecycle name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.7" version: "2.0.1"
flutter_screenutil: flutter_screenutil:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_screenutil name: flutter_screenutil
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.5.4" version: "5.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -127,93 +127,100 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: get name: get
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.6.5" version: "4.1.4"
http: http:
dependency: transitive dependency: transitive
description: description:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.13.5" version: "0.13.1"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "4.0.1" version: "4.0.0"
image_picker: image_picker:
dependency: "direct main" dependency: "direct main"
description: description:
name: image_picker name: image_picker
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.7.5+4" version: "0.7.4"
image_picker_for_web: image_picker_for_web:
dependency: transitive dependency: transitive
description: description:
name: image_picker_for_web name: image_picker_for_web
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.8" version: "2.0.0"
image_picker_platform_interface: image_picker_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: image_picker_platform_interface name: image_picker_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.6.1" version: "2.0.1"
intl: intl:
dependency: transitive dependency: transitive
description: description:
name: intl name: intl
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.17.0" version: "0.17.0"
js: js:
dependency: transitive dependency: transitive
description: description:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.6.3" version: "0.6.3"
lpinyin: lpinyin:
dependency: "direct main" dependency: "direct main"
description: description:
name: lpinyin name: lpinyin
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.3" version: "2.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.11" version: "0.12.10"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.7.0" version: "1.3.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.0"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.11.0"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.3" version: "2.0.0"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -223,72 +230,79 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.10.0" version: "1.10.0"
states_rebuilder:
dependency: transitive
description:
name: states_rebuilder
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0+1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.0" version: "2.1.0"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.3" version: "0.2.19"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.0"
velocity_x: velocity_x:
dependency: "direct main" dependency: "direct main"
description: description:
name: velocity_x name: velocity_x
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "3.5.1" version: "2.6.1"
vxstate: vxstate:
dependency: transitive dependency: transitive
description: description:
name: vxstate name: vxstate
url: "https://pub.dartlang.org" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.2.0" version: "2.0.1"
sdks: sdks:
dart: ">=2.15.0 <3.0.0" dart: ">=2.12.0 <3.0.0"
flutter: ">=2.8.0" flutter: ">=2.0.0"

@ -1,8 +1,7 @@
name: ansu_ui name: ansu_ui
description: A new Flutter package. description: A new Flutter package.
version: 1.0.0 version: 0.0.4
author: author:
publish_to: none
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
@ -16,12 +15,11 @@ dependencies:
lpinyin: ^2.0.1 lpinyin: ^2.0.1
image_picker: ^0.7.2 image_picker: ^0.7.2
bot_toast: ^4.0.0+1 bot_toast: ^4.0.0+1
velocity_x: ^3.3.0 velocity_x: ^2.6.1
auto_size_text_pk: ^3.0.0
expandable: ^5.0.1 expandable: ^5.0.1
animated_collection: animated_collection:
git: git:
url: https://git.oa00.com/flutter_pub/animated_collection.git url: http://159.75.73.143:8080/laiiihz/animated_collection.git
get: ^4.1.3 get: ^4.1.3
dev_dependencies: dev_dependencies:

Loading…
Cancel
Save