2024-09-29 18:33:19 +04:00
|
|
|
import 'package:flutter/material.dart';
|
2024-12-17 10:07:39 +04:00
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
import 'package:mylab/data/repositories/car_repository.dart';
|
|
|
|
import 'package:mylab/presentation/home_page/bloc/bloc.dart';
|
|
|
|
import 'package:mylab/presentation/home_page/home_page.dart';
|
2024-10-28 16:20:50 +04:00
|
|
|
// flutter pub run build_runner build --delete-conflicting-outputs
|
2024-09-29 18:33:19 +04:00
|
|
|
void main() {
|
|
|
|
runApp(const MyApp());
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyApp extends StatelessWidget {
|
|
|
|
const MyApp({super.key});
|
|
|
|
|
2024-10-08 18:05:02 +04:00
|
|
|
@override
|
2024-09-29 18:33:19 +04:00
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return MaterialApp(
|
2024-12-17 10:07:39 +04:00
|
|
|
title: 'Flutter Demo',
|
2024-10-08 18:05:02 +04:00
|
|
|
debugShowCheckedModeBanner: false,
|
2024-09-29 18:33:19 +04:00
|
|
|
theme: ThemeData(
|
2024-10-08 18:05:02 +04:00
|
|
|
colorScheme: ColorScheme.fromSeed(seedColor: Colors.orangeAccent),
|
2024-09-29 18:33:19 +04:00
|
|
|
useMaterial3: true,
|
|
|
|
),
|
2024-12-17 10:07:39 +04:00
|
|
|
home: RepositoryProvider<CarRepository>(
|
|
|
|
lazy: true,
|
|
|
|
create: (_) => CarRepository(),
|
|
|
|
child: BlocProvider<HomeBloc>(
|
|
|
|
lazy: false,
|
|
|
|
create: (context) => HomeBloc(context.read<CarRepository>()),
|
|
|
|
child: const HomePage(),
|
|
|
|
),
|
|
|
|
),
|
2024-09-29 18:33:19 +04:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|