Skip to content

Commit

Permalink
ui: icon added in button
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisamank committed Jul 26, 2022
1 parent 06723a5 commit 45bf29a
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/ui/common/shh_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ class ShhButton extends StatelessWidget {
required this.text,
this.width,
this.height,
this.icon,
Key? key,
}) : super(key: key);

final Function() onPressed;
final String text;
final double? width;
final double? height;
final Icon? icon;

@override
Widget build(BuildContext context) {
return MaterialButton(
Expand All @@ -26,9 +29,16 @@ class ShhButton extends StatelessWidget {
),
color: AppColors.white,
onPressed: onPressed,
child: Text(
text,
style: AppTextStyles.p3,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (icon != null) icon!,
if (icon != null) hSizedBox2,
Text(
text,
style: AppTextStyles.p3,
),
],
),
);
}
Expand Down

0 comments on commit 45bf29a

Please sign in to comment.