add as MaterialButton , asListTileX

null_safety
小赖 4 years ago
parent 6f86eadf90
commit c161a22c17

@ -12,6 +12,7 @@ export 'buttons/as_numeric_button.dart';
export 'buttons/as_bottom_button.dart'; export 'buttons/as_bottom_button.dart';
export 'buttons/as_gradientbutton.dart'; export 'buttons/as_gradientbutton.dart';
export 'buttons/as_radio_button.dart'; export 'buttons/as_radio_button.dart';
export 'buttons/as_material_button.dart';
//scaffold //scaffold
export 'scaffold/as_scaffold.dart'; 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_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 'list_tile/as_list_tile_x.dart';
export 'refresh/as_refresh.dart'; export 'refresh/as_refresh.dart';

@ -163,11 +163,17 @@ class _ASButtonState extends State<ASButton> {
: widget.title, : widget.title,
padding: widget.padding ?? padding: widget.padding ??
EdgeInsets.symmetric(vertical: 6.w, horizontal: 12.w), EdgeInsets.symmetric(vertical: 6.w, horizontal: 12.w),
shape: RoundedRectangleBorder( shape: widget.radius == null
side: widget.outline ? StadiumBorder(
? BorderSide(color: widget.outlineColor, width: 0.5.w) side: widget.outline
: BorderSide.none, ? BorderSide(color: widget.outlineColor, width: 0.5.w)
borderRadius: BorderRadius.circular(widget.radius ?? 15.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, color: widget.bgcolor ?? kForegroundColor,
splashColor: widget.splashColor, splashColor: widget.splashColor,
highlightColor: widget.splashColor?.withOpacity(0.3), highlightColor: widget.splashColor?.withOpacity(0.3),

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

@ -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(),
],
);
}
}
Loading…
Cancel
Save