bug fixes
This commit is contained in:
parent
d7a39dda26
commit
8666a6a740
|
|
@ -1,8 +1,11 @@
|
|||
import 'package:didvan/models/requests/studio.dart';
|
||||
import 'package:didvan/models/tag.dart';
|
||||
import 'package:didvan/models/view/app_bar_data.dart';
|
||||
import 'package:didvan/views/home/hashtag/hashtag_state.dart';
|
||||
import 'package:didvan/views/home/widgets/overview/news.dart';
|
||||
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/sliver_state_handler.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -50,19 +53,34 @@ class _HashtagState extends State<Hashtag> {
|
|||
}
|
||||
final item = state.items[index];
|
||||
final type = item.type;
|
||||
if (type == 'radar') {
|
||||
return RadarOverview(
|
||||
radar: item,
|
||||
onCommentsChanged: (id, count) => item.comments = count,
|
||||
onMarkChanged: (id, value) => item.marked = value,
|
||||
);
|
||||
} else if (type == 'news') {
|
||||
return NewsOverview(
|
||||
news: item,
|
||||
onMarkChanged: (id, value) => item.marked = value,
|
||||
);
|
||||
switch (type) {
|
||||
case 'radar':
|
||||
return RadarOverview(
|
||||
radar: item,
|
||||
onCommentsChanged: (_, count) => item.comments = count,
|
||||
onMarkChanged: (_, value) => item.marked = value,
|
||||
);
|
||||
case 'news':
|
||||
return NewsOverview(
|
||||
news: item,
|
||||
onMarkChanged: (_, value) => item.marked = value,
|
||||
);
|
||||
case 'podcast':
|
||||
return PodcastOverview(
|
||||
podcast: item,
|
||||
onMarkChanged: (_, value) => item.marked = value,
|
||||
studioRequestArgs:
|
||||
const StudioRequestArgs(page: 0, type: 'podcast'),
|
||||
);
|
||||
case 'video':
|
||||
return VideoOverview(
|
||||
video: item,
|
||||
onMarkChanged: (_, value) => item.marked = value,
|
||||
studioRequestArgs:
|
||||
const StudioRequestArgs(page: 0, type: 'video'),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
return const SizedBox();
|
||||
},
|
||||
childCount:
|
||||
state.items.length + (state.page != state.lastPage ? 1 : 0),
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ class HashtagState extends CoreProvier {
|
|||
}
|
||||
final service = RequestService(RequestHelper.tag(
|
||||
ids: [id],
|
||||
itemId: 1,
|
||||
type: 'radar',
|
||||
limit: 15,
|
||||
page: page,
|
||||
));
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ class StudioDetailsWidget extends StatelessWidget {
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Html(
|
||||
key: ValueKey(state.studio.id),
|
||||
data: state.studio.description,
|
||||
onAnchorTap: (href, context, map, element) =>
|
||||
launch(href!),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:carousel_slider/carousel_slider.dart';
|
||||
import 'package:didvan/config/design_config.dart';
|
||||
import 'package:didvan/config/theme_data.dart';
|
||||
import 'package:didvan/constants/app_icons.dart';
|
||||
import 'package:didvan/models/enums.dart';
|
||||
import 'package:didvan/models/requests/studio.dart';
|
||||
import 'package:didvan/routes/routes.dart';
|
||||
|
|
@ -61,6 +62,7 @@ class _StudioSliderState extends State<StudioSlider> {
|
|||
);
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SkeletonImage(
|
||||
borderRadius: DesignConfig.mediumBorderRadius,
|
||||
|
|
@ -95,6 +97,22 @@ class _StudioSliderState extends State<StudioSlider> {
|
|||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 52,
|
||||
width: 52,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(0.7),
|
||||
),
|
||||
child: Icon(
|
||||
DidvanIcons.play_solid,
|
||||
color: Theme.of(context).colorScheme.white,
|
||||
size: 48,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -17,13 +17,13 @@ class VideoOverview extends StatelessWidget {
|
|||
final OverviewData video;
|
||||
final void Function(int id, bool value) onMarkChanged;
|
||||
final bool hasUnmarkConfirmation;
|
||||
final StudioRequestArgs? studioRequestArgs;
|
||||
final StudioRequestArgs studioRequestArgs;
|
||||
const VideoOverview({
|
||||
Key? key,
|
||||
required this.video,
|
||||
required this.onMarkChanged,
|
||||
required this.hasUnmarkConfirmation,
|
||||
this.studioRequestArgs,
|
||||
required this.studioRequestArgs,
|
||||
this.hasUnmarkConfirmation = false,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
|
|
@ -42,29 +42,24 @@ class VideoOverview extends StatelessWidget {
|
|||
child: Row(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SkeletonImage(
|
||||
imageUrl: video.image,
|
||||
height: 108,
|
||||
width: 108,
|
||||
),
|
||||
Positioned.fill(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 28,
|
||||
width: 28,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondary
|
||||
.withOpacity(0.7),
|
||||
),
|
||||
child: Icon(
|
||||
DidvanIcons.play_solid,
|
||||
color: Theme.of(context).colorScheme.white,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 28,
|
||||
width: 28,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color:
|
||||
Theme.of(context).colorScheme.secondary.withOpacity(0.7),
|
||||
),
|
||||
child: Icon(
|
||||
DidvanIcons.play_solid,
|
||||
color: Theme.of(context).colorScheme.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue