import 'package:flutter/material.dart'; import 'package:flutter_provider_demo/provider/car_provider.dart'; import 'package:flutter_provider_demo/provider/theme_provider.dart'; import 'package:flutter_provider_demo/routes.dart'; import 'package:provider/provider.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); // This widget is the root of your application. @override Widget build(BuildContext context) { return MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => CarProvider()), ChangeNotifierProvider(create: (_) => ThemeProvider()), ], child: MaterialApp( title: 'Provider Demo', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), initialRoute: Routes.index, onGenerateRoute: Routes.generateRoute, ), ); } }