mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2024-11-17 14:19:16 +00:00
45 lines
1.3 KiB
Dart
45 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:selfprivacy/ui/pages/onboarding/onboarding.dart';
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
import 'package:selfprivacy/ui/pages/rootRoute.dart';
|
|
|
|
import 'config/bloc_config.dart';
|
|
import 'config/brand_theme.dart';
|
|
import 'config/localization.dart';
|
|
import 'logic/cubit/app_settings/app_settings_cubit.dart';
|
|
|
|
void main() {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
runApp(
|
|
Localization(
|
|
child: BlocAndProviderConfig(
|
|
child: MyApp(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
var _showOnbording = true;
|
|
|
|
class MyApp extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
|
value: SystemUiOverlayStyle.light, // Manually changnig appbar color
|
|
child: MaterialApp(
|
|
localizationsDelegates: context.localizationDelegates,
|
|
supportedLocales: context.supportedLocales,
|
|
locale: context.locale,
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'SelfPrivacy',
|
|
theme: context.watch<AppSettingsCubit>().state.isDarkModeOn
|
|
? darkTheme
|
|
: ligtTheme,
|
|
home: _showOnbording ? OnboardingPage() : RootPage(),
|
|
),
|
|
);
|
|
}
|
|
}
|