Add more icons

This commit is contained in:
problematicconsumer
2023-07-26 20:10:43 +03:30
parent d96a8fbcc5
commit b66a3364e1
3 changed files with 9 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:hiddify/core/locale/locale.dart'; import 'package:hiddify/core/locale/locale.dart';
enum ProfilesSort { enum ProfilesSort {
@@ -10,4 +11,9 @@ enum ProfilesSort {
name => t.profile.sortBy.name, name => t.profile.sortBy.name,
}; };
} }
IconData get icon => switch (this) {
lastUpdate => Icons.update,
name => Icons.sort_by_alpha,
};
} }

View File

@@ -162,7 +162,7 @@ class ProfileActionButton extends HookConsumerWidget {
ref.read(profilesNotifierProvider.notifier).updateProfile(profile), ref.read(profilesNotifierProvider.notifier).updateProfile(profile),
); );
}, },
child: const Icon(Icons.refresh), child: const Icon(Icons.update),
); );
} }
return ProfileActionsMenu( return ProfileActionsMenu(
@@ -211,7 +211,7 @@ class ProfileActionsMenu extends HookConsumerWidget {
builder: builder, builder: builder,
menuChildren: [ menuChildren: [
MenuItemButton( MenuItemButton(
leadingIcon: const Icon(Icons.refresh), leadingIcon: const Icon(Icons.update),
child: Text(t.profile.update.buttonTxt.titleCase), child: Text(t.profile.update.buttonTxt.titleCase),
onPressed: () { onPressed: () {
if (updateProfileMutation.state.isInProgress) { if (updateProfileMutation.state.isInProgress) {

View File

@@ -115,6 +115,7 @@ class ProfilesSortModal extends HookConsumerWidget {
} }
}, },
selected: selected, selected: selected,
leading: Icon(e.icon),
trailing: selected trailing: selected
? IconButton( ? IconButton(
onPressed: () { onPressed: () {