refactor: apply changes according to analysis

trailing commas, and sort import alphabetically
This commit is contained in:
Pun Butrach 2023-08-06 14:39:46 +07:00
parent 0b529c2629
commit 264d8d90c4
No known key found for this signature in database
GPG Key ID: 2B0F94D832579862
19 changed files with 42 additions and 37 deletions

View File

@ -58,7 +58,7 @@ class MyApp extends StatelessWidget {
}, },
), ),
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate GlobalWidgetsLocalizations.delegate,
], ],
); );
} }

View File

@ -57,7 +57,7 @@ class ContributorsView extends StatelessWidget {
title: 'contributorsView.managerContributors', title: 'contributorsView.managerContributors',
contributors: model.managerContributors, contributors: model.managerContributors,
), ),
SizedBox(height: MediaQuery.of(context).viewPadding.bottom) SizedBox(height: MediaQuery.of(context).viewPadding.bottom),
], ],
), ),
), ),

View File

@ -43,7 +43,7 @@ class HomeViewModel extends BaseViewModel {
Future<void> initialize(BuildContext context) async { Future<void> initialize(BuildContext context) async {
_latestManagerVersion = await _managerAPI.getLatestManagerVersion(); _latestManagerVersion = await _managerAPI.getLatestManagerVersion();
if(!_managerAPI.getPatchesConsent()){ if (!_managerAPI.getPatchesConsent()) {
await showPatchesConsent(context); await showPatchesConsent(context);
} }
await _patcherAPI.initialize(); await _patcherAPI.initialize();
@ -168,7 +168,7 @@ class HomeViewModel extends BaseViewModel {
} }
} }
Future<void> showPatchesConsent(BuildContext context) async{ Future<void> showPatchesConsent(BuildContext context) async {
final ValueNotifier<bool> autoUpdate = ValueNotifier(true); final ValueNotifier<bool> autoUpdate = ValueNotifier(true);
await showDialog( await showDialog(
context: context, context: context,
@ -197,7 +197,9 @@ class HomeViewModel extends BaseViewModel {
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.symmetric(vertical: 10),
child: I18nText( child: I18nText(
'homeView.patchesConsentDialogText2', 'homeView.patchesConsentDialogText2',
translationParams: {'url': _managerAPI.defaultApiUrl.split('/')[2]}, translationParams: {
'url': _managerAPI.defaultApiUrl.split('/')[2],
},
child: Text( child: Text(
'', '',
style: TextStyle( style: TextStyle(
@ -211,8 +213,12 @@ class HomeViewModel extends BaseViewModel {
CheckboxListTile( CheckboxListTile(
value: value, value: value,
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
title: I18nText('homeView.patchesConsentDialogText3',), title: I18nText(
subtitle: I18nText('homeView.patchesConsentDialogText3Sub',), 'homeView.patchesConsentDialogText3',
),
subtitle: I18nText(
'homeView.patchesConsentDialogText3Sub',
),
onChanged: (selected) { onChanged: (selected) {
autoUpdate.value = selected!; autoUpdate.value = selected!;
}, },
@ -237,7 +243,7 @@ class HomeViewModel extends BaseViewModel {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
label: I18nText('okButton'), label: I18nText('okButton'),
) ),
], ],
), ),
); );

View File

@ -203,7 +203,7 @@ class InstallerViewModel extends BaseViewModel {
CustomMaterialButton( CustomMaterialButton(
label: I18nText('okButton'), label: I18nText('okButton'),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
) ),
], ],
), ),
); );

View File

@ -78,7 +78,7 @@ class PatcherViewModel extends BaseViewModel {
Navigator.of(context).pop(); Navigator.of(context).pop();
showArmv7WarningDialog(context); showArmv7WarningDialog(context);
}, },
) ),
], ],
), ),
); );
@ -111,7 +111,7 @@ class PatcherViewModel extends BaseViewModel {
Navigator.of(context).pop(); Navigator.of(context).pop();
navigateToInstaller(); navigateToInstaller();
}, },
) ),
], ],
), ),
); );

View File

@ -33,7 +33,7 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
label: Row( label: Row(
children: <Widget>[ children: <Widget>[
I18nText('patchesSelectorView.doneButton'), I18nText('patchesSelectorView.doneButton'),
Text(' (${model.selectedPatches.length})') Text(' (${model.selectedPatches.length})'),
], ],
), ),
icon: const Icon(Icons.check), icon: const Icon(Icons.check),

View File

@ -30,7 +30,7 @@ class SManageApiUrl extends BaseViewModel {
icon: const Icon(Icons.manage_history_outlined), icon: const Icon(Icons.manage_history_outlined),
onPressed: () => showApiUrlResetDialog(context), onPressed: () => showApiUrlResetDialog(context),
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
) ),
], ],
), ),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer, backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
@ -69,7 +69,7 @@ class SManageApiUrl extends BaseViewModel {
_managerAPI.setApiUrl(apiUrl); _managerAPI.setApiUrl(apiUrl);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
) ),
], ],
), ),
); );
@ -97,7 +97,7 @@ class SManageApiUrl extends BaseViewModel {
..pop() ..pop()
..pop(); ..pop();
}, },
) ),
], ],
), ),
); );

View File

