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,7 +219,11 @@ Widget _defaultNavigateToShoppingCartBuilder(
return ListenableBuilder( return ListenableBuilder(
listenable: notifier, listenable: notifier,
builder: (context, widget) => FilledButton( builder: (context, widget) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 60),
child: SizedBox(
width: double.infinity,
child: FilledButton(
onPressed: configuration.getProductsInShoppingCart?.call() != 0 onPressed: configuration.getProductsInShoppingCart?.call() != 0
? configuration.onNavigateToShoppingCart ? configuration.onNavigateToShoppingCart
: null, : null,
@ -231,7 +235,7 @@ Widget _defaultNavigateToShoppingCartBuilder(
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(
configuration.localizations.navigateToShoppingCart, configuration.localizations.navigateToShoppingCart,
@ -239,5 +243,7 @@ Widget _defaultNavigateToShoppingCartBuilder(
), ),
), ),
), ),
),
),
); );
} }

View file

@ -92,15 +92,32 @@ class DefaultOrderSucces extends StatelessWidget {
), ),
), ),
const Spacer(), const Spacer(),
FilledButton( Padding(
onPressed: () { padding: const EdgeInsets.symmetric(horizontal: 60),
child: SizedBox(
width: double.infinity,
child: FilledButton(
onPressed: () async {
configuration.onCompleteUserStory.call(context); 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( child: Text(
"Place another order", "Place another order",
style: theme.textTheme.displayLarge, style: theme.textTheme.displayLarge,
), ),
), ),
),
),
),
], ],
), ),
), ),

View file

@ -159,35 +159,30 @@ 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(
configuration.productService.products,
),
style: theme.filledButtonTheme.style?.copyWith( style: theme.filledButtonTheme.style?.copyWith(
backgroundColor: WidgetStateProperty.all( backgroundColor: WidgetStateProperty.all(
theme.colorScheme.primary, theme.colorScheme.primary,
), ),
), ),
onPressed: () => onConfirmOrderPressed(
configuration.productService.products,
),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 16.0, horizontal: 16.0,
vertical: 5.0, vertical: 12,
), ),
child: Text( child: Text(
configuration.localizations.placeOrder, configuration.localizations.placeOrder,
style: theme.textTheme.displayLarge?.copyWith( style: theme.textTheme.displayLarge,
color: theme.colorScheme.onPrimary,
), ),
), ),
), ),
), ),
),
],
),
); );
} }
} }