Skip to content

Commit

Permalink
feat(post): Show value of current required permission
Browse files Browse the repository at this point in the history
  • Loading branch information
realth000 committed Sep 12, 2024
1 parent e2ff00a commit 7452936
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions lib/features/post/view/post_edit_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,23 +467,28 @@ class _PostEditPageState extends State<PostEditPage> with LoggerMixin {
_showAdditionalOptionBottomSheet(context, state),
),
if (state.content?.permList?.isNotEmpty ?? false)
IconButton(
icon: const Icon(Icons.lock_open_outlined),
selectedIcon: const Icon(Icons.lock_outline),
isSelected: perm != null && perm!.isNotEmpty,
onPressed: () async {
final selectedPerm = await showSelectPermDialog(
context,
state.content!.permList!,
perm,
);
if (selectedPerm == null || !context.mounted) {
return;
}
setState(() {
perm = selectedPerm;
});
},
Badge(
label: Text('$perm'),
offset: const Offset(-1, -1),
isLabelVisible: perm != null && perm!.isNotEmpty,
child: IconButton(
icon: const Icon(Icons.lock_open_outlined),
selectedIcon: const Icon(Icons.lock_outline),
isSelected: perm != null && perm!.isNotEmpty,
onPressed: () async {
final selectedPerm = await showSelectPermDialog(
context,
state.content!.permList!,
perm,
);
if (selectedPerm == null || !context.mounted) {
return;
}
setState(() {
perm = selectedPerm;
});
},
),
),
],
),
Expand Down

0 comments on commit 7452936

Please sign in to comment.