|
|
@ -1,8 +1,10 @@ |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
|
|
|
import 'package:provider/provider.dart'; |
|
|
|
import 'package:thesis_shop/route_key.dart'; |
|
|
|
import 'package:thesis_shop/route_key.dart'; |
|
|
|
import 'package:thesis_shop/screens/cart/cart_screen.dart'; |
|
|
|
import 'package:thesis_shop/screens/cart/cart_screen.dart'; |
|
|
|
import 'package:thesis_shop/screens/product_list/product_list_screen.dart'; |
|
|
|
import 'package:thesis_shop/screens/product_list/product_list_screen.dart'; |
|
|
|
import 'package:thesis_shop/service/product_service.dart'; |
|
|
|
import 'package:thesis_shop/service/product_service.dart'; |
|
|
|
|
|
|
|
import 'package:thesis_shop/store/user_store.dart'; |
|
|
|
import 'package:thesis_shop/utils/map_keys_extension.dart'; |
|
|
|
import 'package:thesis_shop/utils/map_keys_extension.dart'; |
|
|
|
|
|
|
|
|
|
|
|
class ThesisShopApp extends StatelessWidget { |
|
|
|
class ThesisShopApp extends StatelessWidget { |
|
|
@ -12,18 +14,23 @@ class ThesisShopApp extends StatelessWidget { |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return MaterialApp( |
|
|
|
return MultiProvider( |
|
|
|
title: 'Thesis Shop', |
|
|
|
providers: [ |
|
|
|
theme: ThemeData(primarySwatch: Colors.red), |
|
|
|
ChangeNotifierProvider(create: (context) => UserStore()), |
|
|
|
darkTheme: ThemeData( |
|
|
|
], |
|
|
|
primarySwatch: Colors.red, |
|
|
|
child: MaterialApp( |
|
|
|
brightness: Brightness.dark, |
|
|
|
title: 'Thesis Shop', |
|
|
|
|
|
|
|
theme: ThemeData(primarySwatch: Colors.red), |
|
|
|
|
|
|
|
darkTheme: ThemeData( |
|
|
|
|
|
|
|
primarySwatch: Colors.red, |
|
|
|
|
|
|
|
brightness: Brightness.dark, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
routes: { |
|
|
|
|
|
|
|
RouteKey.products: (context) => const ProductListScreen(), |
|
|
|
|
|
|
|
RouteKey.cart: (context) => const CartScreen(), |
|
|
|
|
|
|
|
}.mapKeys((key) => key.name), |
|
|
|
|
|
|
|
initialRoute: 'products', |
|
|
|
), |
|
|
|
), |
|
|
|
routes: { |
|
|
|
|
|
|
|
RouteKey.products: (context) => const ProductListScreen(), |
|
|
|
|
|
|
|
RouteKey.cart: (context) => const CartScreen(), |
|
|
|
|
|
|
|
}.mapKeys((key) => key.name), |
|
|
|
|
|
|
|
initialRoute: 'products', |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|