feat: update ReorderWidget layout for responsive design; adjust item dimensions based on screen size
This commit is contained in:
@@ -35,12 +35,13 @@ class ReorderWidget extends StatelessWidget {
|
||||
}
|
||||
|
||||
final TranslationsClientHomeReorderEn i18n = t.client_home.reorder;
|
||||
final Size size = MediaQuery.sizeOf(context);
|
||||
|
||||
return SectionLayout(
|
||||
title: title,
|
||||
subtitle: subtitle,
|
||||
child: SizedBox(
|
||||
height: 140,
|
||||
height: size.height * 0.18,
|
||||
child: ListView.separated(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: orders.length,
|
||||
@@ -50,7 +51,7 @@ class ReorderWidget extends StatelessWidget {
|
||||
final RecentOrder order = orders[index];
|
||||
|
||||
return Container(
|
||||
width: 260,
|
||||
width: size.width * 0.8,
|
||||
padding: const EdgeInsets.all(UiConstants.space3),
|
||||
decoration: BoxDecoration(
|
||||
color: UiColors.white,
|
||||
@@ -86,7 +87,7 @@ class ReorderWidget extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
order.title,
|
||||
style: UiTypography.body2b,
|
||||
style: UiTypography.body2m,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (order.hubName != null &&
|
||||
@@ -103,18 +104,18 @@ class ReorderWidget extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
// ASSUMPTION: No i18n key for 'positions' under
|
||||
// reorder section — carrying forward existing
|
||||
// hardcoded string pattern for this migration.
|
||||
Text(
|
||||
'${order.positionCount} positions',
|
||||
style: UiTypography.footnote2r.textSecondary,
|
||||
),
|
||||
],
|
||||
),
|
||||
// Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.end,
|
||||
// children: <Widget>[
|
||||
// // ASSUMPTION: No i18n key for 'positions' under
|
||||
// // reorder section — carrying forward existing
|
||||
// // hardcoded string pattern for this migration.
|
||||
// Text(
|
||||
// '${order.positionCount} positions',
|
||||
// style: UiTypography.footnote2r.textSecondary,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: UiConstants.space3),
|
||||
|
||||
Reference in New Issue
Block a user