Change icons
This commit is contained in:
23
lib/core/widget/adaptive_icon.dart
Normal file
23
lib/core/widget/adaptive_icon.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AdaptiveIcon {
|
||||
AdaptiveIcon(BuildContext context) : platform = Theme.of(context).platform;
|
||||
|
||||
final TargetPlatform platform;
|
||||
|
||||
IconData get more => switch (platform) {
|
||||
TargetPlatform.iOS ||
|
||||
TargetPlatform.macOS =>
|
||||
FluentIcons.more_horizontal_24_regular,
|
||||
_ => FluentIcons.more_vertical_24_regular,
|
||||
};
|
||||
|
||||
IconData get share => switch (platform) {
|
||||
TargetPlatform.android => FluentIcons.share_android_24_regular,
|
||||
TargetPlatform.iOS ||
|
||||
TargetPlatform.macOS =>
|
||||
FluentIcons.share_ios_24_regular,
|
||||
_ => FluentIcons.share_24_regular,
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hiddify/utils/platform_utils.dart';
|
||||
@@ -120,7 +121,8 @@ class AdaptiveMenu extends HookConsumerWidget {
|
||||
ListTile(
|
||||
title: Text(item.title),
|
||||
leading: item.icon != null ? Icon(item.icon) : null,
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
trailing:
|
||||
const Icon(FluentIcons.chevron_right_20_regular, size: 20),
|
||||
onTap: () {
|
||||
pageIndexNotifier.value = subSheetIndex;
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TipCard extends StatelessWidget {
|
||||
@@ -16,7 +17,7 @@ class TipCard extends StatelessWidget {
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.lightbulb),
|
||||
child: Icon(FluentIcons.lightbulb_24_regular),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
@@ -12,7 +13,7 @@ Future<bool> showConfirmationDialog(
|
||||
builder: (context) {
|
||||
final localizations = MaterialLocalizations.of(context);
|
||||
return AlertDialog(
|
||||
icon: const Icon(Icons.delete_forever),
|
||||
icon: const Icon(FluentIcons.delete_24_regular),
|
||||
title: Text(title),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/analytics/analytics_controller.dart';
|
||||
import 'package:hiddify/core/localization/locale_extensions.dart';
|
||||
@@ -19,7 +20,7 @@ class LocalePrefTile extends HookConsumerWidget {
|
||||
return ListTile(
|
||||
title: Text(t.settings.general.locale),
|
||||
subtitle: Text(locale.localeName),
|
||||
leading: const Icon(Icons.language),
|
||||
leading: const Icon(FluentIcons.local_language_24_regular),
|
||||
onTap: () async {
|
||||
final selectedLocale = await showDialog<AppLocale>(
|
||||
context: context,
|
||||
@@ -61,7 +62,7 @@ class RegionPrefTile extends HookConsumerWidget {
|
||||
return ListTile(
|
||||
title: Text(t.settings.general.region),
|
||||
subtitle: Text(region.present(t)),
|
||||
leading: const Icon(Icons.my_location),
|
||||
leading: const Icon(FluentIcons.globe_location_24_regular),
|
||||
onTap: () async {
|
||||
final selectedRegion = await showDialog<Region>(
|
||||
context: context,
|
||||
@@ -111,7 +112,7 @@ class EnableAnalyticsPrefTile extends HookConsumerWidget {
|
||||
t.settings.general.enableAnalyticsMsg,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
secondary: const Icon(Icons.bug_report),
|
||||
secondary: const Icon(FluentIcons.bug_24_regular),
|
||||
value: enabled,
|
||||
onChanged: (value) async {
|
||||
if (onChanged != null) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:dartx/dartx.dart';
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
@@ -46,9 +47,15 @@ class QRCodeScannerScreen extends HookConsumerWidget with PresLogger {
|
||||
builder: (context, state, child) {
|
||||
switch (state) {
|
||||
case TorchState.off:
|
||||
return const Icon(Icons.flash_off, color: Colors.grey);
|
||||
return const Icon(
|
||||
FluentIcons.flash_off_24_regular,
|
||||
color: Colors.grey,
|
||||
);
|
||||
case TorchState.on:
|
||||
return const Icon(Icons.flash_on, color: Colors.yellow);
|
||||
return const Icon(
|
||||
FluentIcons.flash_24_regular,
|
||||
color: Colors.yellow,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -56,17 +63,7 @@ class QRCodeScannerScreen extends HookConsumerWidget with PresLogger {
|
||||
onPressed: () => controller.toggleTorch(),
|
||||
),
|
||||
IconButton(
|
||||
icon: ValueListenableBuilder(
|
||||
valueListenable: controller.cameraFacingState,
|
||||
builder: (context, state, child) {
|
||||
switch (state) {
|
||||
case CameraFacing.front:
|
||||
return const Icon(Icons.camera_front);
|
||||
case CameraFacing.back:
|
||||
return const Icon(Icons.camera_rear);
|
||||
}
|
||||
},
|
||||
),
|
||||
icon: const Icon(FluentIcons.camera_switch_24_regular),
|
||||
tooltip: t.profile.add.qrScanner.facingSemanticLabel,
|
||||
onPressed: () => controller.switchCamera(),
|
||||
),
|
||||
@@ -103,7 +100,10 @@ class QRCodeScannerScreen extends HookConsumerWidget with PresLogger {
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(bottom: 8),
|
||||
child: Icon(Icons.error, color: Colors.white),
|
||||
child: Icon(
|
||||
FluentIcons.error_circle_24_regular,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Text(message),
|
||||
Text(error.errorDetails?.message ?? ''),
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import 'package:dartx/dartx.dart';
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:hiddify/core/model/range.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/core/widget/tip_card.dart';
|
||||
import 'package:hiddify/features/common/nested_app_bar.dart';
|
||||
import 'package:hiddify/features/config_option/model/config_option_entity.dart';
|
||||
@@ -45,6 +47,7 @@ class ConfigOptionsPage extends HookConsumerWidget {
|
||||
actions: [
|
||||
if (asyncOptions case AsyncData(value: final options))
|
||||
PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
@@ -483,7 +486,7 @@ class ConfigOptionsPage extends HookConsumerWidget {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.error),
|
||||
const Icon(FluentIcons.error_circle_24_regular),
|
||||
const Gap(2),
|
||||
Text(t.presentShortError(error)),
|
||||
const Gap(2),
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/core/widget/animated_visibility.dart';
|
||||
import 'package:hiddify/core/widget/tip_card.dart';
|
||||
import 'package:hiddify/features/geo_asset/overview/geo_assets_overview_notifier.dart';
|
||||
import 'package:hiddify/features/geo_asset/widget/geo_asset_tile.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
@@ -22,6 +25,7 @@ class GeoAssetsOverviewPage extends HookConsumerWidget {
|
||||
pinned: true,
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
@@ -39,13 +43,13 @@ class GeoAssetsOverviewPage extends HookConsumerWidget {
|
||||
),
|
||||
if (state case AsyncData(value: (:final geoip, :final geosite)))
|
||||
SliverPinnedHeader(
|
||||
child: AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: (geoip + geosite)
|
||||
child: AnimatedVisibility(
|
||||
visible: (geoip + geosite)
|
||||
.where((e) => e.$1.active && e.$2 == null)
|
||||
.isNotEmpty
|
||||
? const MissingRoutingAssetsCard()
|
||||
: const SizedBox(),
|
||||
.isNotEmpty,
|
||||
axis: Axis.vertical,
|
||||
child:
|
||||
TipCard(message: t.settings.geoAssets.missingGeoAssetsMsg),
|
||||
),
|
||||
),
|
||||
switch (state) {
|
||||
@@ -96,39 +100,3 @@ class GeoAssetsOverviewPage extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class MissingRoutingAssetsCard extends HookConsumerWidget {
|
||||
const MissingRoutingAssetsCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final t = ref.watch(translationsProvider);
|
||||
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Icon(Icons.lightbulb),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
child: Text(t.settings.geoAssets.missingGeoAssetsMsg),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:dartx/dartx.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/features/geo_asset/model/geo_asset_entity.dart';
|
||||
import 'package:hiddify/features/geo_asset/model/geo_asset_failure.dart';
|
||||
import 'package:hiddify/features/geo_asset/notifier/geo_asset_notifier.dart';
|
||||
@@ -95,6 +96,7 @@ class GeoAssetTile extends HookConsumerWidget {
|
||||
selected: geoAsset.active,
|
||||
onTap: onMarkAsActive,
|
||||
trailing: PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
@@ -20,7 +21,7 @@ class EmptyProfilesHomeBody extends HookConsumerWidget {
|
||||
const Gap(16),
|
||||
OutlinedButton.icon(
|
||||
onPressed: () => const AddProfileRoute().push(context),
|
||||
icon: const Icon(Icons.add),
|
||||
icon: const Icon(FluentIcons.add_24_regular),
|
||||
label: Text(t.profile.add.buttonText),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dartx/dartx.dart';
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/app_info/app_info_provider.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
@@ -48,7 +47,7 @@ class HomePage extends HookConsumerWidget {
|
||||
actions: [
|
||||
IconButton(
|
||||
onPressed: () => const AddProfileRoute().push(context),
|
||||
icon: const Icon(Icons.add_circle),
|
||||
icon: const Icon(FluentIcons.add_circle_24_filled),
|
||||
tooltip: t.profile.add.buttonText,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:fpdart/fpdart.dart';
|
||||
@@ -5,6 +6,7 @@ import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:hiddify/core/preferences/general_preferences.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/features/common/nested_app_bar.dart';
|
||||
import 'package:hiddify/features/log/data/log_data_providers.dart';
|
||||
import 'package:hiddify/features/log/model/log_level.dart';
|
||||
@@ -65,22 +67,26 @@ class LogsOverviewPage extends HookConsumerWidget with PresLogger {
|
||||
if (state.paused)
|
||||
IconButton(
|
||||
onPressed: notifier.resume,
|
||||
icon: const Icon(Icons.play_arrow),
|
||||
icon: const Icon(FluentIcons.play_20_regular),
|
||||
tooltip: t.logs.resumeTooltip,
|
||||
iconSize: 20,
|
||||
)
|
||||
else
|
||||
IconButton(
|
||||
onPressed: notifier.pause,
|
||||
icon: const Icon(Icons.pause),
|
||||
icon: const Icon(FluentIcons.pause_20_regular),
|
||||
tooltip: t.logs.pauseTooltip,
|
||||
iconSize: 20,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: notifier.clear,
|
||||
icon: const Icon(Icons.clear_all),
|
||||
icon: const Icon(FluentIcons.delete_lines_20_regular),
|
||||
tooltip: t.logs.clearTooltip,
|
||||
iconSize: 20,
|
||||
),
|
||||
if (popupButtons.isNotEmpty)
|
||||
PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return popupButtons;
|
||||
},
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import 'package:dartx/dartx.dart';
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/preferences/general_preferences.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/features/per_app_proxy/model/installed_package_info.dart';
|
||||
import 'package:hiddify/features/per_app_proxy/model/per_app_proxy_mode.dart';
|
||||
import 'package:hiddify/features/per_app_proxy/overview/per_app_proxy_notifier.dart';
|
||||
@@ -83,11 +85,12 @@ class PerAppProxyPage extends HookConsumerWidget with PresLogger {
|
||||
title: Text(t.settings.network.perAppProxyPageTitle),
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.search),
|
||||
icon: const Icon(FluentIcons.search_24_regular),
|
||||
onPressed: () => isSearching.value = true,
|
||||
tooltip: localizations.searchFieldLabel,
|
||||
),
|
||||
PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
@@ -179,7 +182,8 @@ class PerAppProxyPage extends HookConsumerWidget with PresLogger {
|
||||
.watch(packageIconProvider(package.packageName))
|
||||
.when(
|
||||
data: (data) => Image(image: data),
|
||||
error: (error, _) => const Icon(Icons.error),
|
||||
error: (error, _) =>
|
||||
const Icon(FluentIcons.error_circle_24_regular),
|
||||
loading: () => const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
@@ -99,7 +100,7 @@ class AddProfileModal extends HookConsumerWidget {
|
||||
_Button(
|
||||
key: const ValueKey("add_from_clipboard_button"),
|
||||
label: t.profile.add.fromClipboard,
|
||||
icon: Icons.content_paste,
|
||||
icon: FluentIcons.clipboard_paste_24_regular,
|
||||
size: buttonWidth,
|
||||
onTap: () async {
|
||||
final captureResult =
|
||||
@@ -116,7 +117,7 @@ class AddProfileModal extends HookConsumerWidget {
|
||||
_Button(
|
||||
key: const ValueKey("add_by_qr_code_button"),
|
||||
label: t.profile.add.scanQr,
|
||||
icon: Icons.qr_code_scanner,
|
||||
icon: FluentIcons.qr_code_24_regular,
|
||||
size: buttonWidth,
|
||||
onTap: () async {
|
||||
final captureResult =
|
||||
@@ -133,7 +134,7 @@ class AddProfileModal extends HookConsumerWidget {
|
||||
_Button(
|
||||
key: const ValueKey("add_manually_button"),
|
||||
label: t.profile.add.manually,
|
||||
icon: Icons.add,
|
||||
icon: FluentIcons.add_24_regular,
|
||||
size: buttonWidth,
|
||||
onTap: () async {
|
||||
context.pop();
|
||||
@@ -170,7 +171,7 @@ class AddProfileModal extends HookConsumerWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.add,
|
||||
FluentIcons.add_24_regular,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
const Gap(8),
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fpdart/fpdart.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/features/common/confirmation_dialogs.dart';
|
||||
import 'package:hiddify/features/profile/details/profile_details_notifier.dart';
|
||||
import 'package:hiddify/features/profile/model/profile_entity.dart';
|
||||
@@ -95,6 +97,7 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
|
||||
actions: [
|
||||
if (state.isEditing)
|
||||
PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
if (state.profile case RemoteProfileEntity())
|
||||
@@ -175,7 +178,8 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
|
||||
) ??
|
||||
t.general.toggle.disabled,
|
||||
),
|
||||
leading: const Icon(Icons.update),
|
||||
leading:
|
||||
const Icon(FluentIcons.arrow_sync_24_regular),
|
||||
onTap: () async {
|
||||
final intervalInHours =
|
||||
await SettingsInputDialog(
|
||||
@@ -185,7 +189,8 @@ class ProfileDetailsPage extends HookConsumerWidget with PresLogger {
|
||||
optionalAction: (
|
||||
t.general.state.disable,
|
||||
() => notifier.setField(
|
||||
updateInterval: none()),
|
||||
updateInterval: none(),
|
||||
),
|
||||
),
|
||||
validator: isPort,
|
||||
mapTo: int.tryParse,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
|
||||
@@ -13,8 +14,8 @@ enum ProfilesSort {
|
||||
}
|
||||
|
||||
IconData get icon => switch (this) {
|
||||
lastUpdate => Icons.update,
|
||||
name => Icons.sort_by_alpha,
|
||||
lastUpdate => FluentIcons.history_24_regular,
|
||||
name => FluentIcons.text_sort_ascending_24_regular,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
@@ -79,7 +80,7 @@ class ProfilesOverviewModal extends HookConsumerWidget {
|
||||
onPressed: () {
|
||||
const AddProfileRoute().push(context);
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
icon: const Icon(FluentIcons.add_24_filled),
|
||||
label: Text(t.profile.add.shortBtnTxt),
|
||||
),
|
||||
FilledButton.icon(
|
||||
@@ -91,7 +92,7 @@ class ProfilesOverviewModal extends HookConsumerWidget {
|
||||
},
|
||||
);
|
||||
},
|
||||
icon: const Icon(Icons.sort),
|
||||
icon: const Icon(FluentIcons.arrow_sort_24_filled),
|
||||
label: Text(t.general.sort),
|
||||
),
|
||||
FilledButton.icon(
|
||||
@@ -102,7 +103,7 @@ class ProfilesOverviewModal extends HookConsumerWidget {
|
||||
)
|
||||
.trigger();
|
||||
},
|
||||
icon: const Icon(Icons.update),
|
||||
icon: const Icon(FluentIcons.arrow_sync_24_filled),
|
||||
label: Text(t.profile.update.updateSubscriptions),
|
||||
),
|
||||
],
|
||||
@@ -159,7 +160,7 @@ class ProfilesSortModal extends HookConsumerWidget {
|
||||
turns: arrowTurn,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
child: Icon(
|
||||
Icons.arrow_upward,
|
||||
FluentIcons.arrow_sort_up_24_regular,
|
||||
semanticLabel: sort.mode.name,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -6,6 +7,7 @@ import 'package:go_router/go_router.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:hiddify/core/router/router.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_menu.dart';
|
||||
import 'package:hiddify/features/common/confirmation_dialogs.dart';
|
||||
import 'package:hiddify/features/common/qr_code_dialog.dart';
|
||||
@@ -132,7 +134,10 @@ class ProfileTile extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
const Icon(Icons.arrow_drop_down),
|
||||
const Icon(
|
||||
FluentIcons.caret_down_16_filled,
|
||||
size: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -196,7 +201,7 @@ class ProfileActionButton extends HookConsumerWidget {
|
||||
.read(updateProfileProvider(profile.id).notifier)
|
||||
.updateProfile(profile as RemoteProfileEntity);
|
||||
},
|
||||
child: const Icon(Icons.update),
|
||||
child: const Icon(FluentIcons.arrow_sync_24_filled),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -210,7 +215,7 @@ class ProfileActionButton extends HookConsumerWidget {
|
||||
message: MaterialLocalizations.of(context).showMenuTooltip,
|
||||
child: InkWell(
|
||||
onTap: toggleVisibility,
|
||||
child: const Icon(Icons.more_vert),
|
||||
child: Icon(AdaptiveIcon(context).more),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -248,7 +253,7 @@ class ProfileActionsMenu extends HookConsumerWidget {
|
||||
if (profile case RemoteProfileEntity())
|
||||
AdaptiveMenuItem(
|
||||
title: t.profile.update.buttonTxt,
|
||||
icon: Icons.update,
|
||||
icon: FluentIcons.arrow_sync_24_regular,
|
||||
onTap: () {
|
||||
if (ref.read(updateProfileProvider(profile.id)).isLoading) {
|
||||
return;
|
||||
@@ -260,7 +265,7 @@ class ProfileActionsMenu extends HookConsumerWidget {
|
||||
),
|
||||
AdaptiveMenuItem(
|
||||
title: t.profile.share.buttonText,
|
||||
icon: Icons.share,
|
||||
icon: AdaptiveIcon(context).share,
|
||||
subItems: [
|
||||
if (profile case RemoteProfileEntity(:final url, :final name)) ...[
|
||||
AdaptiveMenuItem(
|
||||
@@ -305,14 +310,14 @@ class ProfileActionsMenu extends HookConsumerWidget {
|
||||
],
|
||||
),
|
||||
AdaptiveMenuItem(
|
||||
icon: Icons.edit,
|
||||
icon: FluentIcons.edit_24_regular,
|
||||
title: t.profile.edit.buttonTxt,
|
||||
onTap: () async {
|
||||
await ProfileDetailsRoute(profile.id).push(context);
|
||||
},
|
||||
),
|
||||
AdaptiveMenuItem(
|
||||
icon: Icons.delete,
|
||||
icon: FluentIcons.delete_24_regular,
|
||||
title: t.profile.delete.buttonTxt,
|
||||
onTap: () async {
|
||||
if (deleteProfileMutation.state.isInProgress) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
@@ -29,7 +30,7 @@ class ProxiesOverviewPage extends HookConsumerWidget with PresLogger {
|
||||
PopupMenuButton<ProxiesSort>(
|
||||
initialValue: sortBy,
|
||||
onSelected: ref.read(proxiesSortNotifierProvider.notifier).update,
|
||||
icon: const Icon(Icons.sort),
|
||||
icon: const Icon(FluentIcons.arrow_sort_24_regular),
|
||||
tooltip: t.proxies.sortTooltip,
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
@@ -131,7 +132,7 @@ class ProxiesOverviewPage extends HookConsumerWidget with PresLogger {
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () async => notifier.urlTest(group.tag),
|
||||
tooltip: t.proxies.delayTestTooltip,
|
||||
child: const Icon(Icons.bolt),
|
||||
child: const Icon(FluentIcons.flash_24_filled),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
@@ -6,6 +7,7 @@ import 'package:hiddify/core/directories/directories_provider.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/model/constants.dart';
|
||||
import 'package:hiddify/core/model/failures.dart';
|
||||
import 'package:hiddify/core/widget/adaptive_icon.dart';
|
||||
import 'package:hiddify/features/app_update/notifier/app_update_notifier.dart';
|
||||
import 'package:hiddify/features/app_update/notifier/app_update_state.dart';
|
||||
import 'package:hiddify/features/app_update/widget/new_version_dialog.dart';
|
||||
@@ -54,7 +56,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
_ => const Icon(Icons.update),
|
||||
_ => const Icon(FluentIcons.arrow_sync_24_regular),
|
||||
},
|
||||
onTap: () async {
|
||||
await ref.read(appUpdateNotifierProvider.notifier).check();
|
||||
@@ -63,7 +65,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
if (PlatformUtils.isDesktop)
|
||||
ListTile(
|
||||
title: Text(t.settings.general.openWorkingDir),
|
||||
trailing: const Icon(Icons.arrow_outward_outlined),
|
||||
trailing: const Icon(FluentIcons.open_folder_24_regular),
|
||||
onTap: () async {
|
||||
final path =
|
||||
ref.watch(appDirectoriesProvider).requireValue.workingDir.uri;
|
||||
@@ -79,6 +81,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
title: Text(t.about.pageTitle),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
icon: Icon(AdaptiveIcon(context).more),
|
||||
itemBuilder: (context) {
|
||||
return [
|
||||
PopupMenuItem(
|
||||
@@ -126,7 +129,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
if (conditionalTiles.isNotEmpty) const Divider(),
|
||||
ListTile(
|
||||
title: Text(t.about.sourceCode),
|
||||
trailing: const Icon(Icons.open_in_new),
|
||||
trailing: const Icon(FluentIcons.open_24_regular),
|
||||
onTap: () async {
|
||||
await UriUtils.tryLaunch(
|
||||
Uri.parse(Constants.githubUrl),
|
||||
@@ -135,7 +138,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
),
|
||||
ListTile(
|
||||
title: Text(t.about.telegramChannel),
|
||||
trailing: const Icon(Icons.open_in_new),
|
||||
trailing: const Icon(FluentIcons.open_24_regular),
|
||||
onTap: () async {
|
||||
await UriUtils.tryLaunch(
|
||||
Uri.parse(Constants.telegramChannelUrl),
|
||||
@@ -144,7 +147,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
),
|
||||
ListTile(
|
||||
title: Text(t.about.termsAndConditions),
|
||||
trailing: const Icon(Icons.open_in_new),
|
||||
trailing: const Icon(FluentIcons.open_24_regular),
|
||||
onTap: () async {
|
||||
await UriUtils.tryLaunch(
|
||||
Uri.parse(Constants.termsAndConditionsUrl),
|
||||
@@ -153,7 +156,7 @@ class AboutPage extends HookConsumerWidget {
|
||||
),
|
||||
ListTile(
|
||||
title: Text(t.about.privacyPolicy),
|
||||
trailing: const Icon(Icons.open_in_new),
|
||||
trailing: const Icon(FluentIcons.open_24_regular),
|
||||
onTap: () async {
|
||||
await UriUtils.tryLaunch(
|
||||
Uri.parse(Constants.privacyPolicyUrl),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/preferences/general_preferences.dart';
|
||||
@@ -25,7 +26,9 @@ class AdvancedSettingTiles extends HookConsumerWidget {
|
||||
const RegionPrefTile(),
|
||||
ListTile(
|
||||
title: Text(t.settings.geoAssets.pageTitle),
|
||||
leading: const Icon(Icons.folder),
|
||||
leading: const Icon(
|
||||
FluentIcons.arrow_routing_rectangle_multiple_24_regular,
|
||||
),
|
||||
onTap: () async {
|
||||
await const GeoAssetsRoute().push(context);
|
||||
},
|
||||
@@ -33,7 +36,7 @@ class AdvancedSettingTiles extends HookConsumerWidget {
|
||||
if (Platform.isAndroid) ...[
|
||||
ListTile(
|
||||
title: Text(t.settings.network.perAppProxyPageTitle),
|
||||
leading: const Icon(Icons.apps),
|
||||
leading: const Icon(FluentIcons.apps_list_detail_24_regular),
|
||||
trailing: Switch(
|
||||
value: perAppProxy,
|
||||
onChanged: (value) async {
|
||||
@@ -61,7 +64,7 @@ class AdvancedSettingTiles extends HookConsumerWidget {
|
||||
title: Text(t.settings.advanced.memoryLimit),
|
||||
subtitle: Text(t.settings.advanced.memoryLimitMsg),
|
||||
value: !disableMemoryLimit,
|
||||
secondary: const Icon(Icons.memory),
|
||||
secondary: const Icon(FluentIcons.developer_board_24_regular),
|
||||
onChanged: (value) async {
|
||||
await ref.read(disableMemoryLimitProvider.notifier).update(!value);
|
||||
},
|
||||
@@ -69,7 +72,7 @@ class AdvancedSettingTiles extends HookConsumerWidget {
|
||||
if (Platform.isIOS)
|
||||
ListTile(
|
||||
title: Text(t.settings.advanced.resetTunnel),
|
||||
leading: const Icon(Icons.restart_alt),
|
||||
leading: const Icon(FluentIcons.arrow_reset_24_regular),
|
||||
onTap: () async {
|
||||
await ref.read(resetTunnelProvider.notifier).run();
|
||||
},
|
||||
@@ -77,7 +80,7 @@ class AdvancedSettingTiles extends HookConsumerWidget {
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.advanced.debugMode),
|
||||
value: debug,
|
||||
secondary: const Icon(Icons.bug_report),
|
||||
secondary: const Icon(FluentIcons.window_dev_tools_24_regular),
|
||||
onChanged: (value) async {
|
||||
if (value) {
|
||||
await showDialog<bool>(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/core/preferences/general_preferences.dart';
|
||||
@@ -25,7 +26,7 @@ class GeneralSettingTiles extends HookConsumerWidget {
|
||||
ListTile(
|
||||
title: Text(t.settings.general.themeMode),
|
||||
subtitle: Text(themeMode.present(t)),
|
||||
leading: const Icon(Icons.light_mode),
|
||||
leading: const Icon(FluentIcons.weather_moon_20_regular),
|
||||
onTap: () async {
|
||||
final selectedThemeMode = await showDialog<AppThemeMode>(
|
||||
context: context,
|
||||
@@ -56,7 +57,7 @@ class GeneralSettingTiles extends HookConsumerWidget {
|
||||
if (Platform.isAndroid)
|
||||
SwitchListTile(
|
||||
title: Text(t.settings.general.dynamicNotification),
|
||||
secondary: const Icon(Icons.speed),
|
||||
secondary: const Icon(FluentIcons.top_speed_24_regular),
|
||||
value: ref.watch(dynamicNotificationProvider),
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hiddify/core/localization/translations.dart';
|
||||
import 'package:hiddify/features/settings/notifier/platform_settings_notifier.dart';
|
||||
@@ -18,7 +19,7 @@ class PlatformSettingsTiles extends HookConsumerWidget {
|
||||
ListTile buildIgnoreTile(bool enabled) => ListTile(
|
||||
title: Text(t.settings.general.ignoreBatteryOptimizations),
|
||||
subtitle: Text(t.settings.general.ignoreBatteryOptimizationsMsg),
|
||||
leading: const Icon(Icons.running_with_errors),
|
||||
leading: const Icon(FluentIcons.battery_saver_24_regular),
|
||||
enabled: enabled,
|
||||
onTap: () async {
|
||||
await ref
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toastification/toastification.dart';
|
||||
|
||||
@@ -73,13 +74,13 @@ class CustomToast extends StatelessWidget {
|
||||
this.message, {
|
||||
this.duration = const Duration(seconds: 5),
|
||||
}) : type = AlertType.error,
|
||||
icon = Icons.error;
|
||||
icon = FluentIcons.error_circle_24_regular;
|
||||
|
||||
const CustomToast.success(
|
||||
this.message, {
|
||||
this.duration = const Duration(seconds: 3),
|
||||
}) : type = AlertType.success,
|
||||
icon = Icons.check;
|
||||
icon = FluentIcons.checkmark_24_regular;
|
||||
|
||||
final String message;
|
||||
final AlertType type;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
@@ -39,7 +40,7 @@ class SliverErrorBodyPlaceholder extends HookConsumerWidget {
|
||||
const SliverErrorBodyPlaceholder(
|
||||
this.msg, {
|
||||
super.key,
|
||||
this.icon = Icons.error,
|
||||
this.icon = FluentIcons.error_circle_24_regular,
|
||||
});
|
||||
|
||||
final String msg;
|
||||
|
||||
Reference in New Issue
Block a user