diff --git a/lib/src/widgets/bottom_sheet/cake_pay_transaction_sent_bottom_sheet.dart b/lib/src/widgets/bottom_sheet/cake_pay_transaction_sent_bottom_sheet.dart index 358ad93d8..da91926b2 100644 --- a/lib/src/widgets/bottom_sheet/cake_pay_transaction_sent_bottom_sheet.dart +++ b/lib/src/widgets/bottom_sheet/cake_pay_transaction_sent_bottom_sheet.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; +import 'package:cake_wallet/src/widgets/rounded_icon_button.dart'; import 'package:cake_wallet/utils/image_utill.dart'; import 'package:cake_wallet/view_model/send/output.dart'; import 'package:cw_core/crypto_currency.dart'; @@ -312,41 +313,3 @@ class _StandardTile extends StatelessWidget { ); } } - -class RoundedIconButton extends StatelessWidget { - const RoundedIconButton({this.icon, - this.iconWidget, - required this.onPressed, - this.shape, - this.width, - this.height, - this.iconSize, - this.fillColor}); - - final IconData? icon; - final Widget? iconWidget; - final VoidCallback onPressed; - final ShapeBorder? shape; - final double? width; - final double? height; - final double? iconSize; - final Color? fillColor; - - @override - Widget build(BuildContext context) { - final colorScheme = Theme - .of(context) - .colorScheme; - return RawMaterialButton( - onPressed: onPressed, - fillColor: fillColor ?? colorScheme.surfaceContainerHighest, - elevation: 0, - constraints: BoxConstraints.tightFor(width: width ?? 30, height: height ?? 30), - padding: EdgeInsets.zero, - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - shape: shape ?? const CircleBorder(), - child: icon != null - ? Icon(icon, size: iconSize ?? 14, color: colorScheme.onSurface) - : iconWidget); - } -} diff --git a/lib/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart b/lib/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart index e71cd76af..c5c59d80e 100644 --- a/lib/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart +++ b/lib/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/src/widgets/rounded_icon_button.dart'; import 'package:cake_wallet/src/widgets/standard_slide_button_widget.dart'; import 'package:cake_wallet/themes/core/material_base_theme.dart'; import 'package:cake_wallet/themes/utils/custom_theme_colors.dart'; @@ -508,40 +509,3 @@ class ExpansionAddressTile extends StatelessWidget { ); } } - -class RoundedIconButton extends StatelessWidget { - const RoundedIconButton( - {this.icon, - this.iconWidget, - required this.onPressed, - this.shape, - this.width, - this.height, - this.iconSize, - this.fillColor}); - - final IconData? icon; - final Widget? iconWidget; - final VoidCallback onPressed; - final ShapeBorder? shape; - final double? width; - final double? height; - final double? iconSize; - final Color? fillColor; - - @override - Widget build(BuildContext context) { - final colorScheme = Theme.of(context).colorScheme; - return RawMaterialButton( - onPressed: onPressed, - fillColor: fillColor ?? colorScheme.surfaceContainerHighest, - elevation: 0, - constraints: BoxConstraints.tightFor(width: width ?? 30, height: height ?? 30), - padding: EdgeInsets.zero, - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - shape: shape ?? const CircleBorder(), - child: icon != null - ? Icon(icon, size: iconSize ?? 14, color: colorScheme.onSurface) - : iconWidget); - } -} diff --git a/lib/src/widgets/rounded_icon_button.dart b/lib/src/widgets/rounded_icon_button.dart new file mode 100644 index 000000000..72d5491f3 --- /dev/null +++ b/lib/src/widgets/rounded_icon_button.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; + +class RoundedIconButton extends StatelessWidget { + const RoundedIconButton( + {this.icon, + this.iconWidget, + required this.onPressed, + this.shape, + this.width, + this.height, + this.iconSize, + this.fillColor}); + + final IconData? icon; + final Widget? iconWidget; + final VoidCallback onPressed; + final ShapeBorder? shape; + final double? width; + final double? height; + final double? iconSize; + final Color? fillColor; + + @override + Widget build(BuildContext context) { + final colorScheme = Theme.of(context).colorScheme; + return RawMaterialButton( + onPressed: onPressed, + fillColor: fillColor ?? colorScheme.surfaceContainerHighest, + elevation: 0, + constraints: BoxConstraints.tightFor(width: width ?? 30, height: height ?? 30), + padding: EdgeInsets.zero, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: shape ?? const CircleBorder(), + child: icon != null + ? Icon(icon, size: iconSize ?? 14, color: colorScheme.onSurface) + : iconWidget); + } +}