refactor: restructure codebase. (#501)

* refactor: separate language selection to own widget.

* feat: separate theme changer to own widget.

* refactor: move Appearance UI to separate class.

* refactor: move language selection UI to separate class.

* refactor: move sources selection to separate file.

* refactor: move sources selection to separate file.

* refactor: split settings sections in separate files.

* refactor: move logging section to separate file.

* fix: show toast on bottom.

* fix: recommended patches not being selected by default.

* fix: patch selection selecting non recommended patches.

* fix: experimental toggle not updating.
This commit is contained in:
Aunali321
2022-11-12 21:25:33 +05:30
committed by GitHub
parent ee689922a3
commit 0faf86c9e9
23 changed files with 1050 additions and 716 deletions

View File

@ -47,7 +47,7 @@ class HomeViewModel extends BaseViewModel {
?.requestPermission();
bool isConnected = await Connectivity().checkConnection();
if (!isConnected) {
_toast.show('homeView.noConnection');
_toast.showBottom('homeView.noConnection');
}
_getPatchedApps();
_managerAPI.reAssessSavedApps().then((_) => _getPatchedApps());
@ -105,7 +105,7 @@ class HomeViewModel extends BaseViewModel {
Future<void> updateManager(BuildContext context) async {
try {
_toast.show('homeView.downloadingMessage');
_toast.showBottom('homeView.downloadingMessage');
File? managerApk = await _managerAPI.downloadManager();
if (managerApk != null) {
await flutterLocalNotificationsPlugin.zonedSchedule(
@ -132,19 +132,19 @@ class HomeViewModel extends BaseViewModel {
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime,
);
_toast.show('homeView.installingMessage');
_toast.showBottom('homeView.installingMessage');
await AppInstaller.installApk(managerApk.path);
} else {
_toast.show('homeView.errorDownloadMessage');
_toast.showBottom('homeView.errorDownloadMessage');
}
} on Exception catch (e, s) {
await Sentry.captureException(e, stackTrace: s);
_toast.show('homeView.errorInstallMessage');
_toast.showBottom('homeView.errorInstallMessage');
}
}
void updatesAreDisabled() {
_toast.show('homeView.updatesDisabled');
_toast.showBottom('homeView.updatesDisabled');
}
Future<void> showUpdateConfirmationDialog(BuildContext parentContext) async {