|
@@ -1,4 +1,6 @@
|
|
import 'package:flutter/material.dart';
|
|
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:flutter_provider_demo/routes.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
@@ -14,9 +16,8 @@ class MyApp extends StatelessWidget {
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
return MultiProvider(
|
|
return MultiProvider(
|
|
providers: [
|
|
providers: [
|
|
- // Provider<Counter>.value(value: Counter()),
|
|
|
|
- ChangeNotifierProvider<Counter>(create: (_) => Counter()),
|
|
|
|
- ChangeNotifierProvider<ThemeModel>(create: (_) => ThemeModel()),
|
|
|
|
|
|
+ ChangeNotifierProvider<CarProvider>(create: (_) => CarProvider()),
|
|
|
|
+ ChangeNotifierProvider<ThemeProvider>(create: (_) => ThemeProvider()),
|
|
],
|
|
],
|
|
child: MaterialApp(
|
|
child: MaterialApp(
|
|
title: 'Provider Demo',
|
|
title: 'Provider Demo',
|