action method
Expanded
action(
- String text, {
- BuildContext? context,
- TextStyle? style,
- Color? color,
- void onTap()?,
Builds a single action button (confirm or cancel) with optional style, color, and onTap callback.
Implementation
Expanded action(
String text, {
BuildContext? context,
TextStyle? style,
Color? color,
void Function()? onTap,
}) {
return Expanded(
child: InkWell(
onTap: () {
// Close the dialog first
context?.back();
onTap?.call();
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 14,
).copyWith(bottom: 16),
decoration: BoxDecoration(
border: Border(top: BorderSide(color: Colors.grey.shade100)),
),
child: Center(
child: Text(
text,
).styled(TS.col(color ?? black).size(15).w600.hgt(1).merge(style)),
),
),
),
);
}