From d67ebbe9a9836f6b0b5482934a33f08cf9efe925 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 12 Apr 2021 18:42:08 +0300 Subject: [PATCH] Correct padding --- lib/ui/app/buttons/app_text_button.dart | 14 +++++++++----- lib/ui/app/change_layout_banner.dart | 17 +++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/ui/app/buttons/app_text_button.dart b/lib/ui/app/buttons/app_text_button.dart index af5c73a25..137be54f3 100644 --- a/lib/ui/app/buttons/app_text_button.dart +++ b/lib/ui/app/buttons/app_text_button.dart @@ -7,11 +7,13 @@ class AppTextButton extends StatelessWidget { this.label, this.onPressed, this.isInHeader = false, + this.color, }); final String label; final Function onPressed; final bool isInHeader; + final Color color; @override Widget build(BuildContext context) { @@ -27,11 +29,13 @@ class AppTextButton extends StatelessWidget { style: TextStyle( color: onPressed == null ? null - : isInHeader - ? state.headerTextColor - : state.prefState.enableDarkMode - ? Colors.white - : Colors.black, + : color != null + ? color + : isInHeader + ? state.headerTextColor + : state.prefState.enableDarkMode + ? Colors.white + : Colors.black, ), ), ), diff --git a/lib/ui/app/change_layout_banner.dart b/lib/ui/app/change_layout_banner.dart index 6b7cd8490..f0c8f63cf 100644 --- a/lib/ui/app/change_layout_banner.dart +++ b/lib/ui/app/change_layout_banner.dart @@ -6,6 +6,7 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart'; import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart'; import 'package:invoiceninja_flutter/redux/ui/pref_state.dart'; import 'package:invoiceninja_flutter/ui/app/app_builder.dart'; +import 'package:invoiceninja_flutter/ui/app/buttons/app_text_button.dart'; import 'package:invoiceninja_flutter/ui/app/icon_text.dart'; import 'package:invoiceninja_flutter/utils/localization.dart'; import 'package:invoiceninja_flutter/utils/platforms.dart'; @@ -71,20 +72,16 @@ class _ChangeLayoutBannerState extends State { text: message, ), ), - TextButton( - child: Text( - localization.dismiss, - style: TextStyle(color: Colors.white), - ), + AppTextButton( + label: localization.dismiss, + color: Colors.white, onPressed: () { setState(() => _dismissedChange = true); }, ), - TextButton( - child: Text( - localization.change, - style: TextStyle(color: Colors.white), - ), + AppTextButton( + label: localization.change, + color: Colors.white, onPressed: () { final layout = widget.suggestedLayout == AppLayout.desktop