"Add infography type and bookmark button in MultitypeOverview"

This commit adds a new type 'infography' in the OverviewData class and assigns it an integer value of 7. It also includes a bookmark button in the MultitypeOverview widget for the new type and all other types. The bookmark button is imported from the bookmark\_button.dart file. The commit also moves the caption section to a separate row and adjusts the flex properties of the containers.
This commit is contained in:
MohammadTaha Basiri 2024-04-01 16:43:57 +03:30
parent e606555234
commit 0173a5240c
2 changed files with 84 additions and 61 deletions

View File

@ -56,6 +56,9 @@ class OverviewData {
case 'saha': case 'saha':
typeInteger = 6; typeInteger = 6;
break; break;
case 'infography':
typeInteger = 7;
break;
default: default:
typeInteger = 5; typeInteger = 5;
} }

View File

@ -10,6 +10,7 @@ import 'package:didvan/services/media/media.dart';
import 'package:didvan/services/network/request.dart'; import 'package:didvan/services/network/request.dart';
import 'package:didvan/utils/date_time.dart'; import 'package:didvan/utils/date_time.dart';
import 'package:didvan/views/podcasts/studio_details/studio_details_state.dart'; import 'package:didvan/views/podcasts/studio_details/studio_details_state.dart';
import 'package:didvan/views/widgets/bookmark_button.dart';
import 'package:didvan/views/widgets/didvan/card.dart'; import 'package:didvan/views/widgets/didvan/card.dart';
import 'package:didvan/views/widgets/didvan/text.dart'; import 'package:didvan/views/widgets/didvan/text.dart';
import 'package:didvan/views/widgets/didvan/text_field.dart'; import 'package:didvan/views/widgets/didvan/text_field.dart';
@ -61,23 +62,23 @@ class MultitypeOverview extends StatelessWidget {
} }
IconData get _icon { IconData get _icon {
if (item.type == 'radar') { switch (item.type) {
case 'radar':
return DidvanIcons.scanning_light; return DidvanIcons.scanning_light;
} case 'news':
if (item.type == 'news') {
return DidvanIcons.foolad_light; return DidvanIcons.foolad_light;
} case 'video':
if (item.type == 'video') {
return DidvanIcons.video_light; return DidvanIcons.video_light;
} case 'podcast':
if (item.type == 'podcast') {
return DidvanIcons.podcast_light; return DidvanIcons.podcast_light;
} case 'delphi':
if (item.type == 'delphi') {
return DidvanIcons.saha_light; return DidvanIcons.saha_light;
} case 'infography':
return DidvanIcons.info_circle_light;
default:
return DidvanIcons.radar_light; return DidvanIcons.radar_light;
} }
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -191,8 +192,12 @@ class MultitypeOverview extends StatelessWidget {
), ),
], ],
), ),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
if (enableCaption) if (enableCaption)
Column( Expanded(
child: Column(
children: [ children: [
const SizedBox(height: 8), const SizedBox(height: 8),
Row( Row(
@ -241,6 +246,21 @@ class MultitypeOverview extends StatelessWidget {
), ),
], ],
), ),
),
if (!enableCaption) const Spacer(),
const SizedBox(
width: 12,
),
BookmarkButton(
value: item.marked,
onMarkChanged: (value) => onMarkChanged(item.id, value),
gestureSize: 32,
type: item.type,
itemId: item.id,
askForConfirmation: true,
),
],
),
], ],
), ),
); );