组件优化

This commit is contained in:
2022-10-31 16:12:06 +08:00
parent b7f0fe3ac8
commit 5d8dca73d1
12 changed files with 252 additions and 262 deletions

View File

@@ -5,10 +5,14 @@ class ActionButton extends StatelessWidget {
final String text;
final Color color;
final VoidCallback? onTap;
final bool hasTop;
final bool hasBottom;
const ActionButton(
this.text, {
this.color = AppColors.red,
this.color = AppColors.primary,
this.onTap,
this.hasTop = false,
this.hasBottom = false,
Key? key,
}) : super(key: key);
@@ -19,20 +23,35 @@ class ActionButton extends StatelessWidget {
onTap: () {
onTap?.call();
},
child: Container(
color: AppColors.white,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: Text(
text,
style: TextStyle(
fontWeight: FontWeight.w500,
color: color,
child: Column(
children: [
if (hasTop)
const Divider(
height: 0,
color: AppColors.border,
),
Container(
color: AppColors.white,
child: Padding(
padding: const EdgeInsets.all(14.0),
child: Center(
child: Text(
text,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: color,
),
),
),
),
),
),
if (hasBottom)
const Divider(
height: 0,
color: AppColors.border,
),
],
),
);
}