@ -30,7 +30,7 @@ class SManageKeystorePassword extends BaseViewModel {
onPressed: () => _keystorePasswordController.text = onPressed: () => _keystorePasswordController.text =
_managerAPI.defaultKeystorePassword, _managerAPI.defaultKeystorePassword,
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
) ),
], ],
), ),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer, backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
@ -62,7 +62,7 @@ class SManageKeystorePassword extends BaseViewModel {
_managerAPI.setKeystorePassword(passwd); _managerAPI.setKeystorePassword(passwd);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
) ),
], ],
), ),
); );

View File

@ -40,7 +40,7 @@ class SManageSources extends BaseViewModel {
icon: const Icon(Icons.manage_history_outlined), icon: const Icon(Icons.manage_history_outlined),
onPressed: () => showResetConfirmationDialog(context), onPressed: () => showResetConfirmationDialog(context),
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
) ),
], ],
), ),
backgroundColor: Theme.of(context).colorScheme.secondaryContainer, backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
@ -102,7 +102,7 @@ class SManageSources extends BaseViewModel {
onChanged: (value) => notifyListeners(), onChanged: (value) => notifyListeners(),
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
I18nText('settingsView.sourcesUpdateNote') I18nText('settingsView.sourcesUpdateNote'),
], ],
), ),
), ),
@ -132,7 +132,7 @@ class SManageSources extends BaseViewModel {
_toast.showBottom('settingsView.restartAppForChanges'); _toast.showBottom('settingsView.restartAppForChanges');
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
) ),
], ],
), ),
); );
@ -163,7 +163,7 @@ class SManageSources extends BaseViewModel {
..pop() ..pop()
..pop(); ..pop();
}, },
) ),
], ],
), ),
); );

View File

@ -74,7 +74,7 @@ class AppInfoViewModel extends BaseViewModel {
CustomMaterialButton( CustomMaterialButton(
label: I18nText('okButton'), label: I18nText('okButton'),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
) ),
], ],
), ),
); );
@ -103,7 +103,7 @@ class AppInfoViewModel extends BaseViewModel {
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
) ),
], ],
), ),
); );
@ -140,7 +140,7 @@ class AppInfoViewModel extends BaseViewModel {
CustomMaterialButton( CustomMaterialButton(
label: I18nText('okButton'), label: I18nText('okButton'),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
) ),
], ],
), ),
); );

View File

@ -66,7 +66,7 @@ class _InstalledAppItemState extends State<InstalledAppItem> {
context, context,
'installed', 'installed',
translationParams: { translationParams: {
'version': 'v${widget.installedVersion}' 'version': 'v${widget.installedVersion}',
}, },
), ),
), ),

View File

@ -64,7 +64,7 @@ class InstalledAppsCard extends StatelessWidget {
Theme.of(context).colorScheme.secondary, Theme.of(context).colorScheme.secondary,
), ),
), ),
) ),
], ],
), ),
), ),

View File

@ -95,7 +95,7 @@ class UpdateConfirmationDialog extends StatelessWidget {
? model.updatePatches(context) ? model.updatePatches(context)
: model.updateManager(context); : model.updateManager(context);
}, },
) ),
], ],
), ),
), ),

View File

@ -129,7 +129,7 @@ class _PatchItemState extends State<PatchItem> {
widget.onChanged(widget.isSelected); widget.onChanged(widget.isSelected);
}, },
), ),
) ),
], ],
), ),
if (widget.isUnsupported && if (widget.isUnsupported &&
@ -190,7 +190,7 @@ class _PatchItemState extends State<PatchItem> {
CustomMaterialButton( CustomMaterialButton(
label: I18nText('okButton'), label: I18nText('okButton'),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
) ),
], ],
), ),
); );

View File

@ -50,7 +50,7 @@ class CustomSwitch extends StatelessWidget {
color: Colors.black12.withOpacity(0.1), color: Colors.black12.withOpacity(0.1),
spreadRadius: 0.5, spreadRadius: 0.5,
blurRadius: 1, blurRadius: 1,
) ),
], ],
), ),
), ),

View File

@ -93,9 +93,9 @@ class SAdvancedSection extends StatelessWidget {
label: I18nText('yesButton'), label: I18nText('yesButton'),
onPressed: () => { onPressed: () => {
Navigator.of(context).pop(), Navigator.of(context).pop(),
_settingsViewModel.deleteKeystore() _settingsViewModel.deleteKeystore(),
}, },
) ),
], ],
), ),
); );

View File

@ -1,9 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:flutter_i18n/widgets/I18nText.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart'; import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart'; import 'package:revanced_manager/ui/views/patches_selector/patches_selector_viewmodel.dart';
import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart';
class SExperimentalUniversalPatches extends StatefulWidget { class SExperimentalUniversalPatches extends StatefulWidget {
const SExperimentalUniversalPatches({super.key}); const SExperimentalUniversalPatches({super.key});

View File

@ -119,9 +119,9 @@ class SExportSection extends StatelessWidget {
label: I18nText('yesButton'), label: I18nText('yesButton'),
onPressed: () => { onPressed: () => {
Navigator.of(context).pop(), Navigator.of(context).pop(),
_settingsViewModel.resetSelectedPatches() _settingsViewModel.resetSelectedPatches(),
}, },
) ),
], ],
), ),
); );

View File

@ -11,7 +11,7 @@ class AboutInfo {
'flavor': kReleaseMode ? 'release' : 'debug', 'flavor': kReleaseMode ? 'release' : 'debug',
'model': info.model, 'model': info.model,
'androidVersion': info.version.release, 'androidVersion': info.version.release,
'supportedArch': info.supportedAbis 'supportedArch': info.supportedAbis,
}; };
} }
} }