diff --git a/lib/new_views/common_widgets/app_filled_button.dart b/lib/new_views/common_widgets/app_filled_button.dart index cc6df970..9e22968c 100644 --- a/lib/new_views/common_widgets/app_filled_button.dart +++ b/lib/new_views/common_widgets/app_filled_button.dart @@ -5,26 +5,31 @@ import 'package:test_sa/models/enums/translation_keys.dart'; class AppFilledButton extends StatelessWidget { final VoidCallback onPressed; final TranslationKeys label; + final bool maxWidth; const AppFilledButton({ @required this.onPressed, @required this.label, + this.maxWidth = false, Key key, }) : super(key: key); @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 20, - ), - child: ElevatedButton( - style: ElevatedButton.styleFrom( - padding: const EdgeInsets.symmetric(vertical: 16), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + return SizedBox( + width: maxWidth ? double.infinity : null, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 20, + ), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 16), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + ), + onPressed: onPressed, + child: Text(context.translate(label)), ), - onPressed: onPressed, - child: Text(context.translate(label)), ), ); } diff --git a/lib/new_views/pages/login_page.dart b/lib/new_views/pages/login_page.dart index 2b7a6309..b2786a27 100644 --- a/lib/new_views/pages/login_page.dart +++ b/lib/new_views/pages/login_page.dart @@ -107,10 +107,7 @@ class _LoginPageState extends State { ), ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: SizedBox( - width: double.infinity, - child: AppFilledButton(label: TranslationKeys.login, onPressed: _login), - ), + floatingActionButton: AppFilledButton(label: TranslationKeys.login, maxWidth: true, onPressed: _login), ), ); } diff --git a/lib/new_views/pages/new_gas_refill_request_page.dart b/lib/new_views/pages/new_gas_refill_request_page.dart index ccd53924..e2aa038d 100644 --- a/lib/new_views/pages/new_gas_refill_request_page.dart +++ b/lib/new_views/pages/new_gas_refill_request_page.dart @@ -12,8 +12,10 @@ class NewGasRefillRequestPage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: const DefaultAppBar(title: TranslationKeys.newGasRefillRequest), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: AppFilledButton( label: TranslationKeys.submitRequest, + maxWidth: true, onPressed: () {}, ), ); diff --git a/lib/new_views/pages/new_service_request_page.dart b/lib/new_views/pages/new_service_request_page.dart index 379ce6e5..d6387383 100644 --- a/lib/new_views/pages/new_service_request_page.dart +++ b/lib/new_views/pages/new_service_request_page.dart @@ -12,8 +12,10 @@ class NewServiceRequestPage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: const DefaultAppBar(title: TranslationKeys.newServiceRequest), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: AppFilledButton( label: TranslationKeys.submitRequest, + maxWidth: true, onPressed: () {}, ), ); diff --git a/lib/new_views/pages/new_transfer_request_page.dart b/lib/new_views/pages/new_transfer_request_page.dart index fc5a5d09..46d01688 100644 --- a/lib/new_views/pages/new_transfer_request_page.dart +++ b/lib/new_views/pages/new_transfer_request_page.dart @@ -12,8 +12,10 @@ class NewTransferRequestPage extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: const DefaultAppBar(title: TranslationKeys.newTransferRequest), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: AppFilledButton( label: TranslationKeys.submitRequest, + maxWidth: true, onPressed: () {}, ), );