From 5b762c09554101173f94d3a5c483d27d958315b1 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 21 Apr 2021 22:09:15 +0300 Subject: [PATCH] Update flat button --- lib/ui/app/buttons/app_text_button.dart | 38 +++++++++++++------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/lib/ui/app/buttons/app_text_button.dart b/lib/ui/app/buttons/app_text_button.dart index 137be54f3..afe29c451 100644 --- a/lib/ui/app/buttons/app_text_button.dart +++ b/lib/ui/app/buttons/app_text_button.dart @@ -20,25 +20,27 @@ class AppTextButton extends StatelessWidget { final store = StoreProvider.of(context); final state = store.state; - return TextButton( - onPressed: onPressed, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 12), - child: Text( - label, - style: TextStyle( - color: onPressed == null - ? null - : color != null - ? color - : isInHeader - ? state.headerTextColor - : state.prefState.enableDarkMode - ? Colors.white - : Colors.black, - ), - ), + final ButtonStyle flatButtonStyle = TextButton.styleFrom( + primary: onPressed == null + ? null + : color != null + ? color + : isInHeader + ? state.headerTextColor + : state.prefState.enableDarkMode + ? Colors.white + : Colors.black87, + minimumSize: Size(88, 36), + padding: EdgeInsets.symmetric(horizontal: 16), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(2)), ), ); + + return TextButton( + style: flatButtonStyle, + onPressed: onPressed, + child: Text(label), + ); } }