An open-source cross-platform alternative to AirDrop
refactor: use view models for all tabs
Tien Do Name6aea1624eba
diff --git a/app/assets/i18n/_unused_translations.json b/app/assets/i18n/_unused_translations.jsonindex 3a91c7df..de890798 100644--- a/app/assets/i18n/_unused_translations.json+++ b/app/assets/i18n/_unused_translations.json@@ -26,6 +26,7 @@"es-ES": {},"eu": {},"fa": {},+ "fil-PH": {},"fr-FR": {},"he": {},"hu": {},diff --git a/app/lib/gen/strings.g.dart b/app/lib/gen/strings.g.dartindex d29016ff..ec126a5a 100644--- a/app/lib/gen/strings.g.dart+++ b/app/lib/gen/strings.g.dart@@ -3,8 +3,8 @@/// Original: assets/i18n/// To regenerate, run: `dart run slang`///-/// Locales: 31-/// Strings: 8238 (265 per locale)+/// Locales: 32+/// Strings: 8551 (267 per locale)// coverage:ignore-file@@ -24,6 +24,7 @@ part 'strings_de.g.dart';part 'strings_es_ES.g.dart';part 'strings_eu.g.dart';part 'strings_fa.g.dart';+part 'strings_fil_PH.g.dart';part 'strings_fr_FR.g.dart';part 'strings_he.g.dart';part 'strings_hu.g.dart';@@ -65,6 +66,7 @@ enum AppLocale with BaseAppLocale<AppLocale, _StringsEn> {esEs(languageCode: 'es', countryCode: 'ES', build: _StringsEsEs.build),eu(languageCode: 'eu', build: _StringsEu.build),fa(languageCode: 'fa', build: _StringsFa.build),+ filPh(languageCode: 'fil', countryCode: 'PH', build: _StringsFilPh.build),frFr(languageCode: 'fr', countryCode: 'FR', build: _StringsFrFr.build),he(languageCode: 'he', build: _StringsHe.build),hu(languageCode: 'hu', build: _StringsHu.build),diff --git a/app/lib/gen/strings_en.g.dart b/app/lib/gen/strings_en.g.dartindex 056570ab..f36109ae 100644--- a/app/lib/gen/strings_en.g.dart+++ b/app/lib/gen/strings_en.g.dart@@ -710,7 +710,7 @@ class _StringsDialogsFavoriteEditDialogEn {// TranslationsString get titleAdd => 'Add to favorites';- String get titleEdit => 'Adjust';+ String get titleEdit => 'Adjustment';String get name => 'Alias';String get auto => '(auto)';String get ip => 'IP Address';diff --git a/app/lib/gen/strings_fil_PH.g.dart b/app/lib/gen/strings_fil_PH.g.dartnew file mode 100644index 00000000..ae9ec17c--- /dev/null+++ b/app/lib/gen/strings_fil_PH.g.dart@@ -0,0 +1,907 @@+part of 'strings.g.dart';++// Path: <root>+class _StringsFilPh extends _StringsEn {++ /// You can call this constructor and build your own translation instance of this locale.+ /// Constructing via the enum [AppLocale.build] is preferred.+ _StringsFilPh.build({Map<String, Node>? overrides, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver})+ : assert(overrides == null, 'Set "translation_overrides: true" in order to enable this feature.'),+ $meta = TranslationMetadata(+ locale: AppLocale.filPh,+ overrides: overrides ?? {},+ cardinalResolver: cardinalResolver,+ ordinalResolver: ordinalResolver,+ ),+ super.build(cardinalResolver: cardinalResolver, ordinalResolver: ordinalResolver);++ /// Metadata for the translations of <fil-PH>.+ @override final TranslationMetadata<AppLocale, _StringsEn> $meta;++ @override late final _StringsFilPh _root = this; // ignore: unused_field++ // Translations+ @override String get locale => 'Filipino';+ @override String get appName => 'LocalSend';+ @override late final _StringsGeneralFilPh general = _StringsGeneralFilPh._(_root);+ @override late final _StringsReceiveTabFilPh receiveTab = _StringsReceiveTabFilPh._(_root);+ @override late final _StringsSendTabFilPh sendTab = _StringsSendTabFilPh._(_root);+ @override late final _StringsSettingsTabFilPh settingsTab = _StringsSettingsTabFilPh._(_root);+ @override late final _StringsTroubleshootPageFilPh troubleshootPage = _StringsTroubleshootPageFilPh._(_root);+ @override late final _StringsReceiveHistoryPageFilPh receiveHistoryPage = _StringsReceiveHistoryPageFilPh._(_root);+ @override late final _StringsApkPickerPageFilPh apkPickerPage = _StringsApkPickerPageFilPh._(_root);+ @override late final _StringsSelectedFilesPageFilPh selectedFilesPage = _StringsSelectedFilesPageFilPh._(_root);+ @override late final _StringsReceivePageFilPh receivePage = _StringsReceivePageFilPh._(_root);+ @override late final _StringsReceiveOptionsPageFilPh receiveOptionsPage = _StringsReceiveOptionsPageFilPh._(_root);+ @override late final _StringsSendPageFilPh sendPage = _StringsSendPageFilPh._(_root);+ @override late final _StringsProgressPageFilPh progressPage = _StringsProgressPageFilPh._(_root);+ @override late final _StringsWebSharePageFilPh webSharePage = _StringsWebSharePageFilPh._(_root);+ @override late final _StringsAboutPageFilPh aboutPage = _StringsAboutPageFilPh._(_root);+ @override late final _StringsChangelogPageFilPh changelogPage = _StringsChangelogPageFilPh._(_root);+ @override late final _StringsAliasGeneratorFilPh aliasGenerator = _StringsAliasGeneratorFilPh._(_root);+ @override late final _StringsDialogsFilPh dialogs = _StringsDialogsFilPh._(_root);+ @override late final _StringsTrayFilPh tray = _StringsTrayFilPh._(_root);+ @override late final _StringsWebFilPh web = _StringsWebFilPh._(_root);+ @override late final _StringsAssetPickerFilPh assetPicker = _StringsAssetPickerFilPh._(_root);+}++// Path: general+class _StringsGeneralFilPh extends _StringsGeneralEn {+ _StringsGeneralFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get accept => 'Tanggapin';+ @override String get accepted => 'Tinanggap';+ @override String get add => 'Magdagdag';+ @override String get advanced => 'Advanced';+ @override String get cancel => 'Kanselahin';+ @override String get close => 'Isara';+ @override String get confirm => 'Kumpirmahin';+ @override String get continueStr => 'Magpatuloy';+ @override String get copy => 'Kopyahin';+ @override String get copiedToClipboard => 'Kopyahin sa Clipboard';+ @override String get decline => 'Tanggihan';+ @override String get done => 'Tapusin';+ @override String get delete => 'Tanggalin';+ @override String get edit => 'Baguhin';+ @override String get error => 'Error';+ @override String get example => 'Halimbawa';+ @override String get files => 'Files';+ @override String get finished => 'Tapos Na';+ @override String get hide => 'Itago';+ @override String get off => 'Sarado';+ @override String get offline => 'Offline';+ @override String get on => 'Bukas';+ @override String get online => 'Online';+ @override String get open => 'Buksan';+ @override String get queue => 'Pila';+ @override String get quickSave => 'Quick Save';+ @override String get renamed => 'Pinangalanan';+ @override String get reset => 'Reset';+ @override String get restart => 'Restart';+ @override String get settings => 'Settings';+ @override String get skipped => 'Nilaktawan';+ @override String get start => 'Simulan';+ @override String get stop => 'Ihinto';+ @override String get save => 'Save';+ @override String get unchanged => 'Walang Pagbabago';+ @override String get unknown => 'Hindi Kilala';+ @override String get noItemInClipboard => 'Walang Item sa Clipboard';+}++// Path: receiveTab+class _StringsReceiveTabFilPh extends _StringsReceiveTabEn {+ _StringsReceiveTabFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Tumanggap';+ @override late final _StringsReceiveTabInfoBoxFilPh infoBox = _StringsReceiveTabInfoBoxFilPh._(_root);+}++// Path: sendTab+class _StringsSendTabFilPh extends _StringsSendTabEn {+ _StringsSendTabFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Magpadala';+ @override late final _StringsSendTabSelectionFilPh selection = _StringsSendTabSelectionFilPh._(_root);+ @override late final _StringsSendTabPickerFilPh picker = _StringsSendTabPickerFilPh._(_root);+ @override String get shareIntentInfo => 'Maaring gamitin ang "Share" feature sa iyong mobile device para sa mas madaling pagpili ng mga files.';+ @override String get nearbyDevices => 'Malalapit na mga device';+ @override String get thisDevice => 'Ang Device na Ito';+ @override String get scan => 'Maghanap ng mga device';+ @override String get sendMode => 'Send mode';+ @override late final _StringsSendTabSendModesFilPh sendModes = _StringsSendTabSendModesFilPh._(_root);+ @override String get sendModeHelp => 'Paliwanag';+ @override String get help => 'Mangyaring siguraduhin na ang target ay nasa parehas na wifi network.';+ @override String get placeItems => 'Maglagay ng mga bagay na i-share.';+}++// Path: settingsTab+class _StringsSettingsTabFilPh extends _StringsSettingsTabEn {+ _StringsSettingsTabFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Settings';+ @override late final _StringsSettingsTabGeneralFilPh general = _StringsSettingsTabGeneralFilPh._(_root);+ @override late final _StringsSettingsTabReceiveFilPh receive = _StringsSettingsTabReceiveFilPh._(_root);+ @override late final _StringsSettingsTabNetworkFilPh network = _StringsSettingsTabNetworkFilPh._(_root);+ @override String get advancedSettings => 'Advanced settings';+}++// Path: troubleshootPage+class _StringsTroubleshootPageFilPh extends _StringsTroubleshootPageEn {+ _StringsTroubleshootPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Troubleshoot';+ @override String get subTitle => 'Hindi gumagana ang app na ito gaya nang inaasahan? Narito mo mahahanap ang mga madalas na solusyon.';+ @override String get solution => 'Solusyon:';+ @override String get fixButton => 'Awtomatikong ayusin';+ @override late final _StringsTroubleshootPageFirewallFilPh firewall = _StringsTroubleshootPageFirewallFilPh._(_root);+ @override late final _StringsTroubleshootPageNoConnectionFilPh noConnection = _StringsTroubleshootPageNoConnectionFilPh._(_root);+}++// Path: receiveHistoryPage+class _StringsReceiveHistoryPageFilPh extends _StringsReceiveHistoryPageEn {+ _StringsReceiveHistoryPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'History';+ @override String get openFolder => 'Buksan ang folder';+ @override String get deleteHistory => 'Burahin ang history';+ @override String get empty => 'Walang laman ang history.';+ @override late final _StringsReceiveHistoryPageEntryActionsFilPh entryActions = _StringsReceiveHistoryPageEntryActionsFilPh._(_root);+}++// Path: apkPickerPage+class _StringsApkPickerPageFilPh extends _StringsApkPickerPageEn {+ _StringsApkPickerPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Apps (APK)';+ @override String get excludeSystemApps => 'Ibukod ang mga system app';+ @override String get excludeAppsWithoutLaunchIntent => 'Ibukod and mga non-launchable app';+ @override String apps({required Object n}) => '${n} Apps';+}++// Path: selectedFilesPage+class _StringsSelectedFilesPageFilPh extends _StringsSelectedFilesPageEn {+ _StringsSelectedFilesPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get deleteAll => 'Burahin lahat';+}++// Path: receivePage+class _StringsReceivePageFilPh extends _StringsReceivePageEn {+ _StringsReceivePageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String subTitle({required num n}) => (_root.$meta.cardinalResolver ?? PluralResolvers.cardinal('fil'))(n,+ one: 'ay gustong magpadala sa iyo ng file.',+ other: 'ay gustong magpadala sa iyo ng ${n} na mga file.',+ );+ @override String get subTitleMessage => 'ay nagpadala sa iyo ng mensahe:';+ @override String get subTitleLink => 'ay nagpadala sa iyo ng likn:';+ @override String get canceled => 'Ang sender ay nag-kansela ng request.';+}++// Path: receiveOptionsPage+class _StringsReceiveOptionsPageFilPh extends _StringsReceiveOptionsPageEn {+ _StringsReceiveOptionsPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Options';+ @override String get destination => '${_root.settingsTab.receive.destination}';+ @override String get appDirectory => '(LocalSend folder)';+ @override String get saveToGallery => '${_root.settingsTab.receive.saveToGallery}';+ @override String get saveToGalleryOff => 'Awtomatikong pinatay dahil mayroong mga directories.';+}++// Path: sendPage+class _StringsSendPageFilPh extends _StringsSendPageEn {+ _StringsSendPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get waiting => 'Naghihintay ng response...';+ @override String get rejected => 'Tinanggihan ng recipient ang request.';+ @override String get busy => 'Ang recipient ay abala pa sa ibang request.';+}++// Path: progressPage+class _StringsProgressPageFilPh extends _StringsProgressPageEn {+ _StringsProgressPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get titleSending => 'Nagpapadala ng mga file';+ @override String get titleReceiving => 'Tumatanggap ng mga file';+ @override String get savedToGallery => 'Naka-Save sa Photos';+ @override late final _StringsProgressPageTotalFilPh total = _StringsProgressPageTotalFilPh._(_root);+}++// Path: webSharePage+class _StringsWebSharePageFilPh extends _StringsWebSharePageEn {+ _StringsWebSharePageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'I-Share gamit ang link';+ @override String get loading => 'Binubuksan ang server...';+ @override String get stopping => 'Ihinihinto ang server...';+ @override String get error => 'May nangyaring error habang buksan ang server.';+ @override String openLink({required num n}) => (_root.$meta.cardinalResolver ?? PluralResolvers.cardinal('fil'))(n,+ one: 'Buksan ang link na ito sa browser:',+ other: 'Buksan ang isa sa mga link na ito sa browser:',+ );+ @override String get requests => 'Requests';+ @override String get noRequests => 'Wala pang mga request.';+ @override String get encryption => '${_root.settingsTab.network.encryption}';+ @override String get encryptionHint => 'Ang LocalSend ay gumagamit ng self-signed certificate. Kailangan mo itong i-accept sa browser.';+ @override String pendingRequests({required Object n}) => 'Mga naka-pending na request: ${n}';+}++// Path: aboutPage+class _StringsAboutPageFilPh extends _StringsAboutPageEn {+ _StringsAboutPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Tungkol sa LocalSend';+}++// Path: changelogPage+class _StringsChangelogPageFilPh extends _StringsChangelogPageEn {+ _StringsChangelogPageFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Changelog';+}++// Path: aliasGenerator+class _StringsAliasGeneratorFilPh extends _StringsAliasGeneratorEn {+ _StringsAliasGeneratorFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override List<String> get adjectives => [+ 'Adorable',+ 'Beautiful',+ 'Big',+ 'Bright',+ 'Clean',+ 'Clever',+ 'Cool',+ 'Cute',+ 'Cunning',+ 'Determined',+ 'Energetic',+ 'Efficient',+ 'Fantastic',+ 'Fast',+ 'Fine',+ 'Fresh',+ 'Good',+ 'Gorgeous',+ 'Great',+ 'Handsome',+ 'Hot',+ 'Kind',+ 'Lovely',+ 'Mystic',+ 'Neat',+ 'Nice',+ 'Patient',+ 'Pretty',+ 'Powerful',+ 'Rich',+ 'Secret',+ 'Smart',+ 'Solid',+ 'Special',+ 'Strategic',+ 'Strong',+ 'Tidy',+ 'Wise',+ ];+ @override List<String> get fruits => [+ 'Apple',+ 'Avocado',+ 'Banana',+ 'Blackberry',+ 'Blueberry',+ 'Broccoli',+ 'Carrot',+ 'Cherry',+ 'Coconut',+ 'Grape',+ 'Lemon',+ 'Lettuce',+ 'Mango',+ 'Melon',+ 'Mushroom',+ 'Onion',+ 'Orange',+ 'Papaya',+ 'Peach',+ 'Pear',+ 'Pineapple',+ 'Potato',+ 'Pumpkin',+ 'Raspberry',+ 'Strawberry',+ 'Tomato',+ ];++ /// In some languages, the adjective must be last.+ @override String combination({required Object adjective, required Object fruit}) => '${adjective} ${fruit}';+}++// Path: dialogs+class _StringsDialogsFilPh extends _StringsDialogsEn {+ _StringsDialogsFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override late final _StringsDialogsAddFileFilPh addFile = _StringsDialogsAddFileFilPh._(_root);+ @override late final _StringsDialogsAddressInputFilPh addressInput = _StringsDialogsAddressInputFilPh._(_root);+ @override late final _StringsDialogsCancelSessionFilPh cancelSession = _StringsDialogsCancelSessionFilPh._(_root);+ @override late final _StringsDialogsCannotOpenFileFilPh cannotOpenFile = _StringsDialogsCannotOpenFileFilPh._(_root);+ @override late final _StringsDialogsEncryptionDisabledNoticeFilPh encryptionDisabledNotice = _StringsDialogsEncryptionDisabledNoticeFilPh._(_root);+ @override late final _StringsDialogsErrorDialogFilPh errorDialog = _StringsDialogsErrorDialogFilPh._(_root);+ @override late final _StringsDialogsFavoriteDialogFilPh favoriteDialog = _StringsDialogsFavoriteDialogFilPh._(_root);+ @override late final _StringsDialogsFavoriteDeleteDialogFilPh favoriteDeleteDialog = _StringsDialogsFavoriteDeleteDialogFilPh._(_root);+ @override late final _StringsDialogsFavoriteEditDialogFilPh favoriteEditDialog = _StringsDialogsFavoriteEditDialogFilPh._(_root);+ @override late final _StringsDialogsFileInfoFilPh fileInfo = _StringsDialogsFileInfoFilPh._(_root);+ @override late final _StringsDialogsFileNameInputFilPh fileNameInput = _StringsDialogsFileNameInputFilPh._(_root);+ @override late final _StringsDialogsHistoryClearDialogFilPh historyClearDialog = _StringsDialogsHistoryClearDialogFilPh._(_root);+ @override late final _StringsDialogsLocalNetworkUnauthorizedFilPh localNetworkUnauthorized = _StringsDialogsLocalNetworkUnauthorizedFilPh._(_root);+ @override late final _StringsDialogsMessageInputFilPh messageInput = _StringsDialogsMessageInputFilPh._(_root);+ @override late final _StringsDialogsNoFilesFilPh noFiles = _StringsDialogsNoFilesFilPh._(_root);+ @override late final _StringsDialogsNoPermissionFilPh noPermission = _StringsDialogsNoPermissionFilPh._(_root);+ @override late final _StringsDialogsNotAvailableOnPlatformFilPh notAvailableOnPlatform = _StringsDialogsNotAvailableOnPlatformFilPh._(_root);+ @override late final _StringsDialogsQrFilPh qr = _StringsDialogsQrFilPh._(_root);+ @override late final _StringsDialogsQuickActionsFilPh quickActions = _StringsDialogsQuickActionsFilPh._(_root);+ @override late final _StringsDialogsQuickSaveNoticeFilPh quickSaveNotice = _StringsDialogsQuickSaveNoticeFilPh._(_root);+ @override late final _StringsDialogsSendModeHelpFilPh sendModeHelp = _StringsDialogsSendModeHelpFilPh._(_root);+}++// Path: tray+class _StringsTrayFilPh extends _StringsTrayEn {+ _StringsTrayFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get open => '${_root.general.open}';+ @override String get close => 'Quit LocalSend';+}++// Path: web+class _StringsWebFilPh extends _StringsWebEn {+ _StringsWebFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get waiting => '${_root.sendPage.waiting}';+ @override String get rejected => 'Hindi Tinanggap';+ @override String get files => 'Files';+ @override String get fileName => 'Pangalan ng file';+ @override String get size => 'Size';+}++// Path: assetPicker+class _StringsAssetPickerFilPh extends _StringsAssetPickerEn {+ _StringsAssetPickerFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get confirm => 'Kumpirmahin';+ @override String get cancel => 'Kanselahin';+ @override String get edit => 'Baguhin';+ @override String get gifIndicator => 'GIF';+ @override String get loadFailed => 'Load failed';+ @override String get original => 'Pinagmulan';+ @override String get preview => 'Silipin';+ @override String get select => 'Piliin';+ @override String get emptyList => 'Walang lamang listahan';+ @override String get unSupportedAssetType => 'Hindi suportadong file type.';+ @override String get unableToAccessAll => 'Hindi ma-access ang lahat ng mga file sa device';+ @override String get viewingLimitedAssetsTip => 'Makikita lamang ang mga file at mga album na accessible sa app';+ @override String get changeAccessibleLimitedAssets => 'I-Click para i-update ang accessible na mga file';+ @override String get accessAllTip => 'Ang app na ito ay kaya lamang mag-access ng iilang mga file sa device. Magtungo sa system settings at i-allow ang app para ma-access ang lahat ng media sa device.';+ @override String get goToSystemSettings => 'Magpunta sa system settings';+ @override String get accessLimitedAssets => 'Ituloy nang limitadong access';+ @override String get accessiblePathName => 'Accessible na mga files';+ @override String get sTypeAudioLabel => 'Audio';+ @override String get sTypeImageLabel => 'Image';+ @override String get sTypeVideoLabel => 'Video';+ @override String get sTypeOtherLabel => 'Iba pang media';+ @override String get sActionPlayHint => 'play';+ @override String get sActionPreviewHint => 'silipin';+ @override String get sActionSelectHint => 'piliin';+ @override String get sActionSwitchPathLabel => 'baguhin ang lokasyon';+ @override String get sActionUseCameraHint => 'gamiting ang camera';+ @override String get sNameDurationLabel => 'duration';+ @override String get sUnitAssetCountLabel => 'count';+}++// Path: receiveTab.infoBox+class _StringsReceiveTabInfoBoxFilPh extends _StringsReceiveTabInfoBoxEn {+ _StringsReceiveTabInfoBoxFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get ip => 'IP:';+ @override String get port => 'Port:';+ @override String get alias => 'Alias:';+}++// Path: sendTab.selection+class _StringsSendTabSelectionFilPh extends _StringsSendTabSelectionEn {+ _StringsSendTabSelectionFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Pagpipilian';+ @override String files({required Object files}) => 'Files: ${files}';+ @override String size({required Object size}) => 'Size: ${size}';+}++// Path: sendTab.picker+class _StringsSendTabPickerFilPh extends _StringsSendTabPickerEn {+ _StringsSendTabPickerFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get file => 'File';+ @override String get folder => 'Folder';+ @override String get media => 'Media';+ @override String get text => 'Text';+ @override String get app => 'App';+ @override String get clipboard => 'Paste';+}++// Path: sendTab.sendModes+class _StringsSendTabSendModesFilPh extends _StringsSendTabSendModesEn {+ _StringsSendTabSendModesFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get single => 'Isang tatanggap';+ @override String get multiple => 'Maraming tatanggap';+ @override String get link => 'I-Share gamit ang link';+}++// Path: settingsTab.general+class _StringsSettingsTabGeneralFilPh extends _StringsSettingsTabGeneralEn {+ _StringsSettingsTabGeneralFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'General';+ @override String get brightness => 'Tema';+ @override late final _StringsSettingsTabGeneralBrightnessOptionsFilPh brightnessOptions = _StringsSettingsTabGeneralBrightnessOptionsFilPh._(_root);+ @override String get color => 'Kulay';+ @override late final _StringsSettingsTabGeneralColorOptionsFilPh colorOptions = _StringsSettingsTabGeneralColorOptionsFilPh._(_root);+ @override String get language => 'Wika';+ @override late final _StringsSettingsTabGeneralLanguageOptionsFilPh languageOptions = _StringsSettingsTabGeneralLanguageOptionsFilPh._(_root);+ @override String get saveWindowPlacement => 'Quit: I-Save ang window placement';+ @override String get minimizeToTray => 'Quit: Paliitin sa Tray/Menu Bar';+ @override String get launchAtStartup => 'I-Autostart pagkatapos mag-login';+ @override String get launchMinimized => 'Autostart: I-start nang nakatago';+ @override String get animations => 'Animations';+}++// Path: settingsTab.receive+class _StringsSettingsTabReceiveFilPh extends _StringsSettingsTabReceiveEn {+ _StringsSettingsTabReceiveFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Tumanggap';+ @override String get quickSave => '${_root.general.quickSave}';+ @override String get destination => 'Patutunguhan';+ @override String get downloads => '(Downloads)';+ @override String get saveToGallery => 'I-Save ang media sa gallery';+ @override String get saveToHistory => 'I-Save sa history';+}++// Path: settingsTab.network+class _StringsSettingsTabNetworkFilPh extends _StringsSettingsTabNetworkEn {+ _StringsSettingsTabNetworkFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Network';+ @override String get needRestart => 'I-Restart ang server para i-apply ang settings!';+ @override String get server => 'Server';+ @override String get alias => 'Alias';+ @override String get deviceType => 'Device type';+ @override String get deviceModel => 'Device model';+ @override String get port => 'Port';+ @override String portWarning({required Object defaultPort}) => 'Maaaring hindi ka ma-detect ng ibang devices dahil ikaw ay gumagamit ng ibang port. (default: ${defaultPort})';+ @override String get encryption => 'Encryption';+ @override String get multicastGroup => 'Multicast';+ @override String multicastGroupWarning({required Object defaultMulticast}) => 'Maaring hindi ka ma-detect ng ibang devices dahil ikaw ay gumagamit ng ibang multicast address. (default: ${defaultMulticast})';+}++// Path: troubleshootPage.firewall+class _StringsTroubleshootPageFirewallFilPh extends _StringsTroubleshootPageFirewallEn {+ _StringsTroubleshootPageFirewallFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get symptom => 'Ang app na ito ay nakakapag-padala ng mga file sa ibang devices ngunit ang ibang devices ay hindi makapag-padala sa device na ito.';+ @override String solution({required Object port}) => 'Ito ay kadalasang isyu sa firewall. Maari mo maayos sa pamamagitan nang pag-allow ng mga incoming connections (UDP at TCP) sa port ${port}.';+ @override String get openFirewall => 'Buksan ang Firewall';+}++// Path: troubleshootPage.noConnection+class _StringsTroubleshootPageNoConnectionFilPh extends _StringsTroubleshootPageNoConnectionEn {+ _StringsTroubleshootPageNoConnectionFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get symptom => 'Ang dalawa o higit pang devices ay hindi mo discover ang isa\'t isa o hindi makapag-share ng files.';+ @override String get solution => 'Ang problema ay nangyayari sa dalawang device? Mangyaring siguraduhin na ang dalawang device ay nasa parehas na wifi network at mayroong parehas na configuration (port, multicast address, encryption). Maaring ang wifi ay hindi pinahihintulutan and komunikasyon sa pagitan nang mga participants. Sa ganitong pangyayari, ang option na ito ay dapat i-enable sa router.';+}++// Path: receiveHistoryPage.entryActions+class _StringsReceiveHistoryPageEntryActionsFilPh extends _StringsReceiveHistoryPageEntryActionsEn {+ _StringsReceiveHistoryPageEntryActionsFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get open => 'Buksan ang file';+ @override String get info => 'Impormasyon';+ @override String get deleteFromHistory => 'Burahin sa history';+}++// Path: progressPage.total+class _StringsProgressPageTotalFilPh extends _StringsProgressPageTotalEn {+ _StringsProgressPageTotalFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override late final _StringsProgressPageTotalTitleFilPh title = _StringsProgressPageTotalTitleFilPh._(_root);+ @override String count({required Object curr, required Object n}) => 'Files: ${curr} / ${n}';+ @override String size({required Object curr, required Object n}) => 'Size: ${curr} / ${n}';+ @override String speed({required Object speed}) => 'Speed: ${speed}/s';+}++// Path: dialogs.addFile+class _StringsDialogsAddFileFilPh extends _StringsDialogsAddFileEn {+ _StringsDialogsAddFileFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Idagdag sa selection';+ @override String get content => 'Ano ang gusto mong idagdag?';+}++// Path: dialogs.addressInput+class _StringsDialogsAddressInputFilPh extends _StringsDialogsAddressInputEn {+ _StringsDialogsAddressInputFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Ilagay ang address';+ @override String get hashtag => 'Hashtag';+ @override String get ip => 'IP Address';+ @override String get recentlyUsed => 'Recently used: ';+}++// Path: dialogs.cancelSession+class _StringsDialogsCancelSessionFilPh extends _StringsDialogsCancelSessionEn {+ _StringsDialogsCancelSessionFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Kanselahin ang pagpapadala ng file';+ @override String get content => 'Gusto mo ba talagang kanselahin ang pagpapadala ng file?';+}++// Path: dialogs.cannotOpenFile+class _StringsDialogsCannotOpenFileFilPh extends _StringsDialogsCannotOpenFileEn {+ _StringsDialogsCannotOpenFileFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Hindi mabuksan ang file';+ @override String content({required Object file}) => 'Hindi mabuksan ang "${file}". Ito ba ay nalipat, pinangalanan, o nabura?';+}++// Path: dialogs.encryptionDisabledNotice+class _StringsDialogsEncryptionDisabledNoticeFilPh extends _StringsDialogsEncryptionDisabledNoticeEn {+ _StringsDialogsEncryptionDisabledNoticeFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Ang encryption ay naka-disable';+ @override String get content => 'Ang communication ay nangyayari ngayon gamit ang unencrypted HTTP protocol. Para gamitin ang HTTPS, muling i-enable ang encryption.';+}++// Path: dialogs.errorDialog+class _StringsDialogsErrorDialogFilPh extends _StringsDialogsErrorDialogEn {+ _StringsDialogsErrorDialogFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => '${_root.general.error}';+}++// Path: dialogs.favoriteDialog+class _StringsDialogsFavoriteDialogFilPh extends _StringsDialogsFavoriteDialogEn {+ _StringsDialogsFavoriteDialogFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Favorites';+ @override String get noFavorites => 'Wala pang favorites sa mga device.';+ @override String get addFavorite => 'Magdagdag';+}++// Path: dialogs.favoriteDeleteDialog+class _StringsDialogsFavoriteDeleteDialogFilPh extends _StringsDialogsFavoriteDeleteDialogEn {+ _StringsDialogsFavoriteDeleteDialogFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Burahin sa favorites';+ @override String content({required Object name}) => 'Gusto mo ba talagang burahin ang favorites "${name}"?';+}++// Path: dialogs.favoriteEditDialog+class _StringsDialogsFavoriteEditDialogFilPh extends _StringsDialogsFavoriteEditDialogEn {+ _StringsDialogsFavoriteEditDialogFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get titleAdd => 'Idagdag sa favorites';+ @override String get titleEdit => 'Adjust';+ @override String get name => 'Alias';+ @override String get auto => '(auto)';+ @override String get ip => 'IP Address';+ @override String get port => 'Port';+}++// Path: dialogs.fileInfo+class _StringsDialogsFileInfoFilPh extends _StringsDialogsFileInfoEn {+ _StringsDialogsFileInfoFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Impormasyon sa file';+ @override String get fileName => 'Pangalan ng file:';+ @override String get path => 'Lokasyon:';+ @override String get size => 'Size:';+ @override String get sender => 'Sender:';+ @override String get time => 'Time:';+}++// Path: dialogs.fileNameInput+class _StringsDialogsFileNameInputFilPh extends _StringsDialogsFileNameInputEn {+ _StringsDialogsFileNameInputFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Ilagay ang pangalan ng file';+ @override String original({required Object original}) => 'Orihinal: ${original}';+}++// Path: dialogs.historyClearDialog+class _StringsDialogsHistoryClearDialogFilPh extends _StringsDialogsHistoryClearDialogEn {+ _StringsDialogsHistoryClearDialogFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Burahin ang history';+ @override String get content => 'Gusto mo ba talagang burahin ang buong history?';+}++// Path: dialogs.localNetworkUnauthorized+class _StringsDialogsLocalNetworkUnauthorizedFilPh extends _StringsDialogsLocalNetworkUnauthorizedEn {+ _StringsDialogsLocalNetworkUnauthorizedFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => '${_root.dialogs.noPermission.title}';+ @override String get description => 'Hindi makikita ng LocalSend ang ibang devices hangga\'t hindi nabibigyan ng permission para mag scan sa lokal na network. Mangyaring bigyan ito ng permission sa settings.';+ @override String get gotoSettings => 'Settings';+}++// Path: dialogs.messageInput+class _StringsDialogsMessageInputFilPh extends _StringsDialogsMessageInputEn {+ _StringsDialogsMessageInputFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'I-Type ang message';+ @override String get multiline => 'Multiline';+}++// Path: dialogs.noFiles+class _StringsDialogsNoFilesFilPh extends _StringsDialogsNoFilesEn {+ _StringsDialogsNoFilesFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Walang file na pinli';+ @override String get content => 'Mangyaring pumili nang kahit isang file.';+}++// Path: dialogs.noPermission+class _StringsDialogsNoPermissionFilPh extends _StringsDialogsNoPermissionEn {+ _StringsDialogsNoPermissionFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Walang permission';+ @override String get content => 'Hindi nabigyan ng mga kinakailangang permissions. Mangyaring bigyan ito ng permission sa settings.';+}++// Path: dialogs.notAvailableOnPlatform+class _StringsDialogsNotAvailableOnPlatformFilPh extends _StringsDialogsNotAvailableOnPlatformEn {+ _StringsDialogsNotAvailableOnPlatformFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Hindi available';+ @override String get content => 'Ang feature na ito ay available lamang sa:';+}++// Path: dialogs.qr+class _StringsDialogsQrFilPh extends _StringsDialogsQrEn {+ _StringsDialogsQrFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'QR Code';+}++// Path: dialogs.quickActions+class _StringsDialogsQuickActionsFilPh extends _StringsDialogsQuickActionsEn {+ _StringsDialogsQuickActionsFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Quick Actions';+ @override String get counter => 'Counter';+ @override String get prefix => 'Prefix';+ @override String get padZero => 'Pad with zeros';+ @override String get sortBeforeCount => 'Pagsunud-sunurin ayon sa alpabeto';+ @override String get random => 'Random';+}++// Path: dialogs.quickSaveNotice+class _StringsDialogsQuickSaveNoticeFilPh extends _StringsDialogsQuickSaveNoticeEn {+ _StringsDialogsQuickSaveNoticeFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => '${_root.general.quickSave}';+ @override String get content => 'Ang mga file request ay awtomatikong tinatanggap. Mabatid lamang na ang lahat ng nasa lokal na network ay maaaring mag-padala sa iyo ng mga file.';+}++// Path: dialogs.sendModeHelp+class _StringsDialogsSendModeHelpFilPh extends _StringsDialogsSendModeHelpEn {+ _StringsDialogsSendModeHelpFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get title => 'Send modes';+ @override String get single => 'Magpadala ng mga file sa iisang recipient o tatanggap. Ang mga pagpipilian ay maaalis pagkatapos ipadala ang file.';+ @override String get multiple => 'Magpadala ng mga file sa maraming recipient o tatanggap. Ang mga pagpipilian ay hindi maaalis.';+ @override String get link => 'Ang mga recipient o tatanggap na walang nakainstall na LocalSend ay maaring mag download nang mga napiling files sa pamamagitan ng pagbukas ng link sa kanilang browser.';+}++// Path: settingsTab.general.brightnessOptions+class _StringsSettingsTabGeneralBrightnessOptionsFilPh extends _StringsSettingsTabGeneralBrightnessOptionsEn {+ _StringsSettingsTabGeneralBrightnessOptionsFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get system => 'System';+ @override String get dark => 'Madilim';+ @override String get light => 'Maliwanag';+}++// Path: settingsTab.general.colorOptions+class _StringsSettingsTabGeneralColorOptionsFilPh extends _StringsSettingsTabGeneralColorOptionsEn {+ _StringsSettingsTabGeneralColorOptionsFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get system => 'System';+ @override String get oled => 'OLED';+}++// Path: settingsTab.general.languageOptions+class _StringsSettingsTabGeneralLanguageOptionsFilPh extends _StringsSettingsTabGeneralLanguageOptionsEn {+ _StringsSettingsTabGeneralLanguageOptionsFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String get system => 'System';+}++// Path: progressPage.total.title+class _StringsProgressPageTotalTitleFilPh extends _StringsProgressPageTotalTitleEn {+ _StringsProgressPageTotalTitleFilPh._(_StringsFilPh root) : this._root = root, super._(root);++ @override final _StringsFilPh _root; // ignore: unused_field++ // Translations+ @override String sending({required Object time}) => 'Kabuuang progress (${time})';+ @override String get finishedError => 'Natapos nang may error';+ @override String get canceledSender => 'Kinansela ng sender';+ @override String get canceledReceiver => 'Kinansela ng receiver';+}diff --git a/app/lib/gen/strings_km.g.dart b/app/lib/gen/strings_km.g.dartindex b47bf50c..c656b772 100644--- a/app/lib/gen/strings_km.g.dart+++ b/app/lib/gen/strings_km.g.dart@@ -21,7 +21,7 @@ class _StringsKm extends _StringsEn {@override late final _StringsKm _root = this; // ignore: unused_field// Translations- @override String get locale => 'ក្នុងប្រព័ន្ធ';+ @override String get locale => 'ភាសាខ្មែរ';@override String get appName => 'LocalSend';@override late final _StringsGeneralKm general = _StringsGeneralKm._(_root);@override late final _StringsReceiveTabKm receiveTab = _StringsReceiveTabKm._(_root);@@ -210,7 +210,7 @@ class _StringsReceiveOptionsPageKm extends _StringsReceiveOptionsPageEn {@override final _StringsKm _root; // ignore: unused_field// Translations- @override String get title => 'Options';+ @override String get title => 'ជម្រើស';@override String get destination => '${_root.settingsTab.receive.destination}';@override String get appDirectory => '(ថតឯកសារ LocalSend)';@override String get saveToGallery => '${_root.settingsTab.receive.saveToGallery}';diff --git a/app/lib/gen/strings_ru.g.dart b/app/lib/gen/strings_ru.g.dartindex 7b00f922..c4182242 100644--- a/app/lib/gen/strings_ru.g.dart+++ b/app/lib/gen/strings_ru.g.dart@@ -640,7 +640,7 @@ class _StringsDialogsFavoriteEditDialogRu extends _StringsDialogsFavoriteEditDia// Translations@override String get titleAdd => 'Добавить в избранное';- @override String get titleEdit => 'Настроить';+ @override String get titleEdit => 'Настройка';@override String get name => 'Имя устройства';@override String get auto => '(автоматически)';@override String get ip => 'IP-адрес';diff --git a/app/lib/gen/strings_uk.g.dart b/app/lib/gen/strings_uk.g.dartindex 41a2786b..6eb7d451 100644--- a/app/lib/gen/strings_uk.g.dart+++ b/app/lib/gen/strings_uk.g.dart@@ -640,7 +640,7 @@ class _StringsDialogsFavoriteEditDialogUk extends _StringsDialogsFavoriteEditDia// Translations@override String get titleAdd => 'Додати до вибраних';- @override String get titleEdit => 'Налаштувати';+ @override String get titleEdit => 'Налаштування';@override String get name => 'Ім\'я пристрою';@override String get auto => '(автоматично)';@override String get ip => 'IP-адреса';diff --git a/app/lib/pages/receive_options_page.dart b/app/lib/pages/receive_options_page.dartindex 13143599..3f45e7ca 100644--- a/app/lib/pages/receive_options_page.dart+++ b/app/lib/pages/receive_options_page.dart@@ -78,11 +78,7 @@ class ReceiveOptionsPage extends StatelessWidget {),);}).toList(),- onChanged: (b) {- if (b != null) {- ref.notifier(serverProvider).setSessionSaveToGallery(b);- }- },+ onChanged: (b) => ref.notifier(serverProvider).setSessionSaveToGallery(b),),if (receiveSession.containsDirectories && !receiveSession.saveToGallery) ...[const SizedBox(width: 10),diff --git a/app/lib/pages/tabs/send_tab.dart b/app/lib/pages/tabs/send_tab.dartindex 38c25960..22d550a6 100644--- a/app/lib/pages/tabs/send_tab.dart+++ b/app/lib/pages/tabs/send_tab.dart@@ -31,227 +31,220 @@ import 'package:refena_flutter/refena_flutter.dart';import 'package:routerino/routerino.dart';const _horizontalPadding = 15.0;+final _options = FilePickerOption.getOptionsForPlatform();-class SendTab extends StatefulWidget {- const SendTab({Key? key}) : super(key: key);-- @override- State<SendTab> createState() => _SendTabState();-}--class _SendTabState extends State<SendTab> with Refena {- final options = FilePickerOption.getOptionsForPlatform();-- @override- void initState() {- super.initState();-- ensureRef((ref) async {- await ref.dispatchAsync(SendTabInitAction(context));- });- }+class SendTab extends StatelessWidget {+ const SendTab();@overrideWidget build(BuildContext context) {- final vm = ref.watch(sendTabVmProvider);-- return ResponsiveListView(- padding: EdgeInsets.zero,- children: [- const SizedBox(height: 20),- if (vm.selectedFiles.isEmpty) ...[- Padding(- padding: const EdgeInsets.symmetric(horizontal: _horizontalPadding),- child: Text(- t.sendTab.selection.title,- style: Theme.of(context).textTheme.titleMedium,- ),- ),- SingleChildScrollView(- scrollDirection: Axis.horizontal,- child: Row(- children: [- const SizedBox(width: 10),- ...options.map((option) {- return Padding(- padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 5),- child: BigButton(- icon: option.icon,- label: option.label,- filled: false,- onTap: () async => ref.dispatchAsync(PickFileAction(- option: option,- context: context,- )),- ),- );- }),- const SizedBox(width: 10),- ],- ),- ),- ] else ...[- Card(- margin: const EdgeInsets.only(bottom: 10, left: _horizontalPadding, right: _horizontalPadding),- child: Padding(- padding: const EdgeInsets.all(15),- child: Column(- crossAxisAlignment: CrossAxisAlignment.start,- children: [- Text(- t.sendTab.selection.title,- style: Theme.of(context).textTheme.titleMedium,- ),- const SizedBox(height: 5),- Text(t.sendTab.selection.files(files: vm.selectedFiles.length)),- Text(t.sendTab.selection.size(size: vm.selectedFiles.fold(0, (prev, curr) => prev + curr.size).asReadableFileSize)),- const SizedBox(height: 10),- SingleChildScrollView(- scrollDirection: Axis.horizontal,- child: Row(- children: [- ...vm.selectedFiles.map((file) {- return [- SmartFileThumbnail.fromCrossFile(file),- const SizedBox(width: 10),- ];- }).expand((e) => e),- ],- ),- ),- const SizedBox(height: 10),- Row(- mainAxisAlignment: MainAxisAlignment.end,- children: [- TextButton(- style: TextButton.styleFrom(- foregroundColor: Theme.of(context).colorScheme.onSurface,+ return ViewModelBuilder(+ provider: sendTabVmProvider,+ init: (context, ref) {+ // ignore: discarded_futures+ ref.dispatchAsync(SendTabInitAction(context));+ },+ builder: (context, vm) {+ final ref = context.ref;+ return ResponsiveListView(+ padding: EdgeInsets.zero,+ children: [+ const SizedBox(height: 20),+ if (vm.selectedFiles.isEmpty) ...[+ Padding(+ padding: const EdgeInsets.symmetric(horizontal: _horizontalPadding),+ child: Text(+ t.sendTab.selection.title,+ style: Theme.of(context).textTheme.titleMedium,+ ),+ ),+ SingleChildScrollView(+ scrollDirection: Axis.horizontal,+ child: Row(+ children: [+ const SizedBox(width: 10),+ ..._options.map((option) {+ return Padding(+ padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 5),+ child: BigButton(+ icon: option.icon,+ label: option.label,+ filled: false,+ onTap: () async => ref.dispatchAsync(PickFileAction(+ option: option,+ context: context,+ )),),- onPressed: () async {- await context.push(() => const SelectedFilesPage());- },- child: Text(t.general.edit),+ );+ }),+ const SizedBox(width: 10),+ ],+ ),+ ),+ ] else ...[+ Card(+ margin: const EdgeInsets.only(bottom: 10, left: _horizontalPadding, right: _horizontalPadding),+ child: Padding(+ padding: const EdgeInsets.all(15),+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.start,+ children: [+ Text(+ t.sendTab.selection.title,+ style: Theme.of(context).textTheme.titleMedium,),- const SizedBox(width: 15),- ElevatedButton.icon(- style: ElevatedButton.styleFrom(- backgroundColor: Theme.of(context).colorScheme.primary,- foregroundColor: Theme.of(context).colorScheme.onPrimary,+ const SizedBox(height: 5),+ Text(t.sendTab.selection.files(files: vm.selectedFiles.length)),+ Text(t.sendTab.selection.size(size: vm.selectedFiles.fold(0, (prev, curr) => prev + curr.size).asReadableFileSize)),+ const SizedBox(height: 10),+ SingleChildScrollView(+ scrollDirection: Axis.horizontal,+ child: Row(+ children: [+ ...vm.selectedFiles.map((file) {+ return [+ SmartFileThumbnail.fromCrossFile(file),+ const SizedBox(width: 10),+ ];+ }).expand((e) => e),+ ],),- onPressed: () async {- if (options.length == 1) {- // open directly- await ref.dispatchAsync(PickFileAction(- option: options.first,- context: context,- ));- return;- }- await AddFileDialog.open(- context: context,- options: options,- );- },- icon: const Icon(Icons.add),- label: Text(t.general.add),+ ),+ const SizedBox(height: 10),+ Row(+ mainAxisAlignment: MainAxisAlignment.end,+ children: [+ TextButton(+ style: TextButton.styleFrom(+ foregroundColor: Theme.of(context).colorScheme.onSurface,+ ),+ onPressed: () async {+ await context.push(() => const SelectedFilesPage());+ },+ child: Text(t.general.edit),+ ),+ const SizedBox(width: 15),+ ElevatedButton.icon(+ style: ElevatedButton.styleFrom(+ backgroundColor: Theme.of(context).colorScheme.primary,+ foregroundColor: Theme.of(context).colorScheme.onPrimary,+ ),+ onPressed: () async {+ if (_options.length == 1) {+ // open directly+ await ref.dispatchAsync(PickFileAction(+ option: _options.first,+ context: context,+ ));+ return;+ }+ await AddFileDialog.open(+ context: context,+ options: _options,+ );+ },+ icon: const Icon(Icons.add),+ label: Text(t.general.add),+ ),+ ],),],),- ],+ ),),+ ],+ Row(+ children: [+ const SizedBox(width: _horizontalPadding),+ Flexible(+ child: Padding(+ padding: const EdgeInsets.symmetric(vertical: 10),+ child: Text(t.sendTab.nearbyDevices, style: Theme.of(context).textTheme.titleMedium),+ ),+ ),+ const SizedBox(width: 10),+ _ScanButton(+ ips: vm.localIps,+ ),+ Tooltip(+ message: t.dialogs.addressInput.title,+ child: CustomIconButton(+ onPressed: () async => vm.onTapAddress(context),+ child: const Icon(Icons.ads_click),+ ),+ ),+ Tooltip(+ message: t.dialogs.favoriteDialog.title,+ child: CustomIconButton(+ onPressed: () async => await vm.onTapFavorite(context),+ child: const Icon(Icons.favorite),+ ),+ ),+ _SendModeButton(+ onSelect: (mode) async => vm.onTapSendMode(context, mode),+ ),+ ],),- ),- ],- Row(- children: [- const SizedBox(width: _horizontalPadding),- Flexible(- child: Padding(- padding: const EdgeInsets.symmetric(vertical: 10),- child: Text(t.sendTab.nearbyDevices, style: Theme.of(context).textTheme.titleMedium),+ if (vm.nearbyDevices.isEmpty)+ const Padding(+ padding: EdgeInsets.only(bottom: 10, left: _horizontalPadding, right: _horizontalPadding),+ child: Opacity(+ opacity: 0.3,+ child: DevicePlaceholderListTile(),+ ),),- ),- const SizedBox(width: 10),- _ScanButton(- ips: vm.localIps,- ),- Tooltip(- message: t.dialogs.addressInput.title,- child: CustomIconButton(- onPressed: () async => vm.onTapAddress(context),- child: const Icon(Icons.ads_click),+ ...vm.nearbyDevices.map((device) {+ final isFavorite = vm.favoriteDevices.any((e) => e.fingerprint == device.fingerprint);+ return Padding(+ padding: const EdgeInsets.only(bottom: 10, left: _horizontalPadding, right: _horizontalPadding),+ child: Hero(+ tag: 'device-${device.ip}',+ child: vm.sendMode == SendMode.multiple+ ? _MultiSendDeviceListTile(+ device: device,+ isFavorite: isFavorite,+ vm: vm,+ )+ : DeviceListTile(+ device: device,+ isFavorite: isFavorite,+ onFavoriteTap: () async => await vm.onToggleFavorite(device),+ onTap: () async => await vm.onTapDevice(context, device),+ ),+ ),+ );+ }),+ const SizedBox(height: 10),+ Center(+ child: TextButton(+ onPressed: () async {+ await context.push(() => const TroubleshootPage());+ },+ child: Text(t.troubleshootPage.title),),),- Tooltip(- message: t.dialogs.favoriteDialog.title,- child: CustomIconButton(- onPressed: () async => await vm.onTapFavorite(context),- child: const Icon(Icons.favorite),+ const SizedBox(height: 20),+ Padding(+ padding: const EdgeInsets.symmetric(horizontal: _horizontalPadding),+ child: Consumer(+ builder: (context, ref) {+ final animations = ref.watch(animationProvider);+ return OpacitySlideshow(+ durationMillis: 6000,+ running: animations,+ children: [+ Text(t.sendTab.help, style: const TextStyle(color: Colors.grey), textAlign: TextAlign.center),+ if (checkPlatformCanReceiveShareIntent())+ Text(t.sendTab.shareIntentInfo, style: const TextStyle(color: Colors.grey), textAlign: TextAlign.center),+ ],+ );+ },),),- _SendModeButton(- onSelect: (mode) async => vm.onTapSendMode(context, mode),- ),+ const SizedBox(height: 50),],- ),- if (vm.nearbyDevices.isEmpty)- const Padding(- padding: EdgeInsets.only(bottom: 10, left: _horizontalPadding, right: _horizontalPadding),- child: Opacity(- opacity: 0.3,- child: DevicePlaceholderListTile(),- ),- ),- ...vm.nearbyDevices.map((device) {- final isFavorite = vm.favoriteDevices.any((e) => e.fingerprint == device.fingerprint);- return Padding(- padding: const EdgeInsets.only(bottom: 10, left: _horizontalPadding, right: _horizontalPadding),- child: Hero(- tag: 'device-${device.ip}',- child: vm.sendMode == SendMode.multiple- ? _MultiSendDeviceListTile(- device: device,- isFavorite: isFavorite,- vm: vm,- )- : DeviceListTile(- device: device,- isFavorite: isFavorite,- onFavoriteTap: () async => await vm.onToggleFavorite(device),- onTap: () async => await vm.onTapDevice(context, device),- ),- ),- );- }),- const SizedBox(height: 10),- Center(- child: TextButton(- onPressed: () async {- await context.push(() => const TroubleshootPage());- },- child: Text(t.troubleshootPage.title),- ),- ),- const SizedBox(height: 20),- Padding(- padding: const EdgeInsets.symmetric(horizontal: _horizontalPadding),- child: Consumer(- builder: (context, ref) {- final animations = ref.watch(animationProvider);- return OpacitySlideshow(- durationMillis: 6000,- running: animations,- children: [- Text(t.sendTab.help, style: const TextStyle(color: Colors.grey), textAlign: TextAlign.center),- if (checkPlatformCanReceiveShareIntent())- Text(t.sendTab.shareIntentInfo, style: const TextStyle(color: Colors.grey), textAlign: TextAlign.center),- ],- );- },- ),- ),- const SizedBox(height: 50),- ],+ );+ },);}}diff --git a/app/lib/pages/tabs/settings_tab.dart b/app/lib/pages/tabs/settings_tab.dartindex 9a6ae500..b8aedef5 100644--- a/app/lib/pages/tabs/settings_tab.dart+++ b/app/lib/pages/tabs/settings_tab.dart@@ -6,16 +6,13 @@ import 'package:localsend_app/model/persistence/color_mode.dart';import 'package:localsend_app/pages/about_page.dart';import 'package:localsend_app/pages/changelog_page.dart';import 'package:localsend_app/pages/language_page.dart';-import 'package:localsend_app/provider/device_info_provider.dart';-import 'package:localsend_app/provider/network/server/server_provider.dart';+import 'package:localsend_app/pages/tabs/settings_tab_controller.dart';import 'package:localsend_app/provider/settings_provider.dart';import 'package:localsend_app/provider/version_provider.dart';import 'package:localsend_app/theme.dart';import 'package:localsend_app/util/native/autostart_helper.dart';import 'package:localsend_app/util/native/pick_directory_path.dart';import 'package:localsend_app/util/native/platform_check.dart';-import 'package:localsend_app/util/sleep.dart';-import 'package:localsend_app/util/ui/snackbar.dart';import 'package:localsend_app/widget/custom_dropdown_button.dart';import 'package:localsend_app/widget/dialogs/encryption_disabled_notice.dart';import 'package:localsend_app/widget/dialogs/quick_save_notice.dart';@@ -26,517 +23,439 @@ import 'package:localsend_app/widget/responsive_list_view.dart';import 'package:refena_flutter/refena_flutter.dart';import 'package:routerino/routerino.dart';-class SettingsTab extends StatefulWidget {- const SettingsTab({Key? key}) : super(key: key);+final _isLinux = checkPlatform([TargetPlatform.linux]);+final _isWindows = checkPlatform([TargetPlatform.windows]);- @override- State<SettingsTab> createState() => _SettingsTabState();-}--class _SettingsTabState extends State<SettingsTab> with Refena {- final _isLinux = checkPlatform([TargetPlatform.linux]);- final _isWindows = checkPlatform([TargetPlatform.windows]);- final _aliasController = TextEditingController();- final _deviceModelController = TextEditingController();- final _portController = TextEditingController();- final _multicastController = TextEditingController();- bool _advanced = false;-- @override- void initState() {- super.initState();- ensureRef((ref) {- final settings = ref.read(settingsProvider);- _aliasController.text = settings.alias;- _deviceModelController.text = ref.read(deviceInfoProvider).deviceModel ?? '';- _portController.text = settings.port.toString();- _multicastController.text = settings.multicastGroup;- });- }-- @override- void dispose() {- _aliasController.dispose();- _deviceModelController.dispose();- _portController.dispose();- _multicastController.dispose();- super.dispose();- }+class SettingsTab extends StatelessWidget {+ const SettingsTab();@overrideWidget build(BuildContext context) {- final settings = ref.watch(settingsProvider);- final serverState = ref.watch(serverProvider);- final deviceInfo = ref.watch(deviceInfoProvider);- return ResponsiveListView(- padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 40),- children: [- Padding(- padding: const EdgeInsets.only(left: 8),- child: Text(t.settingsTab.title, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center),- ),- const SizedBox(height: 30),- _SettingsSection(- title: t.settingsTab.general.title,+ return ViewModelBuilder(+ provider: settingsTabControllerProvider,+ builder: (context, vm) {+ final ref = context.ref;+ return ResponsiveListView(+ padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 40),children: [- _SettingsEntry(- label: t.settingsTab.general.brightness,- child: CustomDropdownButton<ThemeMode>(- value: settings.theme,- items: ThemeMode.values.map((theme) {- return DropdownMenuItem(- value: theme,- alignment: Alignment.center,- child: Text(theme.humanName),- );- }).toList(),- onChanged: (theme) async {- if (theme != null) {- await ref.notifier(settingsProvider).setTheme(theme);- await sleepAsync(500); // workaround: brightness takes some time to be updated- if (mounted) {- await updateSystemOverlayStyle(context);- }- }- },- ),- ),- _SettingsEntry(- label: t.settingsTab.general.color,- child: CustomDropdownButton<ColorMode>(- value: settings.colorMode,- items: ColorMode.values.map((colorMode) {- return DropdownMenuItem(- value: colorMode,- alignment: Alignment.center,- child: Text(colorMode.humanName),- );- }).toList(),- onChanged: (colorMode) async {- if (colorMode != null) {- await ref.notifier(settingsProvider).setColorMode(colorMode);- if (colorMode == ColorMode.oled) {- await ref.notifier(settingsProvider).setTheme(ThemeMode.dark);- await updateSystemOverlayStyleWithBrightness(Brightness.dark);- }- }- },- ),+ Padding(+ padding: const EdgeInsets.only(left: 8),+ child: Text(t.settingsTab.title, style: Theme.of(context).textTheme.titleLarge, textAlign: TextAlign.center),),- _SettingsEntry(- label: t.settingsTab.general.language,- child: TextButton(- style: TextButton.styleFrom(- backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,- shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),- foregroundColor: Theme.of(context).colorScheme.onSurface,- ),- onPressed: () async {- await context.push(() => const LanguagePage());- },- child: Padding(- padding: const EdgeInsets.symmetric(vertical: 5),- child: Text(- settings.locale?.humanName ?? t.settingsTab.general.languageOptions.system,- style: Theme.of(context).textTheme.titleMedium,- textAlign: TextAlign.center,+ const SizedBox(height: 30),+ _SettingsSection(+ title: t.settingsTab.general.title,+ children: [+ _SettingsEntry(+ label: t.settingsTab.general.brightness,+ child: CustomDropdownButton<ThemeMode>(+ value: vm.settings.theme,+ items: vm.themeModes.map((theme) {+ return DropdownMenuItem(+ value: theme,+ alignment: Alignment.center,+ child: Text(theme.humanName),+ );+ }).toList(),+ onChanged: (theme) => vm.onChangeTheme(context, theme),),),- ),- ),- if (checkPlatformIsDesktop()) ...[- /// Wayland does window position handling, so there's no need for it. See [https://github.com/localsend/localsend/issues/544]- if (_advanced && checkPlatformIsNotWaylandDesktop())- _BooleanEntry(- label: t.settingsTab.general.saveWindowPlacement,- value: settings.saveWindowPlacement,- onChanged: (b) async {- await ref.notifier(settingsProvider).setSaveWindowPlacement(b);- },- ),- if (checkPlatformHasTray()) ...[- _BooleanEntry(- label: t.settingsTab.general.minimizeToTray,- value: settings.minimizeToTray,- onChanged: (b) async {- await ref.notifier(settingsProvider).setMinimizeToTray(b);- },- ),- ],- // Linux autostart is simpler, so a boolean entry is used- if (_isLinux)- _BooleanEntry(- label: t.settingsTab.general.launchAtStartup,- value: settings.launchAtStartup,- onChanged: (b) async {- late bool result;- if (await isLinuxLaunchAtStartEnabled()) {- result = await initDisableAutoStart(settings);- } else {- result = await initEnableAutoStartAndOpenSettings(settings);- }- if (result) {- await ref.notifier(settingsProvider).setLaunchAtStartup(b);- }- },+ _SettingsEntry(+ label: t.settingsTab.general.color,+ child: CustomDropdownButton<ColorMode>(+ value: vm.settings.colorMode,+ items: vm.colorModes.map((colorMode) {+ return DropdownMenuItem(+ value: colorMode,+ alignment: Alignment.center,+ child: Text(colorMode.humanName),+ );+ }).toList(),+ onChanged: vm.onChangeColorMode,+ ),),- // Windows requires a manual action, so this settings entry is required- if (_isWindows)_SettingsEntry(- label: t.settingsTab.general.launchAtStartup,+ label: t.settingsTab.general.language,child: TextButton(style: TextButton.styleFrom(backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),foregroundColor: Theme.of(context).colorScheme.onSurface,),- onPressed: () async {- await initDisableAutoStart(settings);- await initEnableAutoStartAndOpenSettings(settings, _isWindows);- },+ onPressed: () => vm.onTapLanguage(context),child: Padding(padding: const EdgeInsets.symmetric(vertical: 5),- child: Text(t.general.settings, style: Theme.of(context).textTheme.titleMedium),+ child: Text(+ vm.settings.locale?.humanName ?? t.settingsTab.general.languageOptions.system,+ style: Theme.of(context).textTheme.titleMedium,+ textAlign: TextAlign.center,+ ),),),),- if (_isWindows || _isLinux)- Visibility(- visible: settings.launchAtStartup || _isWindows,- maintainAnimation: true,- maintainState: true,- child: AnimatedOpacity(- opacity: settings.launchAtStartup || _isWindows ? 1.0 : 0.0,- duration: const Duration(milliseconds: 500),- child: _BooleanEntry(- label: t.settingsTab.general.launchMinimized,- value: settings.autoStartLaunchMinimized,- onChanged: (b) async {- await initDisableAutoStart(settings);- await ref.notifier(settingsProvider).setAutoStartLaunchMinimized(b);- await initEnableAutoStartAndOpenSettings(settings, _isWindows);+ if (checkPlatformIsDesktop()) ...[+ /// Wayland does window position handling, so there's no need for it. See [https://github.com/localsend/localsend/issues/544]+ if (vm.advanced && checkPlatformIsNotWaylandDesktop())+ _BooleanEntry(+ label: t.settingsTab.general.saveWindowPlacement,+ value: vm.settings.saveWindowPlacement,+ onChanged: (b) async {+ await ref.notifier(settingsProvider).setSaveWindowPlacement(b);+ },+ ),+ if (checkPlatformHasTray()) ...[+ _BooleanEntry(+ label: t.settingsTab.general.minimizeToTray,+ value: vm.settings.minimizeToTray,+ onChanged: (b) async {+ await ref.notifier(settingsProvider).setMinimizeToTray(b);+ },+ ),+ ],+ // Linux autostart is simpler, so a boolean entry is used+ if (_isLinux)+ _BooleanEntry(+ label: t.settingsTab.general.launchAtStartup,+ value: vm.settings.launchAtStartup,+ onChanged: (b) async {+ late bool result;+ if (await isLinuxLaunchAtStartEnabled()) {+ result = await initDisableAutoStart(vm.settings);+ } else {+ result = await initEnableAutoStartAndOpenSettings(vm.settings);+ }+ if (result) {+ await ref.notifier(settingsProvider).setLaunchAtStartup(b);+ }+ },+ ),+ // Windows requires a manual action, so this settings entry is required+ if (_isWindows)+ _SettingsEntry(+ label: t.settingsTab.general.launchAtStartup,+ child: TextButton(+ style: TextButton.styleFrom(+ backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,+ shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),+ foregroundColor: Theme.of(context).colorScheme.onSurface,+ ),+ onPressed: () async {+ await initDisableAutoStart(vm.settings);+ await initEnableAutoStartAndOpenSettings(vm.settings, _isWindows);},+ child: Padding(+ padding: const EdgeInsets.symmetric(vertical: 5),+ child: Text(t.general.settings, style: Theme.of(context).textTheme.titleMedium),+ ),),- )),- ],- if (_advanced)- _BooleanEntry(- label: t.settingsTab.general.animations,- value: settings.enableAnimations,- onChanged: (b) async {- await ref.notifier(settingsProvider).setEnableAnimations(b);- },- ),- ],- ),- _SettingsSection(- title: t.settingsTab.receive.title,- children: [- _BooleanEntry(- label: t.settingsTab.receive.quickSave,- value: settings.quickSave,- onChanged: (b) async {- final old = settings.quickSave;- await ref.notifier(settingsProvider).setQuickSave(b);- if (!old && b && mounted) {- await QuickSaveNotice.open(context);- }- },- ),- if (checkPlatformWithFileSystem())- _SettingsEntry(- label: t.settingsTab.receive.destination,- child: TextButton(- style: TextButton.styleFrom(- backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,- shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),- foregroundColor: Theme.of(context).colorScheme.onSurface,+ ),+ if (_isWindows || _isLinux)+ Visibility(+ visible: vm.settings.launchAtStartup || _isWindows,+ maintainAnimation: true,+ maintainState: true,+ child: AnimatedOpacity(+ opacity: vm.settings.launchAtStartup || _isWindows ? 1.0 : 0.0,+ duration: const Duration(milliseconds: 500),+ child: _BooleanEntry(+ label: t.settingsTab.general.launchMinimized,+ value: vm.settings.autoStartLaunchMinimized,+ onChanged: (b) async {+ await initDisableAutoStart(vm.settings);+ await ref.notifier(settingsProvider).setAutoStartLaunchMinimized(b);+ await initEnableAutoStartAndOpenSettings(vm.settings, _isWindows);+ },+ ),+ )),+ ],+ if (vm.advanced)+ _BooleanEntry(+ label: t.settingsTab.general.animations,+ value: vm.settings.enableAnimations,+ onChanged: (b) async {+ await ref.notifier(settingsProvider).setEnableAnimations(b);+ },),- onPressed: () async {- if (settings.destination != null) {- await ref.notifier(settingsProvider).setDestination(null);- return;- }-- final directory = await pickDirectoryPath();- if (directory != null) {- await ref.notifier(settingsProvider).setDestination(directory);+ ],+ ),+ _SettingsSection(+ title: t.settingsTab.receive.title,+ children: [+ _BooleanEntry(+ label: t.settingsTab.receive.quickSave,+ value: vm.settings.quickSave,+ onChanged: (b) async {+ final old = vm.settings.quickSave;+ await ref.notifier(settingsProvider).setQuickSave(b);+ if (!old && b && context.mounted) {+ await QuickSaveNotice.open(context);}},- child: Padding(- padding: const EdgeInsets.symmetric(vertical: 5),- child: Text(settings.destination ?? t.settingsTab.receive.downloads, style: Theme.of(context).textTheme.titleMedium),- ),),- ),- if (checkPlatformWithGallery())- _BooleanEntry(- label: t.settingsTab.receive.saveToGallery,- value: settings.saveToGallery,- onChanged: (b) async {- await ref.notifier(settingsProvider).setSaveToGallery(b);- },- ),- _BooleanEntry(- label: t.settingsTab.receive.saveToHistory,- value: settings.saveToHistory,- onChanged: (b) async {- await ref.notifier(settingsProvider).setSaveToHistory(b);- },- ),- ],- ),- _SettingsSection(- title: t.settingsTab.network.title,- padding: const EdgeInsets.only(bottom: 0),- children: [- AnimatedCrossFade(- crossFadeState: serverState != null &&- (serverState.alias != settings.alias || serverState.port != settings.port || serverState.https != settings.https)- ? CrossFadeState.showSecond- : CrossFadeState.showFirst,- duration: const Duration(milliseconds: 200),- alignment: Alignment.topLeft,- firstChild: Container(),- secondChild: Padding(- padding: const EdgeInsets.only(bottom: 15),- child: Text(t.settingsTab.network.needRestart, style: TextStyle(color: Theme.of(context).colorScheme.warning)),- ),- ),- _SettingsEntry(- label: '${t.settingsTab.network.server}${serverState == null ? ' (${t.general.offline})' : ''}',- child: DecoratedBox(- decoration: BoxDecoration(- color: Theme.of(context).inputDecorationTheme.fillColor,- borderRadius: Theme.of(context).inputDecorationTheme.borderRadius,- ),- child: Row(- mainAxisAlignment: MainAxisAlignment.spaceEvenly,- children: [- if (serverState == null)- Tooltip(- message: t.general.start,- child: TextButton(- style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.onSurface),- onPressed: () async {- try {- await ref.notifier(serverProvider).startServerFromSettings();- } catch (e) {- // ignore: use_build_context_synchronously- context.showSnackBar(e.toString());- }- },- child: const Icon(Icons.play_arrow),- ),- )- else- Tooltip(- message: t.general.restart,- child: TextButton(- style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.onSurface),- onPressed: () async {- try {- final newServerState = await ref.notifier(serverProvider).restartServer(- alias: settings.alias,- port: settings.port,- https: settings.https,- );-- if (newServerState != null) {- // the new state is always valid, so we can "repair" user's setting- _aliasController.text = newServerState.alias;- _portController.text = newServerState.port.toString();- await ref.notifier(settingsProvider).setAlias(newServerState.alias);- await ref.notifier(settingsProvider).setPort(newServerState.port);- }- } catch (e) {- // ignore: use_build_context_synchronously- context.showSnackBar(e.toString());- }- },- child: const Icon(Icons.refresh),- ),+ if (checkPlatformWithFileSystem())+ _SettingsEntry(+ label: t.settingsTab.receive.destination,+ child: TextButton(+ style: TextButton.styleFrom(+ backgroundColor: Theme.of(context).inputDecorationTheme.fillColor,+ shape: RoundedRectangleBorder(borderRadius: Theme.of(context).inputDecorationTheme.borderRadius),+ foregroundColor: Theme.of(context).colorScheme.onSurface,),- Tooltip(- message: t.general.stop,- child: TextButton(- style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.onSurface),- onPressed: serverState == null- ? null- : () async {- await ref.notifier(serverProvider).stopServer();- },- child: const Icon(Icons.stop),+ onPressed: () async {+ if (vm.settings.destination != null) {+ await ref.notifier(settingsProvider).setDestination(null);+ return;+ }++ final directory = await pickDirectoryPath();+ if (directory != null) {+ await ref.notifier(settingsProvider).setDestination(directory);+ }+ },+ child: Padding(+ padding: const EdgeInsets.symmetric(vertical: 5),+ child: Text(vm.settings.destination ?? t.settingsTab.receive.downloads, style: Theme.of(context).textTheme.titleMedium),),),- ],+ ),+ if (checkPlatformWithGallery())+ _BooleanEntry(+ label: t.settingsTab.receive.saveToGallery,+ value: vm.settings.saveToGallery,+ onChanged: (b) async {+ await ref.notifier(settingsProvider).setSaveToGallery(b);+ },+ ),+ _BooleanEntry(+ label: t.settingsTab.receive.saveToHistory,+ value: vm.settings.saveToHistory,+ onChanged: (b) async {+ await ref.notifier(settingsProvider).setSaveToHistory(b);+ },),- ),- ),- _SettingsEntry(- label: t.settingsTab.network.alias,- child: TextFieldTv(- name: t.settingsTab.network.alias,- controller: _aliasController,- onChanged: (s) async {- await ref.notifier(settingsProvider).setAlias(s);- },- ),+ ],),- if (_advanced)- _SettingsEntry(- label: t.settingsTab.network.deviceType,- child: CustomDropdownButton<DeviceType>(- value: deviceInfo.deviceType,- items: DeviceType.values.map((type) {- return DropdownMenuItem(- value: type,- alignment: Alignment.center,- child: Icon(type.icon),- );- }).toList(),- onChanged: (type) async {- if (type != null) {- await ref.notifier(settingsProvider).setDeviceType(type);- }- },+ _SettingsSection(+ title: t.settingsTab.network.title,+ padding: const EdgeInsets.only(bottom: 0),+ children: [+ AnimatedCrossFade(+ crossFadeState: vm.serverState != null &&+ (vm.serverState!.alias != vm.settings.alias ||+ vm.serverState!.port != vm.settings.port ||+ vm.serverState!.https != vm.settings.https)+ ? CrossFadeState.showSecond+ : CrossFadeState.showFirst,+ duration: const Duration(milliseconds: 200),+ alignment: Alignment.topLeft,+ firstChild: Container(),+ secondChild: Padding(+ padding: const EdgeInsets.only(bottom: 15),+ child: Text(t.settingsTab.network.needRestart, style: TextStyle(color: Theme.of(context).colorScheme.warning)),+ ),),- ),- if (_advanced)- _SettingsEntry(- label: t.settingsTab.network.deviceModel,- child: TextFieldTv(- name: t.settingsTab.network.deviceModel,- controller: _deviceModelController,- onChanged: (s) async {- await ref.notifier(settingsProvider).setDeviceModel(s);- },+ _SettingsEntry(+ label: '${t.settingsTab.network.server}${vm.serverState == null ? ' (${t.general.offline})' : ''}',+ child: DecoratedBox(+ decoration: BoxDecoration(+ color: Theme.of(context).inputDecorationTheme.fillColor,+ borderRadius: Theme.of(context).inputDecorationTheme.borderRadius,+ ),+ child: Row(+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,+ children: [+ if (vm.serverState == null)+ Tooltip(+ message: t.general.start,+ child: TextButton(+ style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.onSurface),+ onPressed: () => vm.onTapStartServer(context),+ child: const Icon(Icons.play_arrow),+ ),+ )+ else+ Tooltip(+ message: t.general.restart,+ child: TextButton(+ style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.onSurface),+ onPressed: () => vm.onTapRestartServer(context),+ child: const Icon(Icons.refresh),+ ),+ ),+ Tooltip(+ message: t.general.stop,+ child: TextButton(+ style: TextButton.styleFrom(foregroundColor: Theme.of(context).colorScheme.onSurface),+ onPressed: vm.serverState == null ? null : vm.onTapStopServer,+ child: const Icon(Icons.stop),+ ),+ ),+ ],+ ),+ ),),- ),- if (_advanced)- _SettingsEntry(- label: t.settingsTab.network.port,- child: TextFieldTv(- name: t.settingsTab.network.port,- controller: _portController,- onChanged: (s) async {- final port = int.tryParse(s);- if (port != null) {- await ref.notifier(settingsProvider).setPort(port);- }- },+ _SettingsEntry(+ label: t.settingsTab.network.alias,+ child: TextFieldTv(+ name: t.settingsTab.network.alias,+ controller: vm.aliasController,+ onChanged: (s) async {+ await ref.notifier(settingsProvider).setAlias(s);+ },+ ),),- ),- if (_advanced)- _BooleanEntry(- label: t.settingsTab.network.encryption,- value: settings.https,- onChanged: (b) async {- final old = settings.https;- await ref.notifier(settingsProvider).setHttps(b);- if (old && !b && mounted) {- await EncryptionDisabledNotice.open(context);- }- },- ),- if (_advanced)- _SettingsEntry(- label: t.settingsTab.network.multicastGroup,- child: TextFieldTv(- name: t.settingsTab.network.multicastGroup,- controller: _multicastController,- onChanged: (s) async {- await ref.notifier(settingsProvider).setMulticastGroup(s);- },+ if (vm.advanced)+ _SettingsEntry(+ label: t.settingsTab.network.deviceType,+ child: CustomDropdownButton<DeviceType>(+ value: vm.deviceInfo.deviceType,+ items: DeviceType.values.map((type) {+ return DropdownMenuItem(+ value: type,+ alignment: Alignment.center,+ child: Icon(type.icon),+ );+ }).toList(),+ onChanged: (type) async {+ await ref.notifier(settingsProvider).setDeviceType(type);+ },+ ),+ ),+ if (vm.advanced)+ _SettingsEntry(+ label: t.settingsTab.network.deviceModel,+ child: TextFieldTv(+ name: t.settingsTab.network.deviceModel,+ controller: vm.deviceModelController,+ onChanged: (s) async {+ await ref.notifier(settingsProvider).setDeviceModel(s);+ },+ ),+ ),+ if (vm.advanced)+ _SettingsEntry(+ label: t.settingsTab.network.port,+ child: TextFieldTv(+ name: t.settingsTab.network.port,+ controller: vm.portController,+ onChanged: (s) async {+ final port = int.tryParse(s);+ if (port != null) {+ await ref.notifier(settingsProvider).setPort(port);+ }+ },+ ),+ ),+ if (vm.advanced)+ _BooleanEntry(+ label: t.settingsTab.network.encryption,+ value: vm.settings.https,+ onChanged: (b) async {+ final old = vm.settings.https;+ await ref.notifier(settingsProvider).setHttps(b);+ if (old && !b && context.mounted) {+ await EncryptionDisabledNotice.open(context);+ }+ },+ ),+ if (vm.advanced)+ _SettingsEntry(+ label: t.settingsTab.network.multicastGroup,+ child: TextFieldTv(+ name: t.settingsTab.network.multicastGroup,+ controller: vm.multicastController,+ onChanged: (s) async {+ await ref.notifier(settingsProvider).setMulticastGroup(s);+ },+ ),+ ),+ AnimatedCrossFade(+ crossFadeState: vm.settings.port != defaultPort ? CrossFadeState.showSecond : CrossFadeState.showFirst,+ duration: const Duration(milliseconds: 200),+ alignment: Alignment.topLeft,+ firstChild: Container(),+ secondChild: Padding(+ padding: const EdgeInsets.only(bottom: 15),+ child: Text(+ t.settingsTab.network.portWarning(defaultPort: defaultPort),+ style: const TextStyle(color: Colors.grey),+ ),+ ),),- ),- AnimatedCrossFade(- crossFadeState: settings.port != defaultPort ? CrossFadeState.showSecond : CrossFadeState.showFirst,- duration: const Duration(milliseconds: 200),- alignment: Alignment.topLeft,- firstChild: Container(),- secondChild: Padding(- padding: const EdgeInsets.only(bottom: 15),- child: Text(- t.settingsTab.network.portWarning(defaultPort: defaultPort),- style: const TextStyle(color: Colors.grey),+ AnimatedCrossFade(+ crossFadeState: vm.settings.multicastGroup != defaultMulticastGroup ? CrossFadeState.showSecond : CrossFadeState.showFirst,+ duration: const Duration(milliseconds: 200),+ alignment: Alignment.topLeft,+ firstChild: Container(),+ secondChild: Padding(+ padding: const EdgeInsets.only(bottom: 15),+ child: Text(+ t.settingsTab.network.multicastGroupWarning(defaultMulticast: defaultMulticastGroup),+ style: const TextStyle(color: Colors.grey),+ ),+ ),),- ),+ ],),- AnimatedCrossFade(- crossFadeState: settings.multicastGroup != defaultMulticastGroup ? CrossFadeState.showSecond : CrossFadeState.showFirst,- duration: const Duration(milliseconds: 200),- alignment: Alignment.topLeft,- firstChild: Container(),- secondChild: Padding(- padding: const EdgeInsets.only(bottom: 15),- child: Text(- t.settingsTab.network.multicastGroupWarning(defaultMulticast: defaultMulticastGroup),- style: const TextStyle(color: Colors.grey),+ Row(+ mainAxisAlignment: MainAxisAlignment.end,+ children: [+ LabeledCheckbox(+ label: t.settingsTab.advancedSettings,+ value: vm.advanced,+ labelFirst: true,+ onChanged: (b) => vm.onTapAdvanced(b == true),),- ),+ const SizedBox(width: 10),+ ],),- ],- ),- Row(- mainAxisAlignment: MainAxisAlignment.end,- children: [- LabeledCheckbox(- label: t.settingsTab.advancedSettings,- value: _advanced,- labelFirst: true,- onChanged: (b) {- setState(() => _advanced = b == true);- },+ const SizedBox(height: 20),+ const LocalSendLogo(withText: true),+ const SizedBox(height: 5),+ ref.watch(versionProvider).maybeWhen(+ data: (version) => Text(+ 'Version: $version',+ textAlign: TextAlign.center,+ ),+ orElse: () => Container(),+ ),+ Text(+ '© ${DateTime.now().year} Tien Do Nam',+ textAlign: TextAlign.center,),- const SizedBox(width: 10),- ],- ),- const SizedBox(height: 20),- const LocalSendLogo(withText: true),- const SizedBox(height: 5),- ref.watch(versionProvider).maybeWhen(- data: (version) => Text(- 'Version: $version',- textAlign: TextAlign.center,+ const SizedBox(height: 30),+ Theme(+ data: Theme.of(context).copyWith(+ textButtonTheme: TextButtonThemeData(+ style: TextButton.styleFrom(+ foregroundColor: Theme.of(context).colorScheme.onSurface,+ ),+ ),),- orElse: () => Container(),- ),- Text(- '© ${DateTime.now().year} Tien Do Nam',- textAlign: TextAlign.center,- ),- const SizedBox(height: 30),- Theme(- data: Theme.of(context).copyWith(- textButtonTheme: TextButtonThemeData(- style: TextButton.styleFrom(- foregroundColor: Theme.of(context).colorScheme.onSurface,+ child: Column(+ crossAxisAlignment: CrossAxisAlignment.center,+ children: [+ TextButton.icon(+ onPressed: () async {+ await context.push(() => const AboutPage());+ },+ icon: const Icon(Icons.info),+ label: Text(t.aboutPage.title),+ ),+ TextButton.icon(+ onPressed: () async {+ await context.push(() => const ChangelogPage());+ },+ icon: const Icon(Icons.history),+ label: Text(t.changelogPage.title),+ ),+ ],),),- ),- child: Column(- crossAxisAlignment: CrossAxisAlignment.center,- children: [- TextButton.icon(- onPressed: () async {- await context.push(() => const AboutPage());- },- icon: const Icon(Icons.info),- label: Text(t.aboutPage.title),- ),- TextButton.icon(- onPressed: () async {- await context.push(() => const ChangelogPage());- },- icon: const Icon(Icons.history),- label: Text(t.changelogPage.title),- ),- ],- ),- ),- const SizedBox(height: 80),- ],+ const SizedBox(height: 80),+ ],+ );+ },);}}diff --git a/app/lib/pages/tabs/settings_tab_controller.dart b/app/lib/pages/tabs/settings_tab_controller.dartnew file mode 100644index 00000000..3bd8c0e8--- /dev/null+++ b/app/lib/pages/tabs/settings_tab_controller.dart@@ -0,0 +1,141 @@+import 'package:flutter/material.dart';+import 'package:localsend_app/model/persistence/color_mode.dart';+import 'package:localsend_app/pages/language_page.dart';+import 'package:localsend_app/pages/tabs/settings_tab_vm.dart';+import 'package:localsend_app/provider/device_info_provider.dart';+import 'package:localsend_app/provider/network/server/server_provider.dart';+import 'package:localsend_app/provider/settings_provider.dart';+import 'package:localsend_app/theme.dart';+import 'package:localsend_app/util/native/device_info_helper.dart';+import 'package:localsend_app/util/sleep.dart';+import 'package:localsend_app/util/ui/dynamic_colors.dart';+import 'package:localsend_app/util/ui/snackbar.dart';+import 'package:refena_flutter/refena_flutter.dart';+import 'package:routerino/routerino.dart';++final settingsTabControllerProvider = ReduxProvider<SettingsTabController, SettingsTabVm>((ref) {+ final settings = ref.notifier(settingsProvider);+ final server = ref.notifier(serverProvider);+ final initialDeviceInfo = ref.read(deviceInfoProvider);+ final supportsDynamicColors = ref.read(dynamicColorsProvider) != null;++ return SettingsTabController(+ settingsService: settings,+ serverNotifier: server,+ initialDeviceInfo: initialDeviceInfo,+ supportsDynamicColors: supportsDynamicColors,+ );+});++class SettingsTabController extends ReduxNotifier<SettingsTabVm> {+ final SettingsNotifier _settingsService;+ final ServerNotifier _serverService;+ final DeviceInfoResult _initialDeviceInfo;+ final bool _supportsDynamicColors;++ SettingsTabController({+ required SettingsNotifier settingsService,+ required ServerNotifier serverNotifier,+ required DeviceInfoResult initialDeviceInfo,+ required bool supportsDynamicColors,+ }) : _settingsService = settingsService,+ _serverService = serverNotifier,+ _initialDeviceInfo = initialDeviceInfo,+ _supportsDynamicColors = supportsDynamicColors;++ @override+ SettingsTabVm init() {+ return SettingsTabVm(+ advanced: false,+ aliasController: TextEditingController(text: _settingsService.state.alias),+ deviceModelController: TextEditingController(text: _initialDeviceInfo.deviceModel),+ portController: TextEditingController(text: _settingsService.state.port.toString()),+ multicastController: TextEditingController(text: _settingsService.state.multicastGroup),+ settings: _settingsService.state,+ serverState: _serverService.state,+ deviceInfo: _initialDeviceInfo,+ colorModes: _supportsDynamicColors ? ColorMode.values : ColorMode.values.where((e) => e != ColorMode.system).toList(),+ onChangeTheme: (context, theme) async {+ await _settingsService.setTheme(theme);+ await sleepAsync(500); // workaround: brightness takes some time to be updated+ if (context.mounted) {+ await updateSystemOverlayStyle(context);+ }+ },+ onChangeColorMode: (colorMode) async {+ await _settingsService.setColorMode(colorMode);+ if (colorMode == ColorMode.oled) {+ await _settingsService.setTheme(ThemeMode.dark);+ await updateSystemOverlayStyleWithBrightness(Brightness.dark);+ }+ },+ onTapLanguage: (context) async {+ await context.push(() => const LanguagePage());+ },+ onTapRestartServer: (context) async {+ try {+ final newServerState = await _serverService.restartServer(+ alias: _settingsService.state.alias,+ port: _settingsService.state.port,+ https: _settingsService.state.https,+ );++ if (newServerState != null) {+ // the new state is always valid, so we can "repair" user's setting+ state.aliasController.text = newServerState.alias;+ state.portController.text = newServerState.port.toString();+ await _settingsService.setAlias(newServerState.alias);+ await _settingsService.setPort(newServerState.port);+ }+ } catch (e) {+ // ignore: use_build_context_synchronously+ context.showSnackBar(e.toString());+ }+ },+ onTapStartServer: (context) async {+ try {+ await _serverService.startServerFromSettings();+ } catch (e) {+ // ignore: use_build_context_synchronously+ context.showSnackBar(e.toString());+ }+ },+ onTapStopServer: () async => await _serverService.stopServer(),+ onTapAdvanced: (advanced) => redux.dispatch(SetAdvancedAction(advanced)),+ );+ }++ @override+ get initialAction => _SettingsTabWatchAction();++ @override+ void dispose() {+ state.aliasController.dispose();+ state.deviceModelController.dispose();+ state.portController.dispose();+ state.multicastController.dispose();+ super.dispose();+ }+}++class _SettingsTabWatchAction extends WatchAction<SettingsTabController, SettingsTabVm> {+ @override+ SettingsTabVm reduce() {+ return state.copyWith(+ settings: ref.watch(settingsProvider),+ serverState: ref.watch(serverProvider),+ deviceInfo: ref.watch(deviceInfoProvider),+ );+ }+}++class SetAdvancedAction extends ReduxAction<SettingsTabController, SettingsTabVm> {+ final bool advanced;++ SetAdvancedAction(this.advanced);++ @override+ SettingsTabVm reduce() {+ return state.copyWith(advanced: advanced);+ }+}diff --git a/app/lib/pages/tabs/settings_tab_vm.dart b/app/lib/pages/tabs/settings_tab_vm.dartnew file mode 100644index 00000000..2ac132cc--- /dev/null+++ b/app/lib/pages/tabs/settings_tab_vm.dart@@ -0,0 +1,49 @@+import 'package:dart_mappable/dart_mappable.dart';+import 'package:flutter/material.dart';+import 'package:localsend_app/model/persistence/color_mode.dart';+import 'package:localsend_app/model/state/server/server_state.dart';+import 'package:localsend_app/model/state/settings_state.dart';+import 'package:localsend_app/util/native/device_info_helper.dart';++part 'settings_tab_vm.mapper.dart';++@MappableClass()+class SettingsTabVm with SettingsTabVmMappable {+ final bool advanced;+ final TextEditingController aliasController;+ final TextEditingController deviceModelController;+ final TextEditingController portController;+ final TextEditingController multicastController;++ final SettingsState settings;+ final ServerState? serverState;+ final DeviceInfoResult deviceInfo;+ final List<ThemeMode> themeModes = ThemeMode.values;+ final List<ColorMode> colorModes;+ final void Function(BuildContext context, ThemeMode mode) onChangeTheme;+ final void Function(ColorMode mode) onChangeColorMode;+ final void Function(BuildContext context) onTapLanguage;+ final void Function(BuildContext context) onTapRestartServer;+ final void Function(BuildContext context) onTapStartServer;+ final void Function() onTapStopServer;+ final void Function(bool advanced) onTapAdvanced;++ SettingsTabVm({+ required this.advanced,+ required this.aliasController,+ required this.deviceModelController,+ required this.portController,+ required this.multicastController,+ required this.settings,+ required this.serverState,+ required this.deviceInfo,+ required this.colorModes,+ required this.onChangeTheme,+ required this.onChangeColorMode,+ required this.onTapLanguage,+ required this.onTapRestartServer,+ required this.onTapStartServer,+ required this.onTapStopServer,+ required this.onTapAdvanced,+ });+}diff --git a/app/lib/pages/tabs/settings_tab_vm.mapper.dart b/app/lib/pages/tabs/settings_tab_vm.mapper.dartnew file mode 100644index 00000000..0c703f4e--- /dev/null+++ b/app/lib/pages/tabs/settings_tab_vm.mapper.dart@@ -0,0 +1,296 @@+// coverage:ignore-file+// GENERATED CODE - DO NOT MODIFY BY HAND+// ignore_for_file: type=lint+// ignore_for_file: unused_element++part of 'settings_tab_vm.dart';++class SettingsTabVmMapper extends ClassMapperBase<SettingsTabVm> {+ SettingsTabVmMapper._();++ static SettingsTabVmMapper? _instance;+ static SettingsTabVmMapper ensureInitialized() {+ if (_instance == null) {+ MapperContainer.globals.use(_instance = SettingsTabVmMapper._());+ SettingsStateMapper.ensureInitialized();+ ServerStateMapper.ensureInitialized();+ }+ return _instance!;+ }++ static T _guard<T>(T Function(MapperContainer) fn) {+ ensureInitialized();+ return fn(MapperContainer.globals);+ }++ @override+ final String id = 'SettingsTabVm';++ static bool _$advanced(SettingsTabVm v) => v.advanced;+ static const Field<SettingsTabVm, bool> _f$advanced =+ Field('advanced', _$advanced);+ static TextEditingController _$aliasController(SettingsTabVm v) =>+ v.aliasController;+ static const Field<SettingsTabVm, TextEditingController> _f$aliasController =+ Field('aliasController', _$aliasController);+ static TextEditingController _$deviceModelController(SettingsTabVm v) =>+ v.deviceModelController;+ static const Field<SettingsTabVm, TextEditingController>+ _f$deviceModelController =+ Field('deviceModelController', _$deviceModelController);+ static TextEditingController _$portController(SettingsTabVm v) =>+ v.portController;+ static const Field<SettingsTabVm, TextEditingController> _f$portController =+ Field('portController', _$portController);+ static TextEditingController _$multicastController(SettingsTabVm v) =>+ v.multicastController;+ static const Field<SettingsTabVm, TextEditingController>+ _f$multicastController =+ Field('multicastController', _$multicastController);+ static SettingsState _$settings(SettingsTabVm v) => v.settings;+ static const Field<SettingsTabVm, SettingsState> _f$settings =+ Field('settings', _$settings);+ static ServerState? _$serverState(SettingsTabVm v) => v.serverState;+ static const Field<SettingsTabVm, ServerState> _f$serverState =+ Field('serverState', _$serverState);+ static DeviceInfoResult _$deviceInfo(SettingsTabVm v) => v.deviceInfo;+ static const Field<SettingsTabVm, DeviceInfoResult> _f$deviceInfo =+ Field('deviceInfo', _$deviceInfo);+ static List<ColorMode> _$colorModes(SettingsTabVm v) => v.colorModes;+ static const Field<SettingsTabVm, List<ColorMode>> _f$colorModes =+ Field('colorModes', _$colorModes);+ static void Function(BuildContext, ThemeMode) _$onChangeTheme(+ SettingsTabVm v) =>+ v.onChangeTheme;+ static const Field<SettingsTabVm, void Function(BuildContext, ThemeMode)>+ _f$onChangeTheme = Field('onChangeTheme', _$onChangeTheme);+ static void Function(ColorMode) _$onChangeColorMode(SettingsTabVm v) =>+ v.onChangeColorMode;+ static const Field<SettingsTabVm, void Function(ColorMode)>+ _f$onChangeColorMode = Field('onChangeColorMode', _$onChangeColorMode);+ static void Function(BuildContext) _$onTapLanguage(SettingsTabVm v) =>+ v.onTapLanguage;+ static const Field<SettingsTabVm, void Function(BuildContext)>+ _f$onTapLanguage = Field('onTapLanguage', _$onTapLanguage);+ static void Function(BuildContext) _$onTapRestartServer(SettingsTabVm v) =>+ v.onTapRestartServer;+ static const Field<SettingsTabVm, void Function(BuildContext)>+ _f$onTapRestartServer = Field('onTapRestartServer', _$onTapRestartServer);+ static void Function(BuildContext) _$onTapStartServer(SettingsTabVm v) =>+ v.onTapStartServer;+ static const Field<SettingsTabVm, void Function(BuildContext)>+ _f$onTapStartServer = Field('onTapStartServer', _$onTapStartServer);+ static void Function() _$onTapStopServer(SettingsTabVm v) =>+ v.onTapStopServer;+ static const Field<SettingsTabVm, void Function()> _f$onTapStopServer =+ Field('onTapStopServer', _$onTapStopServer);+ static void Function(bool) _$onTapAdvanced(SettingsTabVm v) =>+ v.onTapAdvanced;+ static const Field<SettingsTabVm, void Function(bool)> _f$onTapAdvanced =+ Field('onTapAdvanced', _$onTapAdvanced);+ static List<ThemeMode> _$themeModes(SettingsTabVm v) => v.themeModes;+ static const Field<SettingsTabVm, List<ThemeMode>> _f$themeModes =+ Field('themeModes', _$themeModes, mode: FieldMode.member);++ @override+ final Map<Symbol, Field<SettingsTabVm, dynamic>> fields = const {+ #advanced: _f$advanced,+ #aliasController: _f$aliasController,+ #deviceModelController: _f$deviceModelController,+ #portController: _f$portController,+ #multicastController: _f$multicastController,+ #settings: _f$settings,+ #serverState: _f$serverState,+ #deviceInfo: _f$deviceInfo,+ #colorModes: _f$colorModes,+ #onChangeTheme: _f$onChangeTheme,+ #onChangeColorMode: _f$onChangeColorMode,+ #onTapLanguage: _f$onTapLanguage,+ #onTapRestartServer: _f$onTapRestartServer,+ #onTapStartServer: _f$onTapStartServer,+ #onTapStopServer: _f$onTapStopServer,+ #onTapAdvanced: _f$onTapAdvanced,+ #themeModes: _f$themeModes,+ };++ static SettingsTabVm _instantiate(DecodingData data) {+ return SettingsTabVm(+ advanced: data.dec(_f$advanced),+ aliasController: data.dec(_f$aliasController),+ deviceModelController: data.dec(_f$deviceModelController),+ portController: data.dec(_f$portController),+ multicastController: data.dec(_f$multicastController),+ settings: data.dec(_f$settings),+ serverState: data.dec(_f$serverState),+ deviceInfo: data.dec(_f$deviceInfo),+ colorModes: data.dec(_f$colorModes),+ onChangeTheme: data.dec(_f$onChangeTheme),+ onChangeColorMode: data.dec(_f$onChangeColorMode),+ onTapLanguage: data.dec(_f$onTapLanguage),+ onTapRestartServer: data.dec(_f$onTapRestartServer),+ onTapStartServer: data.dec(_f$onTapStartServer),+ onTapStopServer: data.dec(_f$onTapStopServer),+ onTapAdvanced: data.dec(_f$onTapAdvanced));+ }++ @override+ final Function instantiate = _instantiate;++ static SettingsTabVm fromJson(Map<String, dynamic> map) {+ return _guard((c) => c.fromMap<SettingsTabVm>(map));+ }++ static SettingsTabVm deserialize(String json) {+ return _guard((c) => c.fromJson<SettingsTabVm>(json));+ }+}++mixin SettingsTabVmMappable {+ String serialize() {+ return SettingsTabVmMapper._guard((c) => c.toJson(this as SettingsTabVm));+ }++ Map<String, dynamic> toJson() {+ return SettingsTabVmMapper._guard((c) => c.toMap(this as SettingsTabVm));+ }++ SettingsTabVmCopyWith<SettingsTabVm, SettingsTabVm, SettingsTabVm>+ get copyWith => _SettingsTabVmCopyWithImpl(+ this as SettingsTabVm, $identity, $identity);+ @override+ String toString() {+ return SettingsTabVmMapper._guard((c) => c.asString(this));+ }++ @override+ bool operator ==(Object other) {+ return identical(this, other) ||+ (runtimeType == other.runtimeType &&+ SettingsTabVmMapper._guard((c) => c.isEqual(this, other)));+ }++ @override+ int get hashCode {+ return SettingsTabVmMapper._guard((c) => c.hash(this));+ }+}++extension SettingsTabVmValueCopy<$R, $Out>+ on ObjectCopyWith<$R, SettingsTabVm, $Out> {+ SettingsTabVmCopyWith<$R, SettingsTabVm, $Out> get $asSettingsTabVm =>+ $base.as((v, t, t2) => _SettingsTabVmCopyWithImpl(v, t, t2));+}++abstract class SettingsTabVmCopyWith<$R, $In extends SettingsTabVm, $Out>+ implements ClassCopyWith<$R, $In, $Out> {+ SettingsStateCopyWith<$R, SettingsState, SettingsState> get settings;+ ServerStateCopyWith<$R, ServerState, ServerState>? get serverState;+ ListCopyWith<$R, ColorMode, ObjectCopyWith<$R, ColorMode, ColorMode>>+ get colorModes;+ $R call(+ {bool? advanced,+ TextEditingController? aliasController,+ TextEditingController? deviceModelController,+ TextEditingController? portController,+ TextEditingController? multicastController,+ SettingsState? settings,+ ServerState? serverState,+ DeviceInfoResult? deviceInfo,+ List<ColorMode>? colorModes,+ void Function(BuildContext, ThemeMode)? onChangeTheme,+ void Function(ColorMode)? onChangeColorMode,+ void Function(BuildContext)? onTapLanguage,+ void Function(BuildContext)? onTapRestartServer,+ void Function(BuildContext)? onTapStartServer,+ void Function()? onTapStopServer,+ void Function(bool)? onTapAdvanced});+ SettingsTabVmCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);+}++class _SettingsTabVmCopyWithImpl<$R, $Out>+ extends ClassCopyWithBase<$R, SettingsTabVm, $Out>+ implements SettingsTabVmCopyWith<$R, SettingsTabVm, $Out> {+ _SettingsTabVmCopyWithImpl(super.value, super.then, super.then2);++ @override+ late final ClassMapperBase<SettingsTabVm> $mapper =+ SettingsTabVmMapper.ensureInitialized();+ @override+ SettingsStateCopyWith<$R, SettingsState, SettingsState> get settings =>+ $value.settings.copyWith.$chain((v) => call(settings: v));+ @override+ ServerStateCopyWith<$R, ServerState, ServerState>? get serverState =>+ $value.serverState?.copyWith.$chain((v) => call(serverState: v));+ @override+ ListCopyWith<$R, ColorMode, ObjectCopyWith<$R, ColorMode, ColorMode>>+ get colorModes => ListCopyWith(+ $value.colorModes,+ (v, t) => ObjectCopyWith(v, $identity, t),+ (v) => call(colorModes: v));+ @override+ $R call(+ {bool? advanced,+ TextEditingController? aliasController,+ TextEditingController? deviceModelController,+ TextEditingController? portController,+ TextEditingController? multicastController,+ SettingsState? settings,+ Object? serverState = $none,+ DeviceInfoResult? deviceInfo,+ List<ColorMode>? colorModes,+ void Function(BuildContext, ThemeMode)? onChangeTheme,+ void Function(ColorMode)? onChangeColorMode,+ void Function(BuildContext)? onTapLanguage,+ void Function(BuildContext)? onTapRestartServer,+ void Function(BuildContext)? onTapStartServer,+ void Function()? onTapStopServer,+ void Function(bool)? onTapAdvanced}) =>+ $apply(FieldCopyWithData({+ if (advanced != null) #advanced: advanced,+ if (aliasController != null) #aliasController: aliasController,+ if (deviceModelController != null)+ #deviceModelController: deviceModelController,+ if (portController != null) #portController: portController,+ if (multicastController != null)+ #multicastController: multicastController,+ if (settings != null) #settings: settings,+ if (serverState != $none) #serverState: serverState,+ if (deviceInfo != null) #deviceInfo: deviceInfo,+ if (colorModes != null) #colorModes: colorModes,+ if (onChangeTheme != null) #onChangeTheme: onChangeTheme,+ if (onChangeColorMode != null) #onChangeColorMode: onChangeColorMode,+ if (onTapLanguage != null) #onTapLanguage: onTapLanguage,+ if (onTapRestartServer != null) #onTapRestartServer: onTapRestartServer,+ if (onTapStartServer != null) #onTapStartServer: onTapStartServer,+ if (onTapStopServer != null) #onTapStopServer: onTapStopServer,+ if (onTapAdvanced != null) #onTapAdvanced: onTapAdvanced+ }));+ @override+ SettingsTabVm $make(CopyWithData data) => SettingsTabVm(+ advanced: data.get(#advanced, or: $value.advanced),+ aliasController: data.get(#aliasController, or: $value.aliasController),+ deviceModelController:+ data.get(#deviceModelController, or: $value.deviceModelController),+ portController: data.get(#portController, or: $value.portController),+ multicastController:+ data.get(#multicastController, or: $value.multicastController),+ settings: data.get(#settings, or: $value.settings),+ serverState: data.get(#serverState, or: $value.serverState),+ deviceInfo: data.get(#deviceInfo, or: $value.deviceInfo),+ colorModes: data.get(#colorModes, or: $value.colorModes),+ onChangeTheme: data.get(#onChangeTheme, or: $value.onChangeTheme),+ onChangeColorMode:+ data.get(#onChangeColorMode, or: $value.onChangeColorMode),+ onTapLanguage: data.get(#onTapLanguage, or: $value.onTapLanguage),+ onTapRestartServer:+ data.get(#onTapRestartServer, or: $value.onTapRestartServer),+ onTapStartServer:+ data.get(#onTapStartServer, or: $value.onTapStartServer),+ onTapStopServer: data.get(#onTapStopServer, or: $value.onTapStopServer),+ onTapAdvanced: data.get(#onTapAdvanced, or: $value.onTapAdvanced));++ @override+ SettingsTabVmCopyWith<$R2, SettingsTabVm, $Out2> $chain<$R2, $Out2>(+ Then<$Out2, $R2> t) =>+ _SettingsTabVmCopyWithImpl($value, $cast, t);+}diff --git a/app/lib/provider/device_info_provider.dart b/app/lib/provider/device_info_provider.dartindex 28bea577..e5b5751b 100644--- a/app/lib/provider/device_info_provider.dart+++ b/app/lib/provider/device_info_provider.dart@@ -13,12 +13,12 @@ final deviceRawInfoProvider = Provider<DeviceInfoResult>((ref) {});final deviceInfoProvider = ViewProvider<DeviceInfoResult>((ref) {- final settings = ref.watch(settingsProvider);+ final (deviceType, deviceModel) = ref.watch(settingsProvider.select((state) => (state.deviceType, state.deviceModel)));final rawInfo = ref.watch(deviceRawInfoProvider);return DeviceInfoResult(- deviceType: settings.deviceType ?? rawInfo.deviceType,- deviceModel: settings.deviceModel ?? rawInfo.deviceModel,+ deviceType: deviceType ?? rawInfo.deviceType,+ deviceModel: deviceModel ?? rawInfo.deviceModel,androidSdkInt: rawInfo.androidSdkInt,);});diff --git a/app/lib/provider/version_provider.dart b/app/lib/provider/version_provider.dartindex 4b8c1cd9..21535d1a 100644--- a/app/lib/provider/version_provider.dart+++ b/app/lib/provider/version_provider.dart@@ -4,4 +4,4 @@ import 'package:refena_flutter/refena_flutter.dart';final versionProvider = FutureProvider((ref) async {final info = await PackageInfo.fromPlatform();return '${info.version} (${info.buildNumber})';-});+}, debugLabel: 'VersionProvider');diff --git a/app/lib/refena.dart b/app/lib/refena.dartindex 8e61d734..f3f19d4a 100644--- a/app/lib/refena.dart+++ b/app/lib/refena.dart@@ -12,18 +12,21 @@ class CustomRefenaObserver extends RefenaMultiObserver {: super(observers: [RefenaDebugObserver(onLine: (line) => _logger.info(line),- exclude: (event) {- return event is ChangeEvent &&- (event.notifier is DiscoveryLogsNotifier || event.notifier is LocalIpService || event.notifier is ProgressNotifier);- },+ exclude: _exclude,),RefenaTracingObserver(limit: 100,- exclude: (event) {- return event is ChangeEvent &&- (event.notifier is DiscoveryLogsNotifier || event.notifier is LocalIpService || event.notifier is ProgressNotifier);- },+ exclude: _exclude,),RefenaInspectorObserver(),]);}++bool _exclude(RefenaEvent event) {+ return switch (event) {+ ChangeEvent() => event.notifier is DiscoveryLogsNotifier || event.notifier is LocalIpService || event.notifier is ProgressNotifier,+ ActionDispatchedEvent() => event.action.runtimeType.toString() == '_FetchLocalIpAction',+ ActionFinishedEvent() => event.action.runtimeType.toString() == '_FetchLocalIpAction',+ _ => false,+ };+}diff --git a/app/lib/widget/custom_dropdown_button.dart b/app/lib/widget/custom_dropdown_button.dartindex f63d1ca2..a446ce76 100644--- a/app/lib/widget/custom_dropdown_button.dart+++ b/app/lib/widget/custom_dropdown_button.dart@@ -6,7 +6,7 @@ import 'package:localsend_app/theme.dart';class CustomDropdownButton<T> extends StatelessWidget {final T value;final List<DropdownMenuItem<T>> items;- final ValueChanged<T?>? onChanged;+ final ValueChanged<T>? onChanged;final bool expanded;const CustomDropdownButton({@@ -27,7 +27,11 @@ class CustomDropdownButton<T> extends StatelessWidget {underline: Container(),borderRadius: Theme.of(context).inputDecorationTheme.borderRadius,items: items,- onChanged: onChanged,+ onChanged: onChanged == null ? null : (value) {+ if (value != null) {+ onChanged!(value);+ }+ },),);}diff --git a/app/pubspec.lock b/app/pubspec.lockindex cceeb7d5..6d7db310 100644--- a/app/pubspec.lock+++ b/app/pubspec.lock@@ -1089,18 +1089,18 @@ packages:dependency: transitivedescription:name: refena- sha256: "336234fcd19d41dcb1f012bdc66314246aa2a95dd1cc847f904dadb6168930cc"+ sha256: "8c1a5f818084886e4f9a38b0ce1f1c636992ac5fae7645f22c2236aa8982f439"url: "https://pub.dev"source: hosted- version: "0.39.0"+ version: "0.40.3"refena_flutter:dependency: "direct main"description:name: refena_flutter- sha256: "4dc8c55c208e7e0a5573a348dc5b26fc4f28490a509e63bbc327ae106b1e7caf"+ sha256: "86291df3817a4962aced6de7de537e7e51bbb8acea41934122c798ea1d12693c"url: "https://pub.dev"source: hosted- version: "0.39.0"+ version: "0.40.4"refena_inspector:dependency: "direct dev"description:diff --git a/app/pubspec.yaml b/app/pubspec.yamlindex a719636f..0490d70a 100644--- a/app/pubspec.yaml+++ b/app/pubspec.yaml@@ -43,7 +43,7 @@ dependencies:path_provider: 2.1.1permission_handler: 11.0.1pretty_qr_code: 2.0.3- refena_flutter: 0.39.0+ refena_flutter: 0.40.4refena_inspector_client: 0.8.0routerino: 0.8.0screen_retriever: 0.1.9