Skip to content

Instantly share code, notes, and snippets.

@perymerdeka
Last active October 27, 2021 07:57
Show Gist options
  • Save perymerdeka/f3702ae260914abdb4dd7da09297dbac to your computer and use it in GitHub Desktop.
Save perymerdeka/f3702ae260914abdb4dd7da09297dbac to your computer and use it in GitHub Desktop.
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