refactor: conditionally render the create order button based on filtered orders state
This commit is contained in:
@@ -222,16 +222,17 @@ class _ViewOrdersViewState extends State<ViewOrdersView> {
|
|||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
UiButton.primary(
|
if (state.filteredOrders.isNotEmpty)
|
||||||
text: t.client_view_orders.post_button,
|
UiButton.primary(
|
||||||
leadingIcon: UiIcons.add,
|
text: t.client_view_orders.post_button,
|
||||||
onPressed: () => Modular.to.navigateToCreateOrder(),
|
leadingIcon: UiIcons.add,
|
||||||
size: UiButtonSize.small,
|
onPressed: () => Modular.to.navigateToCreateOrder(),
|
||||||
style: ElevatedButton.styleFrom(
|
size: UiButtonSize.small,
|
||||||
minimumSize: const Size(0, 48),
|
style: ElevatedButton.styleFrom(
|
||||||
maximumSize: const Size(0, 48),
|
minimumSize: const Size(0, 48),
|
||||||
|
maximumSize: const Size(0, 48),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user