diff --git a/lib/ansu_ui.dart b/lib/ansu_ui.dart index f521ff1..29d0efd 100644 --- a/lib/ansu_ui.dart +++ b/lib/ansu_ui.dart @@ -12,6 +12,7 @@ export 'buttons/as_numeric_button.dart'; export 'buttons/as_bottom_button.dart'; export 'buttons/as_gradientbutton.dart'; export 'buttons/as_radio_button.dart'; +export 'buttons/as_material_button.dart'; //scaffold export 'scaffold/as_scaffold.dart'; @@ -42,6 +43,7 @@ export 'list_tile/as_option_tile.dart'; export 'list_tile/as_edit_tile.dart'; export 'list_tile/as_option_tile_item.dart'; export 'list_tile/as_vertical_tile_item.dart'; +export 'list_tile/as_list_tile_x.dart'; export 'refresh/as_refresh.dart'; diff --git a/lib/buttons/as_button.dart b/lib/buttons/as_button.dart index e0186e0..08dce3c 100644 --- a/lib/buttons/as_button.dart +++ b/lib/buttons/as_button.dart @@ -163,11 +163,17 @@ class _ASButtonState extends State { : widget.title, padding: widget.padding ?? EdgeInsets.symmetric(vertical: 6.w, horizontal: 12.w), - shape: RoundedRectangleBorder( - side: widget.outline - ? BorderSide(color: widget.outlineColor, width: 0.5.w) - : BorderSide.none, - borderRadius: BorderRadius.circular(widget.radius ?? 15.5.w)), + shape: widget.radius == null + ? StadiumBorder( + side: widget.outline + ? BorderSide(color: widget.outlineColor, width: 0.5.w) + : BorderSide.none, + ) + : RoundedRectangleBorder( + side: widget.outline + ? BorderSide(color: widget.outlineColor, width: 0.5.w) + : BorderSide.none, + borderRadius: BorderRadius.circular(widget.radius ?? 15.5.w)), color: widget.bgcolor ?? kForegroundColor, splashColor: widget.splashColor, highlightColor: widget.splashColor?.withOpacity(0.3), diff --git a/lib/buttons/as_material_button.dart b/lib/buttons/as_material_button.dart new file mode 100644 index 0000000..9a20e15 --- /dev/null +++ b/lib/buttons/as_material_button.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; + +class ASMaterialButton extends StatelessWidget { + final VoidCallback onPressed; + final double height; + final Widget icon; + final double radius; + final Widget child; + + const ASMaterialButton( + {Key key, + this.onPressed, + this.height, + this.icon, + this.child, + this.radius}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialButton( + onPressed: onPressed, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: 0.edge, + minWidth: 0, + height: height ?? 46.w, + child: icon == null + ? child + : Row( + children: [ + child, + 4.wb, + icon, + ], + ), + shape: RoundedRectangleBorder( + borderRadius: radius.radius, + ), + ); + } +} diff --git a/lib/list_tile/as_list_tile_x.dart b/lib/list_tile/as_list_tile_x.dart new file mode 100644 index 0000000..3738a97 --- /dev/null +++ b/lib/list_tile/as_list_tile_x.dart @@ -0,0 +1,30 @@ +import 'package:flutter/material.dart'; +import 'package:ansu_ui/extension/text_style_extension.dart'; +import 'package:ansu_ui/extension/num_extension.dart'; + +class ASListTileX extends StatelessWidget { + final Widget title; + final Widget suffix; + final double height; + const ASListTileX({ + Key key, + @required this.title, + this.suffix, + this.height, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Row( + children: [ + DefaultTextStyle( + style: TextStyle().black65.size(14), + child: title, + ), + Spacer(), + (height ?? 46).hb, + suffix ?? SizedBox(), + ], + ); + } +}