From f51a2343d783bae4cc354bd748cc74df8433bb9c Mon Sep 17 00:00:00 2001 From: Lu Shueh Chou Date: Tue, 17 Sep 2024 12:50:06 +0800 Subject: [PATCH] chore: ui test --- lib/ui/stock/quantities_page.dart | 32 +++++++++++++------------- lib/ui/transit/transit_order_list.dart | 3 ++- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/ui/stock/quantities_page.dart b/lib/ui/stock/quantities_page.dart index a4cd8bb9..a131daba 100644 --- a/lib/ui/stock/quantities_page.dart +++ b/lib/ui/stock/quantities_page.dart @@ -18,7 +18,7 @@ class QuantitiesPage extends StatelessWidget { final body = ListenableBuilder( key: const Key('quantities_page'), listenable: Quantities.instance, - builder: (context, child) => _buildBody(context), + builder: (context, child) => Center(child: _buildBody(context)), ); final withScaffold = MediaQuery.sizeOf(context).width <= Breakpoint.medium.max; @@ -31,10 +31,7 @@ class QuantitiesPage extends StatelessWidget { ), body: body, ) - : ConstrainedBox( - constraints: BoxConstraints(maxWidth: Breakpoint.medium.max), - child: body, - ); + : body; } Widget _buildBody(BuildContext context) { @@ -45,18 +42,21 @@ class QuantitiesPage extends StatelessWidget { ); } - return StockQuantityList( - quantities: Quantities.instance.itemList, - leading: Row(children: [ - Expanded( - child: RouteElevatedIconButton( - key: const Key('quantity.add'), - route: Routes.quantityCreate, - label: S.stockQuantityTitleCreate, - icon: const Icon(KIcons.add), + return ConstrainedBox( + constraints: BoxConstraints(maxWidth: Breakpoint.medium.max), + child: StockQuantityList( + quantities: Quantities.instance.itemList, + leading: Row(children: [ + Expanded( + child: RouteElevatedIconButton( + key: const Key('quantity.add'), + route: Routes.quantityCreate, + label: S.stockQuantityTitleCreate, + icon: const Icon(KIcons.add), + ), ), - ), - ]), + ]), + ), ); } } diff --git a/lib/ui/transit/transit_order_list.dart b/lib/ui/transit/transit_order_list.dart index 3d342762..7ce5bdbc 100644 --- a/lib/ui/transit/transit_order_list.dart +++ b/lib/ui/transit/transit_order_list.dart @@ -140,6 +140,7 @@ class TransitOrderList extends StatelessWidget { actions: [ PopButton(title: MaterialLocalizations.of(context).okButtonLabel), ], + scrollable: true, content: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 600), child: Column(children: [ @@ -172,7 +173,7 @@ class TransitOrderList extends StatelessWidget { ), const Divider(), Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.symmetric(horizontal: kHorizontalSpacing), child: Linkify.fromString([ S.transitOrderCapacityContent, if (warning != null) '\n$warning',