Prepare RuleGel 1.0
This commit is contained in:
@@ -17,6 +17,7 @@ class PostCard extends StatefulWidget {
|
||||
required this.onFavorite,
|
||||
this.onAddToCollection,
|
||||
this.onPreview,
|
||||
this.onHide,
|
||||
this.onToggleSelected,
|
||||
this.selectionMode = false,
|
||||
this.selected = false,
|
||||
@@ -32,6 +33,7 @@ class PostCard extends StatefulWidget {
|
||||
final VoidCallback onFavorite;
|
||||
final VoidCallback? onAddToCollection;
|
||||
final VoidCallback? onPreview;
|
||||
final VoidCallback? onHide;
|
||||
final VoidCallback? onToggleSelected;
|
||||
final bool selectionMode;
|
||||
final bool selected;
|
||||
@@ -95,6 +97,11 @@ class _PostCardState extends State<PostCard> {
|
||||
onTap: widget.onAddToCollection,
|
||||
child: const Text('Add to collection'),
|
||||
),
|
||||
if (widget.onHide != null)
|
||||
PopupMenuItem(
|
||||
onTap: widget.onHide,
|
||||
child: const Text('Hide post'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
@@ -217,6 +224,15 @@ class _PostCardState extends State<PostCard> {
|
||||
onPressed: widget.onAddToCollection,
|
||||
icon: const Icon(Icons.add_rounded),
|
||||
),
|
||||
if (widget.onHide != null) ...[
|
||||
const SizedBox(width: 6),
|
||||
IconButton.filledTonal(
|
||||
tooltip: 'Hide post',
|
||||
onPressed: widget.onHide,
|
||||
icon:
|
||||
const Icon(Icons.visibility_off_rounded),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -17,6 +17,7 @@ class PostMasonryGrid extends StatelessWidget {
|
||||
required this.onFavorite,
|
||||
this.onAddToCollection,
|
||||
this.onPreview,
|
||||
this.onHide,
|
||||
this.onToggleSelected,
|
||||
this.selectionMode = false,
|
||||
this.selectedKeys = const {},
|
||||
@@ -36,6 +37,7 @@ class PostMasonryGrid extends StatelessWidget {
|
||||
final ValueChanged<Post> onFavorite;
|
||||
final ValueChanged<Post>? onAddToCollection;
|
||||
final ValueChanged<Post>? onPreview;
|
||||
final ValueChanged<Post>? onHide;
|
||||
final ValueChanged<Post>? onToggleSelected;
|
||||
final bool selectionMode;
|
||||
final Set<String> selectedKeys;
|
||||
@@ -66,6 +68,7 @@ class PostMasonryGrid extends StatelessWidget {
|
||||
onOpen: () => onOpen(post),
|
||||
onFavorite: () => onFavorite(post),
|
||||
onPreview: onPreview == null ? null : () => onPreview!(post),
|
||||
onHide: onHide == null ? null : () => onHide!(post),
|
||||
selectionMode: selectionMode,
|
||||
selected: selectedKeys.contains(post.cacheKey),
|
||||
onToggleSelected:
|
||||
|
||||
Reference in New Issue
Block a user