Skip to main content

Installation

Fl-Query is just another Flutter "package" so no extra installation step needed just install it straight from https://pub.dev

$ flutter pub add fl_query

Using with flutter_hooks

If you're an ELITE flutter_hooks user or want to use fl_query_hooks you'll need the flutter_hooks & fl_query_hooks package

$ flutter pub add fl_query_hooks
$ flutter pub add flutter_hooks

The hooks can be imported as follows:

import 'package:fl_query/fl_query_hooks.dart';

Add offline support in your App (Optional)

Fl-Query supports refetching queries when internet connection is restored. To enable this feature you need to install:

$ flutter pub add fl_query_connectivity_plus_adapter

Add following in your main.dart file

import 'package:fl_query_connectivity_plus_adapter/fl_query_connectivity_plus_adapter.dart';

void main() async {
// ....
await QueryClient.initialize(
connectivity: FlQueryConnectivityPlusAdapter(),
);
// ....
}

Try out the new devtools✨

FL-Query now offers a devtool. It is still in alpha phase but it is expected to be complete in some time

Install the devtools:

$ flutter pub add fl_query_devtools

Add following to MaterialApp's or CupertinoApp's builder parameter:

MaterialApp.router(
title: 'FL Query Example',
builder: (context, child) {
return FlQueryDevtools(child: child!);
},
//...
)