A simple demo shows basic usage of combination of Flutter & GraphQL.
[WIP] 在 Flutter ä¸ä½¿ç”¨ GraphQL
To solve 'Insecure HTTP is not allowed by platform' Error, You will need to do these things:
For Android:
- Create
/res/xml/network_security_config.xml. - Edit
AndroidManifest.xml.
<!-- network_security_config.xml -->
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
<!-- AndroidManifest.xml -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutter_graphql_example">
<application
android:networkSecurityConfig="@xml/network_security_config">
<!-- ... -->
</application>
</manifest>
For IOS:
- Add NSExceptionDomains( NSExceptionAllowsInsecureHTTPLoads ) to
Info.plistin/ios/Runner/Info.plistfolder.
Above actions are required so that we can use HTTP instead of HTTPS request in Emulator Device, see here for more details about.
Make sure you've already finished required environment setup, including:
nodejsflutter&dartAndroid/IOS Emulator
- Declarative Usage: ToDo List
git clone git@github.com:linbudu599/flutter_graphql_example.git
cd flutter_graphql_examplecd ./server
npm install
npm run devPowered by Koa-GraphQL & LowDB
Edit todo.ts to use the content you like.
As server gets ready, you can visit
to check your GraphQL Server easily by GraphiQL, which contains definition of Query / Mutation info.
dart pub get
flutter run .\lib\main.dartPowered by graphql-flutter package