Created
October 24, 2021 17:09
-
-
Save perymerdeka/199b35ff16d0af3298fb66388953bcbe to your computer and use it in GitHub Desktop.
Base Project Structure
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