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