2022-07-31 00:39:59 +05:30
|
|
|
import 'package:flutter/material.dart';
|
2022-08-07 00:37:12 +01:00
|
|
|
import 'package:flutter_i18n/flutter_i18n.dart';
|
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
2022-08-06 22:35:35 +01:00
|
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
2022-09-12 01:41:53 +01:00
|
|
|
import 'package:revanced_manager/services/github_api.dart';
|
2022-08-25 00:51:47 +01:00
|
|
|
import 'package:revanced_manager/services/manager_api.dart';
|
2022-08-29 17:44:45 +01:00
|
|
|
import 'package:revanced_manager/services/patcher_api.dart';
|
2022-09-12 01:41:53 +01:00
|
|
|
import 'package:revanced_manager/services/revanced_api.dart';
|
2022-09-05 03:32:36 +01:00
|
|
|
import 'package:revanced_manager/ui/theme/dynamic_theme_builder.dart';
|
2022-09-05 09:07:38 +01:00
|
|
|
import 'package:revanced_manager/ui/views/navigation/navigation_view.dart';
|
2022-08-12 00:35:03 +05:30
|
|
|
import 'package:stacked_themes/stacked_themes.dart';
|
2022-09-20 00:03:37 +01:00
|
|
|
import 'package:timezone/data/latest.dart' as tz;
|
2022-07-31 00:39:59 +05:30
|
|
|
|
2022-08-12 00:35:03 +05:30
|
|
|
Future main() async {
|
|
|
|
await ThemeManager.initialise();
|
2022-08-25 00:51:47 +01:00
|
|
|
await setupLocator();
|
2022-08-12 15:12:43 +05:30
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
2022-09-05 03:32:36 +01:00
|
|
|
await locator<ManagerAPI>().initialize();
|
2022-09-19 00:28:26 +01:00
|
|
|
String apiUrl = locator<ManagerAPI>().getApiUrl();
|
|
|
|
await locator<RevancedAPI>().initialize(apiUrl);
|
2022-09-12 01:41:53 +01:00
|
|
|
locator<GithubAPI>().initialize();
|
2022-09-19 00:28:26 +01:00
|
|
|
await locator<PatcherAPI>().initialize();
|
2022-09-20 00:03:37 +01:00
|
|
|
tz.initializeTimeZones();
|
2022-07-31 00:39:59 +05:30
|
|
|
runApp(const MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
const MyApp({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2022-09-05 03:32:36 +01:00
|
|
|
return DynamicThemeBuilder(
|
|
|
|
title: 'ReVanced Manager',
|
2022-09-06 14:40:49 +01:00
|
|
|
home: const NavigationView(),
|
2022-09-05 03:32:36 +01:00
|
|
|
localizationsDelegates: [
|
|
|
|
FlutterI18nDelegate(
|
|
|
|
translationLoader: FileTranslationLoader(
|
|
|
|
fallbackFile: 'en',
|
|
|
|
basePath: 'assets/i18n',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
GlobalMaterialLocalizations.delegate,
|
|
|
|
GlobalWidgetsLocalizations.delegate
|
|
|
|
],
|
2022-07-31 13:30:11 +05:30
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|