You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
selfprivacy.org.app/lib/main.dart

45 lines
1.3 KiB

2 years ago
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';
2 years ago
import 'package:selfprivacy/ui/pages/rootRoute.dart';
2 years ago
2 years ago
import 'config/bloc_config.dart';
2 years ago
import 'config/brand_theme.dart';
import 'config/localization.dart';
2 years ago
import 'logic/cubit/app_settings/app_settings_cubit.dart';
2 years ago
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(
Localization(
2 years ago
child: BlocAndProviderConfig(
child: MyApp(),
),
),
);
2 years ago
}
2 years ago
var _showOnbording = true;
2 years ago
2 years ago
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,
2 years ago
debugShowCheckedModeBanner: false,
title: 'SelfPrivacy',
2 years ago
theme: context.watch<AppSettingsCubit>().state.isDarkModeOn
? darkTheme
: ligtTheme,
2 years ago
home: _showOnbording ? OnboardingPage() : RootPage(),
2 years ago
),
);
}
}