Skip to content

Commit

Permalink
给上下文菜单加图标
Browse files Browse the repository at this point in the history
  • Loading branch information
frg2089 committed Feb 16, 2024
1 parent bfa9b3e commit 9802ce4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/fluent/component/illust_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,33 @@ class _IllustCardState extends State<IllustCard> {
child: _build(context),
items: [
MenuFlyoutItem(
text: Text('Like'),
leading: Observer(builder: (context) {
switch (store.state) {
case 0:
return Icon(FluentIcons.heart);
case 1:
return Icon(FluentIcons.heart_fill);
default:
return Icon(
FluentIcons.heart_fill,
color: Colors.red,
);
}
}),
text: Text(I18n.of(context).bookmark),
onPressed: () async {
await _onStar();
},
),
MenuFlyoutItem(
leading: Icon(FluentIcons.save),
text: Text(I18n.of(context).save),
onPressed: () async {
await _onSave();
},
),
MenuFlyoutItem(
leading: Icon(FluentIcons.favorite_list),
text: Text(I18n.of(context).favorited_tag),
onPressed: () async {
final result = await showDialog<dynamic>(
Expand Down

0 comments on commit 9802ce4

Please sign in to comment.