Last active
October 27, 2021 07:57
-
-
Save perymerdeka/f3702ae260914abdb4dd7da09297dbac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:providers/providers/products.dart'; | |
import './screens/products_overview_screen.dart'; | |
import './screens/product_detail_screen.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return ChangeNotifierProvider( | |
create: (BuildContext context) => ProductProvider(), | |
child: MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'MyShop', | |
theme: ThemeData( | |
fontFamily: 'Lato', | |
colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.indigo) | |
.copyWith(secondary: Colors.amber), | |
), | |
home: const ProductsOverviewScreen(), | |
routes: { | |
ProductDetailScreen.routeName: (ctx) => const ProductDetailScreen(), | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment