I am new to flutter and want to use GraphQL and your package.
When I try to call GraphqlConsumer it seems that the builder never gets called.
Here is the example. Can someone help me with what I am doing wrong.
return GraphqlProvider(
client: client,
child: CacheProvider(
child: MaterialApp(
home: DefaultTabController(
length: 3,
child: Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(icon: Icon(Icons.directions_car)),
Tab(icon: Icon(Icons.directions_transit)),
Tab(icon: Icon(Icons.directions_bike)),
],
),
centerTitle: true,
title: Text('Ship IT 1'),
),
body: TabBarView(
children: [
ListView.builder(
padding: new EdgeInsets.all(8.0),
itemExtent: 20.0,
itemBuilder: (BuildContext context, int index) {
return new Text('entry $index');
},
),
Icon(Icons.directions_transit),
RaisedButton(
child: const Text('Connect with Twitter'),
color: Theme.of(context).accentColor,
elevation: 4.0,
splashColor: Colors.blueGrey,
onPressed: () {
// Perform some action
//Client client = GraphqlProvider.of(context).value;
//var hello = client.query(query: queries.query_storeship_orders);
return new GraphqlConsumer(
builder: (Client client) {
var result = client.query(query: queries.query_storeship_orders);
return new Container(
child: new Text('Hello widget'),
);
}
);
},
),
//Icon(Icons.directions_bike),
],
),
),
),
),
),
);