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.
 
 
 
 
 
 

54 lines
1.9 KiB

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:my_flutter_puzzle/cubits/count_down_timer_cubit.dart';
import 'package:my_flutter_puzzle/initializer.dart';
import 'package:my_flutter_puzzle/res/palette.dart';
import 'package:my_flutter_puzzle/screens/splash/screen/splash_screen.dart';
import 'package:my_flutter_puzzle/utils/color_brightness.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Initializer.instance.initialHive();
runApp(const ProviderScope(child: MyApp()));
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
return BlocProvider(
create: (context) => CountDownTimerCubit(),
child: MaterialApp(
title: 'Flutter Puzzle',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
fontFamily: 'GoogleSans',
backgroundColor: Palette.blue.darken(0.3),
colorScheme: ColorScheme(
brightness: Theme.of(context).brightness,
primary: Palette.blue,
onPrimary: Colors.white,
secondary: Palette.blue.withOpacity(0.6),
onSecondary: Palette.blue.withOpacity(0.3),
error: Theme.of(context).colorScheme.error,
onError: Theme.of(context).colorScheme.onError,
background: Palette.blue.darken(0.3),
onBackground: Colors.white,
surface: Palette.crimson,
onSurface: Colors.white38,
),
),
home: const SplashScreen(),
),
);
}
}