"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':
typeInteger = 6;
break;
case 'infography':
typeInteger = 7;
break;
default:
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/utils/date_time.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/text.dart';
import 'package:didvan/views/widgets/didvan/text_field.dart';
@ -61,23 +62,23 @@ class MultitypeOverview extends StatelessWidget {
}
IconData get _icon {
if (item.type == 'radar') {
switch (item.type) {
case 'radar':
return DidvanIcons.scanning_light;
}
if (item.type == 'news') {
case 'news':
return DidvanIcons.foolad_light;
}
if (item.type == 'video') {
case 'video':
return DidvanIcons.video_light;
}
if (item.type == 'podcast') {
case 'podcast':
return DidvanIcons.podcast_light;
}
if (item.type == 'delphi') {
case 'delphi':
return DidvanIcons.saha_light;
}
case 'infography':
return DidvanIcons.info_circle_light;
default:
return DidvanIcons.radar_light;
}
}
@override
Widget build(BuildContext context) {
@ -191,8 +192,12 @@ class MultitypeOverview extends StatelessWidget {
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
if (enableCaption)
Column(
Expanded(
child: Column(
children: [
const SizedBox(height: 8),
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,
),
],
),
],
),
);