fix: button styling

This commit is contained in:
mike doornenbal 2024-07-02 10:07:57 +02:00
parent 4e37ec8b5d
commit d37689e855
4 changed files with 71 additions and 53 deletions

View file

@ -69,12 +69,12 @@ Widget _defaultNextButtonBuilder(
"Choose date and time", "Choose date and time",
"Next", "Next",
"Next", "Next",
"Place another order",
]; ];
return Align( return Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 48, vertical: 48), padding: const EdgeInsets.symmetric(horizontal: 60, vertical: 32),
child: SizedBox( child: SizedBox(
width: double.infinity, width: double.infinity,
child: FilledButton( child: FilledButton(
@ -90,7 +90,7 @@ Widget _defaultNextButtonBuilder(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 16.0, horizontal: 16.0,
vertical: 8.0, vertical: 12,
), ),
child: Text( child: Text(
nextButtonTexts[currentStep], nextButtonTexts[currentStep],

View file

@ -219,23 +219,29 @@ Widget _defaultNavigateToShoppingCartBuilder(
return ListenableBuilder( return ListenableBuilder(
listenable: notifier, listenable: notifier,
builder: (context, widget) => FilledButton( builder: (context, widget) => Padding(
onPressed: configuration.getProductsInShoppingCart?.call() != 0 padding: const EdgeInsets.symmetric(horizontal: 60),
? configuration.onNavigateToShoppingCart child: SizedBox(
: null, width: double.infinity,
style: theme.filledButtonTheme.style?.copyWith( child: FilledButton(
backgroundColor: WidgetStateProperty.all( onPressed: configuration.getProductsInShoppingCart?.call() != 0
theme.colorScheme.primary, ? configuration.onNavigateToShoppingCart
), : null,
), style: theme.filledButtonTheme.style?.copyWith(
child: Padding( backgroundColor: WidgetStateProperty.all(
padding: const EdgeInsets.symmetric( theme.colorScheme.primary,
horizontal: 16.0, ),
vertical: 8.0, ),
), child: Padding(
child: Text( padding: const EdgeInsets.symmetric(
configuration.localizations.navigateToShoppingCart, horizontal: 16.0,
style: theme.textTheme.displayLarge, vertical: 12,
),
child: Text(
configuration.localizations.navigateToShoppingCart,
style: theme.textTheme.displayLarge,
),
),
), ),
), ),
), ),

View file

@ -92,13 +92,30 @@ class DefaultOrderSucces extends StatelessWidget {
), ),
), ),
const Spacer(), const Spacer(),
FilledButton( Padding(
onPressed: () { padding: const EdgeInsets.symmetric(horizontal: 60),
configuration.onCompleteUserStory.call(context); child: SizedBox(
}, width: double.infinity,
child: Text( child: FilledButton(
"Place another order", onPressed: () async {
style: theme.textTheme.displayLarge, configuration.onCompleteUserStory.call(context);
},
style: theme.filledButtonTheme.style?.copyWith(
backgroundColor: WidgetStateProperty.all(
theme.colorScheme.primary,
),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 12,
),
child: Text(
"Place another order",
style: theme.textTheme.displayLarge,
),
),
),
), ),
), ),
], ],

View file

@ -159,34 +159,29 @@ class _DefaultConfirmOrderButton<T extends Product> extends StatelessWidget {
} }
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 80), padding: const EdgeInsets.symmetric(horizontal: 60),
child: Row( child: SizedBox(
children: [ width: double.infinity,
Expanded( child: FilledButton(
child: FilledButton( onPressed: () => onConfirmOrderPressed(
style: theme.filledButtonTheme.style?.copyWith( configuration.productService.products,
backgroundColor: WidgetStateProperty.all( ),
theme.colorScheme.primary, style: theme.filledButtonTheme.style?.copyWith(
), backgroundColor: WidgetStateProperty.all(
), theme.colorScheme.primary,
onPressed: () => onConfirmOrderPressed(
configuration.productService.products,
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 5.0,
),
child: Text(
configuration.localizations.placeOrder,
style: theme.textTheme.displayLarge?.copyWith(
color: theme.colorScheme.onPrimary,
),
),
),
), ),
), ),
], child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 12,
),
child: Text(
configuration.localizations.placeOrder,
style: theme.textTheme.displayLarge,
),
),
),
), ),
); );
} }