Last active
November 5, 2019 12:35
-
-
Save shivanchalpandey/5705bc626dbfcd13feb7be17505d6c2f 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:flutter_redux/flutter_redux.dart'; | |
import 'package:flutter_redux_example/cartList.dart'; | |
import 'package:flutter_redux_example/home_page.dart'; | |
import 'package:flutter_redux_example/model/app_state.dart'; | |
import 'package:flutter_redux_example/upload_imageScreen.dart'; | |
import 'package:graphql_flutter/graphql_flutter.dart'; | |
import 'package:redux/redux.dart'; | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
final Store<AppState> store; | |
MyApp({this.store}); | |
@override | |
Widget build(BuildContext context) { | |
final httpLink = HttpLink( | |
uri: 'http://letsinspire.aeologic.com/admin/graphql', | |
); | |
var client = ValueNotifier( | |
GraphQLClient( | |
cache: InMemoryCache(), | |
link: httpLink, | |
), | |
); | |
return StoreProvider<AppState>( | |
store: store, | |
child: GraphQLProvider( | |
client: client, | |
child: MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: HomePage(), | |
routes: { | |
'/home': (context) => HomePage(), | |
'/cart': (context) => CartList(), | |
'/upload': (context) => UploadImageScreen(), | |
}, | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment