defaultButton static method
- BuildContext context, {
- String? label,
- SvgData? icon,
- Key? key,
Returns the proceed button, which invokes NavigatorState.pop.
Implementation
static Widget defaultButton(
BuildContext context, {
String? label,
SvgData? icon,
Key? key,
}) {
final button = PrimaryButton(
key: key ?? const Key('Proceed'),
onPressed: () => Navigator.of(context).pop(true),
title: label ?? 'btn_proceed'.l10n,
);
if (icon != null) {
return Stack(
children: [
button,
Positioned(
top: 0,
bottom: 0,
left: 16,
child: IgnorePointer(child: SvgIcon(icon)),
),
],
);
}
return button;
}