fixing some issues
This commit is contained in:
parent
e39a507954
commit
d3252e931f
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:didvan/models/enums.dart';
|
||||
import 'package:didvan/models/new_statistic/general_item_model.dart';
|
||||
import 'package:didvan/models/requests/newstats_general.dart';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:developer';
|
||||
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/constants/app_icons.dart';
|
||||
import 'package:didvan/models/new_statistic/general_item_model.dart';
|
||||
|
|
|
|||
|
|
@ -82,11 +82,12 @@ class _RadarState extends State<Radar> {
|
|||
!state.searching &&
|
||||
state.appState != AppState.failed)
|
||||
const SliverToBoxAdapter(
|
||||
child: SizedBox(height: 300),
|
||||
child: SizedBox(height: 320),
|
||||
),
|
||||
if (state.appState != AppState.failed)
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.only(right: 16, bottom: 20),
|
||||
padding: const EdgeInsets.only(
|
||||
right: 16, bottom: 20, top: 20),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
|
|
@ -167,7 +168,7 @@ class _RadarState extends State<Radar> {
|
|||
),
|
||||
if (state.appState != AppState.failed)
|
||||
CategoriesRow1(
|
||||
topPadding: 192,
|
||||
topPadding: 212,
|
||||
rightPadding: 124,
|
||||
onSelected: _onCategorySelected,
|
||||
categories: state.categories,
|
||||
|
|
|
|||
|
|
@ -27,25 +27,22 @@ class CategoriesRow1 extends StatelessWidget {
|
|||
top: isColapsed ? -60 : topPadding + d.padding.top,
|
||||
left: isColapsed ? -rightPadding : 0,
|
||||
right: isColapsed ? rightPadding : 0,
|
||||
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),
|
||||
),
|
||||
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(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -72,22 +69,19 @@ class CategoriesRow2 extends StatelessWidget {
|
|||
top: isColapsed ? 12 : 92 + d.padding.top,
|
||||
left: isColapsed ? -d.size.width : 0,
|
||||
right: isColapsed ? d.size.width : 0,
|
||||
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,
|
||||
),
|
||||
child: Row(
|
||||
children: categories
|
||||
.sublist(3, 6)
|
||||
.map(
|
||||
(category) => Expanded(
|
||||
child: CategoryItem(
|
||||
category: category,
|
||||
onSelected: () => onSelected(category),
|
||||
isColapsed: isColapsed,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class CategoryItem extends StatelessWidget {
|
|||
return ds.height / 16 * 9 / 3;
|
||||
}
|
||||
}
|
||||
return (ds.width - 40) / 4;
|
||||
return ds.width / 3;
|
||||
}
|
||||
|
||||
bool _useWebMobileLayout(context) {
|
||||
|
|
@ -79,8 +79,7 @@ class CategoryItem extends StatelessWidget {
|
|||
DidvanText(
|
||||
category.label,
|
||||
color: Theme.of(context).colorScheme.title,
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
fontWeight: FontWeight.w600,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -164,31 +164,42 @@ class MultitypeOverview extends StatelessWidget {
|
|||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
DidvanIcons.calendar_day_light,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(
|
||||
DateTime.parse(item.createdAt).toPersianDateStr(),
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
DidvanIcons.calendar_day_light,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(
|
||||
DateTime.parse(item.createdAt)
|
||||
.toPersianDateStr(),
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
if ((item.timeToRead ?? item.duration) != null) ...[
|
||||
const Icon(
|
||||
DidvanIcons.timer_light,
|
||||
size: 16,
|
||||
if ((item.timeToRead ?? item.duration) != null)
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
DidvanIcons.timer_light,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(
|
||||
item.timeToRead != null
|
||||
? '${item.timeToRead} دقیقه'
|
||||
: DateTimeUtils.normalizeTimeDuration(
|
||||
Duration(seconds: item.duration!),
|
||||
),
|
||||
style:
|
||||
Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(
|
||||
item.timeToRead != null
|
||||
? '${item.timeToRead} دقیقه'
|
||||
: DateTimeUtils.normalizeTimeDuration(
|
||||
Duration(seconds: item.duration!),
|
||||
),
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue