From 3aa39c82cd91a67eb920669eca05e931cc31683a Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Mon, 1 Apr 2024 17:09:22 +0330 Subject: [PATCH] "Adjusted heights and widths of various widgets in radar and categories grid" This commit adjusts the heights and widths of various widgets in the `Radar` and `CategoriesGrid` components. Specifically, it changes the height of the `SizedBox` in `Radar` from 320 to 300, the top padding of `CategoriesRow1` from 212 to 192, and the width of each `CategoryItem` in `CategoryItem` from `ds.width / 3` to `(ds.width - 40) / 4`. Additionally, it updates the font weight of the label in `CategoryItem`. --- lib/views/radar/radar.dart | 4 +- lib/views/widgets/categories_gird.dart | 58 ++++++++++++++------------ lib/views/widgets/category_item.dart | 5 ++- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/lib/views/radar/radar.dart b/lib/views/radar/radar.dart index a9914b0..0d42b24 100644 --- a/lib/views/radar/radar.dart +++ b/lib/views/radar/radar.dart @@ -82,7 +82,7 @@ class _RadarState extends State { !state.searching && state.appState != AppState.failed) const SliverToBoxAdapter( - child: SizedBox(height: 320), + child: SizedBox(height: 300), ), if (state.appState != AppState.failed) SliverPadding( @@ -167,7 +167,7 @@ class _RadarState extends State { ), if (state.appState != AppState.failed) CategoriesRow1( - topPadding: 212, + topPadding: 192, rightPadding: 124, onSelected: _onCategorySelected, categories: state.categories, diff --git a/lib/views/widgets/categories_gird.dart b/lib/views/widgets/categories_gird.dart index 7f9b225..6e724b5 100644 --- a/lib/views/widgets/categories_gird.dart +++ b/lib/views/widgets/categories_gird.dart @@ -27,22 +27,25 @@ class CategoriesRow1 extends StatelessWidget { top: isColapsed ? -60 : topPadding + d.padding.top, left: isColapsed ? -rightPadding : 0, right: isColapsed ? rightPadding : 0, - child: Row( - children: categories - .sublist(0, 3) - .map( - (category) => Expanded( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 6), - child: CategoryItem( - category: category, - isColapsed: isColapsed, - onSelected: () => onSelected(category), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: Row( + children: categories + .sublist(0, 3) + .map( + (category) => Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + child: CategoryItem( + category: category, + isColapsed: isColapsed, + onSelected: () => onSelected(category), + ), ), ), - ), - ) - .toList(), + ) + .toList(), + ), ), ); } @@ -69,19 +72,22 @@ class CategoriesRow2 extends StatelessWidget { top: isColapsed ? 12 : 92 + d.padding.top, left: isColapsed ? -d.size.width : 0, right: isColapsed ? d.size.width : 0, - child: Row( - children: categories - .sublist(3, 6) - .map( - (category) => Expanded( - child: CategoryItem( - category: category, - onSelected: () => onSelected(category), - isColapsed: isColapsed, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 40), + child: Row( + children: categories + .sublist(3, 6) + .map( + (category) => Expanded( + child: CategoryItem( + category: category, + onSelected: () => onSelected(category), + isColapsed: isColapsed, + ), ), - ), - ) - .toList(), + ) + .toList(), + ), ), ); } diff --git a/lib/views/widgets/category_item.dart b/lib/views/widgets/category_item.dart index da1f561..0f9b7cf 100644 --- a/lib/views/widgets/category_item.dart +++ b/lib/views/widgets/category_item.dart @@ -26,7 +26,7 @@ class CategoryItem extends StatelessWidget { return ds.height / 16 * 9 / 3; } } - return ds.width / 3; + return (ds.width - 40) / 4; } bool _useWebMobileLayout(context) { @@ -78,8 +78,9 @@ class CategoryItem extends StatelessWidget { ), DidvanText( category.label, - style: Theme.of(context).textTheme.titleSmall, color: Theme.of(context).colorScheme.title, + style: Theme.of(context).textTheme.labelSmall, + fontWeight: FontWeight.w600, ), ], ),