"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:
parent
e606555234
commit
0173a5240c
|
|
@ -56,6 +56,9 @@ class OverviewData {
|
|||
case 'saha':
|
||||
typeInteger = 6;
|
||||
break;
|
||||
case 'infography':
|
||||
typeInteger = 7;
|
||||
break;
|
||||
default:
|
||||
typeInteger = 5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,22 +62,22 @@ class MultitypeOverview extends StatelessWidget {
|
|||
}
|
||||
|
||||
IconData get _icon {
|
||||
if (item.type == 'radar') {
|
||||
return DidvanIcons.scanning_light;
|
||||
switch (item.type) {
|
||||
case 'radar':
|
||||
return DidvanIcons.scanning_light;
|
||||
case 'news':
|
||||
return DidvanIcons.foolad_light;
|
||||
case 'video':
|
||||
return DidvanIcons.video_light;
|
||||
case 'podcast':
|
||||
return DidvanIcons.podcast_light;
|
||||
case 'delphi':
|
||||
return DidvanIcons.saha_light;
|
||||
case 'infography':
|
||||
return DidvanIcons.info_circle_light;
|
||||
default:
|
||||
return DidvanIcons.radar_light;
|
||||
}
|
||||
if (item.type == 'news') {
|
||||
return DidvanIcons.foolad_light;
|
||||
}
|
||||
if (item.type == 'video') {
|
||||
return DidvanIcons.video_light;
|
||||
}
|
||||
if (item.type == 'podcast') {
|
||||
return DidvanIcons.podcast_light;
|
||||
}
|
||||
if (item.type == 'delphi') {
|
||||
return DidvanIcons.saha_light;
|
||||
}
|
||||
return DidvanIcons.radar_light;
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -191,56 +192,75 @@ class MultitypeOverview extends StatelessWidget {
|
|||
),
|
||||
],
|
||||
),
|
||||
if (enableCaption)
|
||||
Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.edit_outlined,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.caption,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(
|
||||
'یادداشتهای من',
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
color: Theme.of(context).colorScheme.caption,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
if (enableCaption)
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.edit_outlined,
|
||||
size: 16,
|
||||
color: Theme.of(context).colorScheme.caption,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(
|
||||
'یادداشتهای من',
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
color: Theme.of(context).colorScheme.caption,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).colorScheme.border,
|
||||
Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
height: 1,
|
||||
color: Theme.of(context).colorScheme.border,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
DidvanTextField(
|
||||
disableBorders: true,
|
||||
initialValue: item.description,
|
||||
hintText: 'برای اضافه کردن یادداشت لمس کنید.',
|
||||
onChanged: (value) => UserProvider.changeItemMark(
|
||||
item.type,
|
||||
item.id,
|
||||
null,
|
||||
description: value,
|
||||
DidvanTextField(
|
||||
disableBorders: true,
|
||||
initialValue: item.description,
|
||||
hintText: 'برای اضافه کردن یادداشت لمس کنید.',
|
||||
onChanged: (value) => UserProvider.changeItemMark(
|
||||
item.type,
|
||||
item.id,
|
||||
null,
|
||||
description: value,
|
||||
),
|
||||
isSmall: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
isSmall: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue