"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`.
This commit is contained in:
MohammadTaha Basiri 2024-04-01 17:09:22 +03:30
parent ecc549e124
commit 3aa39c82cd
3 changed files with 37 additions and 30 deletions

View File

@ -82,7 +82,7 @@ class _RadarState extends State<Radar> {
!state.searching && !state.searching &&
state.appState != AppState.failed) state.appState != AppState.failed)
const SliverToBoxAdapter( const SliverToBoxAdapter(
child: SizedBox(height: 320), child: SizedBox(height: 300),
), ),
if (state.appState != AppState.failed) if (state.appState != AppState.failed)
SliverPadding( SliverPadding(
@ -167,7 +167,7 @@ class _RadarState extends State<Radar> {
), ),
if (state.appState != AppState.failed) if (state.appState != AppState.failed)
CategoriesRow1( CategoriesRow1(
topPadding: 212, topPadding: 192,
rightPadding: 124, rightPadding: 124,
onSelected: _onCategorySelected, onSelected: _onCategorySelected,
categories: state.categories, categories: state.categories,

View File

@ -27,22 +27,25 @@ class CategoriesRow1 extends StatelessWidget {
top: isColapsed ? -60 : topPadding + d.padding.top, top: isColapsed ? -60 : topPadding + d.padding.top,
left: isColapsed ? -rightPadding : 0, left: isColapsed ? -rightPadding : 0,
right: isColapsed ? rightPadding : 0, right: isColapsed ? rightPadding : 0,
child: Row( child: Padding(
children: categories padding: const EdgeInsets.symmetric(horizontal: 40),
.sublist(0, 3) child: Row(
.map( children: categories
(category) => Expanded( .sublist(0, 3)
child: Padding( .map(
padding: const EdgeInsets.symmetric(horizontal: 6), (category) => Expanded(
child: CategoryItem( child: Padding(
category: category, padding: const EdgeInsets.symmetric(horizontal: 6),
isColapsed: isColapsed, child: CategoryItem(
onSelected: () => onSelected(category), category: category,
isColapsed: isColapsed,
onSelected: () => onSelected(category),
),
), ),
), ),
), )
) .toList(),
.toList(), ),
), ),
); );
} }
@ -69,19 +72,22 @@ class CategoriesRow2 extends StatelessWidget {
top: isColapsed ? 12 : 92 + d.padding.top, top: isColapsed ? 12 : 92 + d.padding.top,
left: isColapsed ? -d.size.width : 0, left: isColapsed ? -d.size.width : 0,
right: isColapsed ? d.size.width : 0, right: isColapsed ? d.size.width : 0,
child: Row( child: Padding(
children: categories padding: const EdgeInsets.symmetric(horizontal: 40),
.sublist(3, 6) child: Row(
.map( children: categories
(category) => Expanded( .sublist(3, 6)
child: CategoryItem( .map(
category: category, (category) => Expanded(
onSelected: () => onSelected(category), child: CategoryItem(
isColapsed: isColapsed, category: category,
onSelected: () => onSelected(category),
isColapsed: isColapsed,
),
), ),
), )
) .toList(),
.toList(), ),
), ),
); );
} }

View File

@ -26,7 +26,7 @@ class CategoryItem extends StatelessWidget {
return ds.height / 16 * 9 / 3; return ds.height / 16 * 9 / 3;
} }
} }
return ds.width / 3; return (ds.width - 40) / 4;
} }
bool _useWebMobileLayout(context) { bool _useWebMobileLayout(context) {
@ -78,8 +78,9 @@ class CategoryItem extends StatelessWidget {
), ),
DidvanText( DidvanText(
category.label, category.label,
style: Theme.of(context).textTheme.titleSmall,
color: Theme.of(context).colorScheme.title, color: Theme.of(context).colorScheme.title,
style: Theme.of(context).textTheme.labelSmall,
fontWeight: FontWeight.w600,
), ),
], ],
), ),