refactor(QueryBowl): query bowl logic as a separate class instead of a stateful widget

feat: add QueryCache class for storing, updating, removing all the query/mutation/infiniteQueries
refactor(test): update tests according to new query bowl refactor
refactor(fl_query_hooks): update the hooks according to new query bowl refactor
This commit is contained in:
Kingkor Roy Tirtho
2022-09-22 22:03:28 +06:00
parent f435f101c4
commit 2b835505a3
22 changed files with 804 additions and 733 deletions
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.6/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.6/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus_macos","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_macos-1.2.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus_linux","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.3.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus_windows","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_windows-1.2.2/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus_web","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_web-1.2.3/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":["connectivity_plus_linux","connectivity_plus_macos","connectivity_plus_web","connectivity_plus_windows"]},{"name":"connectivity_plus_linux","dependencies":[]},{"name":"connectivity_plus_macos","dependencies":[]},{"name":"connectivity_plus_web","dependencies":[]},{"name":"connectivity_plus_windows","dependencies":[]}],"date_created":"2022-09-19 10:39:45.071010","version":"3.3.0"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"connectivity_plus","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.6/","native_build":true,"dependencies":[]}],"android":[{"name":"connectivity_plus","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus-2.3.6/","native_build":true,"dependencies":[]}],"macos":[{"name":"connectivity_plus_macos","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_macos-1.2.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"connectivity_plus_linux","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.3.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"connectivity_plus_windows","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_windows-1.2.2/","native_build":true,"dependencies":[]}],"web":[{"name":"connectivity_plus_web","path":"/home/krtirtho/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_web-1.2.3/","dependencies":[]}]},"dependencyGraph":[{"name":"connectivity_plus","dependencies":["connectivity_plus_linux","connectivity_plus_macos","connectivity_plus_web","connectivity_plus_windows"]},{"name":"connectivity_plus_linux","dependencies":[]},{"name":"connectivity_plus_macos","dependencies":[]},{"name":"connectivity_plus_web","dependencies":[]},{"name":"connectivity_plus_windows","dependencies":[]}],"date_created":"2022-09-22 20:53:14.912483","version":"3.3.0"}
@@ -3,6 +3,8 @@ import 'dart:math';
import 'package:fl_query/fl_query.dart';
import 'package:flutter/material.dart';
final bowl = QueryBowl();
final successJob = QueryJob<String, void>(
queryKey: "greetings-example",
task: (queryKey, _) => Future.delayed(
+4 -1
View File
@@ -1,15 +1,17 @@
import 'package:fl_query_example/components/basic_infinite_query.dart';
import 'package:fl_query_example/components/basic_mutation.dart';
import 'package:fl_query/fl_query.dart';
import 'package:fl_query_example/components/basic_query.dart';
import 'package:fl_query_example/components/lazy_query.dart';
import 'package:fl_query_example/components/mutation_variable_key.dart';
import 'package:fl_query_example/components/query_external_data.dart';
import 'package:fl_query_example/components/query_previous_data.dart';
import 'package:fl_query_example/components/query_variable_key.dart';
import 'package:fl_query/fl_query.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugRepaintRainbowEnabled = true;
runApp(const MyApp());
}
@@ -19,6 +21,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return QueryBowlScope(
bowl: QueryBowl(),
child: MaterialApp(
// showPerformanceOverlay: true,
title: 'Flutter Demo',