bug fixes
This commit is contained in:
parent
20c32577c5
commit
1efb779675
|
|
@ -7,6 +7,7 @@ import 'package:didvan/views/home/widgets/overview/podcast.dart';
|
|||
import 'package:didvan/views/home/widgets/overview/radar.dart';
|
||||
import 'package:didvan/views/home/widgets/overview/video.dart';
|
||||
import 'package:didvan/views/widgets/didvan/scaffold.dart';
|
||||
import 'package:didvan/views/widgets/state_handlers/empty_list.dart';
|
||||
import 'package:didvan/views/widgets/state_handlers/sliver_state_handler.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
|
|
@ -38,6 +39,8 @@ class _HashtagState extends State<Hashtag> {
|
|||
slivers: [
|
||||
Consumer<HashtagState>(
|
||||
builder: (context, state, child) => SliverStateHandler<HashtagState>(
|
||||
emptyState: const EmptyList(),
|
||||
enableEmptyState: state.items.isEmpty,
|
||||
itemPadding: const EdgeInsets.only(bottom: 8),
|
||||
state: state,
|
||||
placeholder: RadarOverview.placeholder,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,9 @@ class _StatisticState extends State<Statistic> {
|
|||
placeholder: StatisticOverview.placeHolder,
|
||||
builder: (context, state, index) {
|
||||
if (index == state.markedStatistics.length) {
|
||||
return const DidvanDivider(verticalPadding: 8);
|
||||
return index == 0
|
||||
? const SizedBox()
|
||||
: const DidvanDivider(verticalPadding: 8);
|
||||
}
|
||||
bool isMarked = false;
|
||||
StatisticData statistic;
|
||||
|
|
|
|||
|
|
@ -214,30 +214,31 @@ class _StatisticDetailsState extends State<StatisticDetails> {
|
|||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: DidvanCard(
|
||||
child: Column(
|
||||
children: [
|
||||
if (state.relatedContents.isEmpty)
|
||||
for (var i = 0; i < 3; i++) ...[
|
||||
MultitypeOverview.placeholder,
|
||||
if (i != 2) const SizedBox(height: 16)
|
||||
],
|
||||
for (var i = 0;
|
||||
i < state.relatedContents.length;
|
||||
i++) ...[
|
||||
MultitypeOverview(
|
||||
item: state.relatedContents[i],
|
||||
onMarkChanged: (id, value) {},
|
||||
),
|
||||
if (i != state.relatedContents.length - 1)
|
||||
const SizedBox(height: 16)
|
||||
]
|
||||
],
|
||||
if (state.relatedContents != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: DidvanCard(
|
||||
child: Column(
|
||||
children: [
|
||||
if (state.relatedContents!.isEmpty)
|
||||
for (var i = 0; i < 3; i++) ...[
|
||||
MultitypeOverview.placeholder,
|
||||
if (i != 2) const SizedBox(height: 16)
|
||||
],
|
||||
for (var i = 0;
|
||||
i < state.relatedContents!.length;
|
||||
i++) ...[
|
||||
MultitypeOverview(
|
||||
item: state.relatedContents![i],
|
||||
onMarkChanged: (id, value) {},
|
||||
),
|
||||
if (i != state.relatedContents!.length - 1)
|
||||
const SizedBox(height: 16)
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ import 'package:collection/collection.dart';
|
|||
class StatisticDetailsState extends CoreProvier {
|
||||
late bool marked;
|
||||
late String label;
|
||||
final List<Data> datas = [];
|
||||
final List<Tag> tags = [];
|
||||
String? startDate;
|
||||
String? endDate;
|
||||
int currentDateRangeId = 0;
|
||||
final List<Data> datas = [];
|
||||
final List<OverviewData> relatedContents = [];
|
||||
final List<Tag> tags = [];
|
||||
List<OverviewData>? relatedContents = [];
|
||||
Data? data;
|
||||
double maxValue = 0;
|
||||
double? minValue;
|
||||
|
|
@ -153,7 +153,7 @@ class StatisticDetailsState extends CoreProvier {
|
|||
double.parse(value.replaceAll(',', ''));
|
||||
|
||||
Future<void> getRelatedContents() async {
|
||||
if (relatedContents.isNotEmpty) return;
|
||||
if (relatedContents!.isNotEmpty) return;
|
||||
final service = RequestService(RequestHelper.tag(
|
||||
ids: tags.map((tag) => tag.id).toList(),
|
||||
));
|
||||
|
|
@ -161,7 +161,10 @@ class StatisticDetailsState extends CoreProvier {
|
|||
if (service.isSuccess) {
|
||||
final relateds = service.result['contents'];
|
||||
for (var i = 0; i < relateds.length; i++) {
|
||||
relatedContents.add(OverviewData.fromJson(relateds[i]));
|
||||
relatedContents!.add(OverviewData.fromJson(relateds[i]));
|
||||
}
|
||||
if (relatedContents!.isEmpty) {
|
||||
relatedContents = null;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue