graphql_flutter 1.1.1-beta.4 graphql_flutter: ^1.1.1-beta.4 copied to clipboard
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
import 'package:flutter/material.dart';
import './graphql_bloc/main.dart' show GraphQLBlocPatternScreen;
import './graphql_widget/main.dart' show GraphQLWidgetScreen;
void main() => runApp(
MaterialApp(
title: 'GraphQL Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Builder(
builder: (BuildContext context) => Scaffold(
appBar: AppBar(
title: const Text('GraphQL Demo App'),
),
body: Center(
child: Column(
children: <Widget>[
RaisedButton(
child: const Text('GraphQL BloC pattern'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute<GraphQLWidgetScreen>(
builder: (BuildContext context) =>
GraphQLBlocPatternScreen(),
),
);
},
),
RaisedButton(
child: const Text('GraphQL Widget'),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute<GraphQLWidgetScreen>(
builder: (BuildContext context) =>
const GraphQLWidgetScreen(),
),
);
},
),
],
),
),
),
),
),
);