deleteButton static method

Widget deleteButton(
  1. BuildContext context, {
  2. String? label,
  3. SvgData? icon,
  4. Key? key,
})

Returns the delete styled OutlinedRoundedButton.

Implementation

static Widget deleteButton(
  BuildContext context, {
  String? label,
  SvgData? icon,
  Key? key,
}) {
  final style = Theme.of(context).style;

  return Stack(
    children: [
      OutlinedRoundedButton(
        key: key,
        maxWidth: double.infinity,
        onPressed: () => Navigator.of(context).pop(true),
        color: style.colors.danger,
        child: Text(
          label ?? 'btn_delete'.l10n,
          overflow: TextOverflow.ellipsis,
          maxLines: 1,
          style: style.fonts.normal.regular.onPrimary,
        ),
      ),
      Positioned(
        top: 0,
        bottom: 0,
        left: 16,
        child: IgnorePointer(child: SvgIcon(icon ?? SvgIcons.delete19White)),
      ),
    ],
  );
}