parent
6f86eadf90
commit
c161a22c17
@ -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…
Reference in new issue