Add enableBookmark parameter to MultitypeOverview and use it in Bookmarks and FilteredBookmarks
The diff adds an `enableBookmark` parameter to the `MultitypeOverview` widget and uses it in the `_BookmarksState` and `_FilteredBookmarksState` to conditionally render the `BookmarkButton`. This allows for more flexibility in rendering the overview widget.
This commit is contained in:
parent
213e000aee
commit
f12cf98fd9
|
|
@ -133,6 +133,7 @@ class _BookmarksState extends State<Bookmarks> {
|
|||
onMarkChanged: state.onMarkChanged,
|
||||
hasUnmarkConfirmation: true,
|
||||
enableCaption: true,
|
||||
enableBookmark: true,
|
||||
);
|
||||
},
|
||||
placeholder: MultitypeOverview.placeholder,
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class _FilteredBookmarksState extends State<FilteredBookmarks> {
|
|||
value,
|
||||
true,
|
||||
),
|
||||
enableBookmark: true,
|
||||
);
|
||||
// if (state.type == 'radar') {
|
||||
// return RadarOverview(
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class MultitypeOverview extends StatelessWidget {
|
|||
final bool hasUnmarkConfirmation;
|
||||
final void Function(int id, bool value) onMarkChanged;
|
||||
final bool enableCaption;
|
||||
final bool enableBookmark;
|
||||
|
||||
const MultitypeOverview({
|
||||
Key? key,
|
||||
|
|
@ -33,6 +34,7 @@ class MultitypeOverview extends StatelessWidget {
|
|||
required this.onMarkChanged,
|
||||
this.hasUnmarkConfirmation = false,
|
||||
this.enableCaption = false,
|
||||
this.enableBookmark = false,
|
||||
}) : super(key: key);
|
||||
|
||||
get _targetPageArgs {
|
||||
|
|
@ -251,6 +253,7 @@ class MultitypeOverview extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
if (!enableCaption) const Spacer(),
|
||||
if (enableBookmark) ...[
|
||||
const SizedBox(
|
||||
width: 12,
|
||||
),
|
||||
|
|
@ -263,6 +266,7 @@ class MultitypeOverview extends StatelessWidget {
|
|||
askForConfirmation: true,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue