feat: Refactor OrderDetailsBottomBar to use UiButton for improved styling and consistency
This commit is contained in:
@@ -50,20 +50,8 @@ class OrderDetailsBottomBar extends StatelessWidget {
|
|||||||
if (bookingInProgress) {
|
if (bookingInProgress) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: UiButton.primary(
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: UiColors.primary.withValues(alpha: 0.5),
|
|
||||||
disabledBackgroundColor: UiColors.primary.withValues(alpha: 0.5),
|
|
||||||
disabledForegroundColor: UiColors.white,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(UiConstants.radiusMdValue),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: UiConstants.space3,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: const SizedBox(
|
child: const SizedBox(
|
||||||
width: UiConstants.iconMd,
|
width: UiConstants.iconMd,
|
||||||
height: UiConstants.iconMd,
|
height: UiConstants.iconMd,
|
||||||
@@ -80,50 +68,18 @@ class OrderDetailsBottomBar extends StatelessWidget {
|
|||||||
if (spotsLeft <= 0) {
|
if (spotsLeft <= 0) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: UiButton.primary(
|
||||||
onPressed: null,
|
onPressed: null,
|
||||||
style: ElevatedButton.styleFrom(
|
text: t.available_orders.fully_staffed,
|
||||||
disabledBackgroundColor: UiColors.bgThird,
|
|
||||||
disabledForegroundColor: UiColors.textSecondary,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(UiConstants.radiusMdValue),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: UiConstants.space3,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
t.available_orders.fully_staffed,
|
|
||||||
style: UiTypography.body2m.textSecondary,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instant book or standard apply
|
|
||||||
final bool isInstant = instantBook;
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: UiButton.primary(
|
||||||
onPressed: onBook,
|
onPressed: onBook,
|
||||||
style: ElevatedButton.styleFrom(
|
text: t.available_orders.book_order,
|
||||||
backgroundColor: isInstant ? UiColors.success : UiColors.primary,
|
|
||||||
foregroundColor: UiColors.white,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(UiConstants.radiusMdValue),
|
|
||||||
),
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
vertical: UiConstants.space3,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
isInstant
|
|
||||||
? t.available_orders.book_order
|
|
||||||
: t.available_orders.apply,
|
|
||||||
style: UiTypography.body2m.white,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user