├── docs ├── static │ ├── .nojekyll │ ├── favicon.ico │ ├── img │ │ ├── favicon.ico │ │ ├── docusaurus.png │ │ └── no_boilerplate_code.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ └── site.webmanifest ├── .prettierrc ├── README.md ├── .eslintrc ├── babel.config.js ├── docs │ ├── migrations │ │ └── _category_.json │ ├── getting-started │ │ ├── _category_.json │ │ └── installation.md │ ├── advanced │ │ └── _category_.json │ └── basics │ │ └── _category_.json ├── src │ ├── pages │ │ ├── markdown-page.md │ │ └── index.module.css │ ├── components │ │ └── HomepageFeatures │ │ │ └── styles.module.css │ └── css │ │ └── custom.css ├── blog │ └── authors.yml ├── tsconfig.json ├── tailwind.config.js ├── .gitignore ├── sidebars.js └── package.json ├── packages ├── fl_query │ ├── example │ │ ├── linux │ │ │ ├── .gitignore │ │ │ ├── main.cc │ │ │ ├── flutter │ │ │ │ ├── generated_plugin_registrant.cc │ │ │ │ ├── generated_plugin_registrant.h │ │ │ │ └── generated_plugins.cmake │ │ │ └── my_application.h │ │ ├── README.md │ │ ├── analysis_options.yaml │ │ ├── ios │ │ │ ├── Runner │ │ │ │ ├── Runner-Bridging-Header.h │ │ │ │ ├── Assets.xcassets │ │ │ │ │ ├── LaunchImage.imageset │ │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Base.lproj │ │ │ │ │ └── Main.storyboard │ │ │ │ └── Info.plist │ │ │ ├── Flutter │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ └── AppFrameworkInfo.plist │ │ │ ├── Runner.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── Runner.xcodeproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata │ │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── .gitignore │ │ │ └── Podfile │ │ ├── web │ │ │ ├── favicon.png │ │ │ ├── icons │ │ │ │ ├── Icon-192.png │ │ │ │ ├── Icon-512.png │ │ │ │ ├── Icon-maskable-192.png │ │ │ │ └── Icon-maskable-512.png │ │ │ ├── manifest.json │ │ │ └── index.html │ │ ├── android │ │ │ ├── gradle.properties │ │ │ ├── app │ │ │ │ └── src │ │ │ │ │ ├── main │ │ │ │ │ ├── res │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ └── values-night │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── .gitignore │ │ │ ├── settings.gradle │ │ │ └── build.gradle │ │ ├── macos │ │ │ ├── Runner │ │ │ │ ├── Configs │ │ │ │ │ ├── Debug.xcconfig │ │ │ │ │ ├── Release.xcconfig │ │ │ │ │ ├── Warnings.xcconfig │ │ │ │ │ └── AppInfo.xcconfig │ │ │ │ ├── Assets.xcassets │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ │ ├── app_icon_64.png │ │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Release.entitlements │ │ │ │ ├── DebugProfile.entitlements │ │ │ │ ├── MainFlutterWindow.swift │ │ │ │ └── Info.plist │ │ │ ├── .gitignore │ │ │ ├── Flutter │ │ │ │ ├── Flutter-Debug.xcconfig │ │ │ │ ├── Flutter-Release.xcconfig │ │ │ │ └── GeneratedPluginRegistrant.swift │ │ │ ├── Runner.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── Runner.xcodeproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── Podfile │ │ ├── windows │ │ │ ├── runner │ │ │ │ ├── resources │ │ │ │ │ └── app_icon.ico │ │ │ │ ├── resource.h │ │ │ │ ├── utils.h │ │ │ │ ├── runner.exe.manifest │ │ │ │ ├── flutter_window.h │ │ │ │ ├── main.cpp │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── utils.cpp │ │ │ ├── .gitignore │ │ │ └── flutter │ │ │ │ ├── generated_plugin_registrant.h │ │ │ │ ├── generated_plugin_registrant.cc │ │ │ │ └── generated_plugins.cmake │ │ ├── pubspec_overrides.yaml │ │ ├── pubspec.yaml │ │ ├── lib │ │ │ ├── router.dart │ │ │ ├── pages │ │ │ │ ├── home.dart │ │ │ │ └── query.dart │ │ │ └── main.dart │ │ ├── .gitignore │ │ └── .metadata │ ├── lib │ │ ├── src │ │ │ ├── core │ │ │ │ └── mixins │ │ │ │ │ ├── validation.dart │ │ │ │ │ └── retryer.dart │ │ │ ├── collections │ │ │ │ ├── json_config.dart │ │ │ │ ├── connectivity_adapter.dart │ │ │ │ ├── default_configs.dart │ │ │ │ ├── retry_config.dart │ │ │ │ └── jobs │ │ │ │ │ ├── mutation_job.dart │ │ │ │ │ └── query_job.dart │ │ │ └── widgets │ │ │ │ ├── mixins │ │ │ │ └── rebuilder.dart │ │ │ │ ├── state_resolvers │ │ │ │ ├── query_state.dart │ │ │ │ ├── infinite_query_state.dart │ │ │ │ └── mutation_state.dart │ │ │ │ └── state_notifier_listenable.dart │ │ └── fl_query.dart │ ├── .metadata │ ├── .gitignore │ └── pubspec.yaml ├── fl_query_hooks │ ├── example │ │ ├── linux │ │ │ ├── .gitignore │ │ │ ├── main.cc │ │ │ ├── flutter │ │ │ │ ├── generated_plugin_registrant.cc │ │ │ │ ├── generated_plugin_registrant.h │ │ │ │ └── generated_plugins.cmake │ │ │ └── my_application.h │ │ ├── ios │ │ │ ├── Runner │ │ │ │ ├── Runner-Bridging-Header.h │ │ │ │ ├── Assets.xcassets │ │ │ │ │ ├── LaunchImage.imageset │ │ │ │ │ │ ├── LaunchImage.png │ │ │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ └── Contents.json │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Base.lproj │ │ │ │ │ └── Main.storyboard │ │ │ │ └── Info.plist │ │ │ ├── Flutter │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ └── AppFrameworkInfo.plist │ │ │ ├── Runner.xcodeproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ │ └── xcshareddata │ │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── Runner.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── .gitignore │ │ │ └── Podfile │ │ ├── web │ │ │ ├── favicon.png │ │ │ ├── icons │ │ │ │ ├── Icon-192.png │ │ │ │ ├── Icon-512.png │ │ │ │ ├── Icon-maskable-192.png │ │ │ │ └── Icon-maskable-512.png │ │ │ ├── manifest.json │ │ │ └── index.html │ │ ├── android │ │ │ ├── gradle.properties │ │ │ ├── app │ │ │ │ └── src │ │ │ │ │ ├── main │ │ │ │ │ ├── res │ │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ │ ├── drawable │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ │ ├── values │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ │ └── values-night │ │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── kotlin │ │ │ │ │ │ └── com │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── example │ │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ ├── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ │ │ └── profile │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── gradle │ │ │ │ └── wrapper │ │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── .gitignore │ │ │ ├── settings.gradle │ │ │ └── build.gradle │ │ ├── macos │ │ │ ├── Runner │ │ │ │ ├── Configs │ │ │ │ │ ├── Debug.xcconfig │ │ │ │ │ ├── Release.xcconfig │ │ │ │ │ ├── Warnings.xcconfig │ │ │ │ │ └── AppInfo.xcconfig │ │ │ │ ├── Assets.xcassets │ │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ │ ├── app_icon_64.png │ │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ │ └── Contents.json │ │ │ │ ├── AppDelegate.swift │ │ │ │ ├── Release.entitlements │ │ │ │ ├── DebugProfile.entitlements │ │ │ │ ├── MainFlutterWindow.swift │ │ │ │ └── Info.plist │ │ │ ├── .gitignore │ │ │ ├── Flutter │ │ │ │ ├── Flutter-Debug.xcconfig │ │ │ │ ├── Flutter-Release.xcconfig │ │ │ │ └── GeneratedPluginRegistrant.swift │ │ │ ├── Runner.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ ├── Runner.xcodeproj │ │ │ │ └── project.xcworkspace │ │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── Podfile │ │ ├── windows │ │ │ ├── runner │ │ │ │ ├── resources │ │ │ │ │ └── app_icon.ico │ │ │ │ ├── resource.h │ │ │ │ ├── utils.h │ │ │ │ ├── runner.exe.manifest │ │ │ │ ├── flutter_window.h │ │ │ │ ├── main.cpp │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── utils.cpp │ │ │ ├── .gitignore │ │ │ └── flutter │ │ │ │ ├── generated_plugin_registrant.h │ │ │ │ ├── generated_plugin_registrant.cc │ │ │ │ └── generated_plugins.cmake │ │ ├── pubspec_overrides.yaml │ │ ├── README.md │ │ ├── pubspec.yaml │ │ ├── .gitignore │ │ ├── lib │ │ │ ├── main.dart │ │ │ ├── pages │ │ │ │ ├── mutation │ │ │ │ │ └── mutation-awaits-result.dart │ │ │ │ ├── home.dart │ │ │ │ └── query.dart │ │ │ └── router.dart │ │ ├── analysis_options.yaml │ │ └── .metadata │ ├── pubspec_overrides.yaml │ ├── lib │ │ ├── src │ │ │ ├── use_query_client.dart │ │ │ ├── utils │ │ │ │ └── use_updater.dart │ │ │ ├── jobs │ │ │ │ ├── use_query_job.dart │ │ │ │ ├── use_mutation_job.dart │ │ │ │ └── use_infinite_query_job.dart │ │ │ └── use_query.dart │ │ └── fl_query_hooks.dart │ ├── .metadata │ ├── README.md │ ├── pubspec.yaml │ └── .gitignore ├── fl_query_devtools │ ├── lib │ │ ├── fl_query_devtools.dart │ │ └── src │ │ │ ├── helpers │ │ │ ├── primitvify_value.dart │ │ │ └── jsonify_value.dart │ │ │ └── widgets │ │ │ ├── tabs │ │ │ └── mutation_tab.dart │ │ │ ├── explorers │ │ │ └── explorer_view.dart │ │ │ ├── query_tile.dart │ │ │ └── devtools_root.dart │ ├── README.md │ ├── pubspec_overrides.yaml │ ├── analysis_options.yaml │ ├── .metadata │ ├── pubspec.yaml │ ├── CHANGELOG.md │ └── .gitignore └── fl_query_connectivity_plus_adapter │ ├── README.md │ ├── pubspec_overrides.yaml │ ├── analysis_options.yaml │ ├── .metadata │ ├── pubspec.yaml │ ├── .gitignore │ ├── lib │ ├── fl_query_connectivity_plus_adapter.dart │ └── lookups │ │ ├── connection_lookup_web.dart │ │ └── connection_lookup_io.dart │ └── CHANGELOG.md ├── .vscode ├── settings.json └── launch.json ├── .gitignore ├── assets └── fl-query-banner.png ├── melos.yaml ├── pubspec.yaml └── melos_fl-query.iml /docs/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/fl_query/example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /docs/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": false, 3 | "semi": true 4 | } -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dart.runPubGetOnPubspecChanges": false 3 | } -------------------------------------------------------------------------------- /packages/fl_query/example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/dryrun.log 2 | .vscode/configurationCache.log 3 | .idea 4 | .dart_tool/ -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Docs for Fl-Query 2 | 3 | This documentation is based on Docusaurus2 & React -------------------------------------------------------------------------------- /packages/fl_query/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | -------------------------------------------------------------------------------- /docs/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/favicon.ico -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /assets/fl-query-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/assets/fl-query-banner.png -------------------------------------------------------------------------------- /docs/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/img/favicon.ico -------------------------------------------------------------------------------- /docs/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "plugin:@docusaurus/recommended", 4 | "prettier" 5 | ] 6 | } -------------------------------------------------------------------------------- /docs/static/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/favicon-16x16.png -------------------------------------------------------------------------------- /docs/static/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/favicon-32x32.png -------------------------------------------------------------------------------- /docs/static/img/docusaurus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/img/docusaurus.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /docs/static/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/fl_query_devtools.dart: -------------------------------------------------------------------------------- 1 | library fl_query_devtools; 2 | 3 | export 'src/devtools.dart'; 4 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/README.md: -------------------------------------------------------------------------------- 1 | # Fl-Query Devtools 2 | 3 | Devtools support for [Fl-Query](https://fl-query.krtirtho.dev) -------------------------------------------------------------------------------- /docs/static/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/static/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/static/img/no_boilerplate_code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/docs/static/img/no_boilerplate_code.png -------------------------------------------------------------------------------- /packages/fl_query/example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/web/favicon.png -------------------------------------------------------------------------------- /packages/fl_query/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/web/favicon.png -------------------------------------------------------------------------------- /docs/docs/migrations/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Migrations", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query/example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /packages/fl_query/example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /melos.yaml: -------------------------------------------------------------------------------- 1 | name: fl-query 2 | 3 | packages: 4 | - packages/** 5 | 6 | ignore: 7 | - package/example/ 8 | 9 | ide: 10 | intellij: false 11 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /docs/docs/getting-started/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Getting Started", 3 | "position": 1, 4 | "link": { 5 | "type": "generated-index" 6 | } 7 | } -------------------------------------------------------------------------------- /packages/fl_query/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query/example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /packages/fl_query/example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /packages/fl_query_devtools/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | # melos_managed_dependency_overrides: fl_query 2 | dependency_overrides: 3 | fl_query: 4 | path: ../fl_query 5 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | # melos_managed_dependency_overrides: fl_query 2 | dependency_overrides: 3 | fl_query: 4 | path: ../fl_query 5 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/README.md: -------------------------------------------------------------------------------- 1 | # Fl-Query Connectivity Plus Adapter 2 | 3 | Connectivity Plus Adapter for [Fl-Query](https://fl-query.krtirtho.dev/) -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /docs/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /docs/blog/authors.yml: -------------------------------------------------------------------------------- 1 | krtirtho: 2 | name: Kingkor Roy Tirtho 3 | title: Creator of Fl-Query 4 | url: https://github.com/KRTirtho 5 | image_url: https://github.com/KRTirtho.png 6 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | # melos_managed_dependency_overrides: fl_query 2 | dependency_overrides: 3 | fl_query: 4 | path: ../fl_query 5 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query_devtools/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /packages/fl_query/lib/src/core/mixins/validation.dart: -------------------------------------------------------------------------------- 1 | mixin Invalidation { 2 | DateTime get updatedAt; 3 | Duration get staleDuration; 4 | 5 | bool get isStale => DateTime.now().difference(updatedAt) > staleDuration; 6 | } 7 | -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | // This file is not used in compilation. It is here just for a nice editor experience. 3 | "extends": "@tsconfig/docusaurus/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": "." 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | # Additional information about this file can be found at 4 | # https://dart.dev/guides/language/analysis-options 5 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /packages/fl_query/example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /docs/docs/advanced/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Advanced", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "Advanced caching and data manipulation techniques to make your app better" 7 | } 8 | } -------------------------------------------------------------------------------- /docs/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /docs/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: ["./src/**/*.{js,jsx,ts,tsx}"], 4 | darkMode: "class", 5 | theme: { 6 | extend: {}, 7 | }, 8 | plugins: [], 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KRTirtho/fl-query/HEAD/packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/src/use_query_client.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/fl_query.dart'; 2 | import 'package:flutter_hooks/flutter_hooks.dart'; 3 | 4 | QueryClient useQueryClient() { 5 | final context = useContext(); 6 | return QueryClient.of(context); 7 | } 8 | -------------------------------------------------------------------------------- /packages/fl_query/example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /docs/docs/basics/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "Basics", 3 | "position": 2, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "Learn all the basic concepts of Fl-Query as well as the practical use-cases that can enhance your development experience" 7 | } 8 | } -------------------------------------------------------------------------------- /docs/static/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/collections/json_config.dart: -------------------------------------------------------------------------------- 1 | class JsonConfig { 2 | final Map Function(T data) toJson; 3 | final T Function(Map json) fromJson; 4 | 5 | const JsonConfig({ 6 | required this.toJson, 7 | required this.fromJson, 8 | }); 9 | } 10 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | # melos_managed_dependency_overrides: fl_query,fl_query_hooks,fl_query_connectivity_plus_adapter 2 | dependency_overrides: 3 | fl_query: 4 | path: ../../fl_query 5 | fl_query_connectivity_plus_adapter: 6 | path: ../../fl_query_connectivity_plus_adapter 7 | fl_query_hooks: 8 | path: .. 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | # melos_managed_dependency_overrides: fl_query,fl_query_connectivity_plus_adapter,fl_query_devtools 2 | dependency_overrides: 3 | fl_query: 4 | path: .. 5 | fl_query_connectivity_plus_adapter: 6 | path: ../../fl_query_connectivity_plus_adapter 7 | fl_query_devtools: 8 | path: ../../fl_query_devtools 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/fl_query_hooks.dart: -------------------------------------------------------------------------------- 1 | library fl_query_hooks; 2 | 3 | export 'src/use_query_client.dart'; 4 | export 'src/use_query.dart'; 5 | export 'src/use_infinite_query.dart'; 6 | export 'src/use_mutation.dart'; 7 | 8 | export 'src/jobs/use_query_job.dart'; 9 | export 'src/jobs/use_infinite_query_job.dart'; 10 | export 'src/jobs/use_mutation_job.dart'; 11 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query_packages 2 | description: Asynchronous data caching, refetching & invalidation libraries for Flutter 3 | homepage: https://fl-query.krtirtho.dev 4 | 5 | issue_tracker: https://github.com/KRTirtho/fl-query/issues 6 | repository: https://github.com/KRTirtho/fl-query 7 | 8 | environment: 9 | sdk: ">=2.17.1 <4.0.0" 10 | 11 | dependencies: 12 | melos: ^3.1.0 13 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 9cd3d0d9ff05768afa249e036acc66e8abe93bff 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /packages/fl_query/example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 14 | } 15 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | ConnectivityPlusWindowsPluginRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); 14 | } 15 | -------------------------------------------------------------------------------- /docs/src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 996px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fl_query/example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import connectivity_plus 9 | import path_provider_foundation 10 | 11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 12 | ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) 13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 14 | } 15 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import connectivity_plus 9 | import path_provider_foundation 10 | 11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 12 | ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin")) 13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 14 | } 15 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/fl_query/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query_example 2 | description: A new Flutter project. 3 | publish_to: 'none' 4 | version: 0.1.0 5 | 6 | environment: 7 | sdk: '>=2.19.0 <3.0.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | fl_query: ^1.1.0 13 | fl_query_connectivity_plus_adapter: ^0.1.0+1 14 | fl_query_devtools: ^0.1.0+1 15 | go_router: ^6.0.9 16 | http: ^0.13.5 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | flutter_lints: ^2.0.0 22 | 23 | flutter: 24 | uses-material-design: true 25 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /melos_fl-query.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query_devtools 2 | description: Devtools support for Fl-Query 3 | version: 0.1.0+1 4 | homepage: https://fl-query.krtirtho.dev 5 | repository: https://github.com/KRTirtho/fl-query/tree/main/packages/fl_query_devtools 6 | issue_tracker: https://github.com/KRTirtho/fl-query/issues 7 | 8 | environment: 9 | sdk: '>=2.17.1 <4.0.0' 10 | flutter: ">=1.17.0" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | fl_query: ^1.1.0 16 | json_view: ^0.4.1 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | flutter_lints: ^2.0.0 22 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/README.md: -------------------------------------------------------------------------------- 1 | ![Fl-Query Banner](https://user-images.githubusercontent.com/61944859/178648225-611d248b-df97-4f0d-b298-b178bb141a29.png) 2 |

3 |

4 | Fl-Query Hooks 5 |

6 |

7 | 8 | 9 | The `flutter_hooks` compatible version of [fl-query](https://github.com/KRTirtho/fl-query/packages/fl_query) 10 | 11 | Fl-Query, an Asynchronous data caching, refetching & invalidation library for Flutter. FL-Query lets you manage & distribute your async data without touching any global state 12 | 13 | Fl-Query makes asynchronous server state management a breeze in flutter -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/src/helpers/primitvify_value.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | Object? primitivifyValue(data) { 4 | switch (data.runtimeType) { 5 | case String: 6 | case int: 7 | case double: 8 | case bool: 9 | case Null: 10 | return data; 11 | case Iterable: 12 | case Map: 13 | try { 14 | jsonEncode(data); 15 | return data; 16 | } catch (e) { 17 | return "[Parsing Error]: ${data.runtimeType} contains unsupported non-primitive and non-jsonEncodable value"; 18 | } 19 | default: 20 | return data.toString(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query_hooks_example 2 | description: A new Flutter project. 3 | 4 | version: 1.0.0+1 5 | 6 | publish_to: none 7 | 8 | environment: 9 | sdk: ">=2.19.2 <3.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | cupertino_icons: ^1.0.2 16 | fl_query: ^1.1.0 17 | fl_query_connectivity_plus_adapter: ^0.1.0+1 18 | fl_query_hooks: ^1.1.0 19 | go_router: ^6.0.9 20 | http: ^0.13.5 21 | flutter_hooks: ^0.20.0 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | 27 | flutter_lints: ^2.0.0 28 | 29 | flutter: 30 | uses-material-design: true 31 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query_connectivity_plus_adapter 2 | description: Connectivity Plus adapter for FlQuery Connectivity 3 | version: 0.1.0+1 4 | 5 | homepage: https://fl-query.krtirtho.dev 6 | repository: https://github.com/KRTirtho/tree/main/packages/fl_query_connectivity_plus_adapter 7 | issue_tracker: https://github.com/KRTirtho/fl-query/issues 8 | 9 | environment: 10 | sdk: ">=2.17.1 <4.0.0" 11 | flutter: ">=1.17.0" 12 | 13 | dependencies: 14 | flutter: 15 | sdk: flutter 16 | fl_query: ^1.1.0 17 | connectivity_plus: ^4.0.1 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | flutter_lints: ^2.0.0 -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/src/utils/use_updater.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/scheduler.dart'; 2 | import 'package:flutter/widgets.dart'; 3 | import 'package:flutter_hooks/flutter_hooks.dart'; 4 | 5 | ValueChanged useUpdater() { 6 | final state = useState(false); 7 | final isMounted = useIsMounted(); 8 | return ([_]) async { 9 | if (!isMounted()) return; 10 | 11 | // if there's a current frame, 12 | if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.idle) { 13 | // wait for the end of that frame. 14 | await SchedulerBinding.instance.endOfFrame; 15 | if (!isMounted()) return; 16 | } 17 | 18 | state.value = !state.value; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.0+1 2 | 3 | - **FIX**: schedule to queue doesn't work and stale queries cause infinite loop. 4 | 5 | ## 0.1.0 6 | 7 | - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. 8 | 9 | ## 0.1.0-alpha.4 10 | 11 | - Update a dependency to the latest release. 12 | 13 | ## 0.1.0-alpha.3 14 | 15 | - **FEAT**(infinite_query): add isLoadingNextPage & remove isLoadingPage. 16 | 17 | ## 0.1.0-alpha.2 18 | 19 | - **FIX**(devtools): no wrapping child inside SizedBox.shrink. 20 | 21 | ## 0.1.0-alpha.1 22 | 23 | - Update a dependency to the latest release. 24 | 25 | ## 0.0.1 26 | 27 | * TODO: Describe initial release. 28 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query_hooks 2 | description: Elite flutter_hooks compatible library for fl_query, the 3 | Asynchronous data caching, refetching & invalidation library for Flutter 4 | version: 1.1.0 5 | 6 | homepage: https://fl-query.krtirtho.dev 7 | issue_tracker: https://github.com/KRTirtho/fl-query/issues 8 | repository: https://github.com/KRTirtho/fl-query/tree/main/packages/fl_query_hooks 9 | 10 | 11 | environment: 12 | sdk: ">=2.17.1 <4.0.0" 13 | flutter: ">=1.17.0" 14 | 15 | dependencies: 16 | flutter: 17 | sdk: flutter 18 | fl_query: ^1.1.0 19 | flutter_hooks: ^0.20.0 20 | 21 | dev_dependencies: 22 | flutter_lints: ^2.0.0 23 | flutter_test: 24 | sdk: flutter 25 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | .flutter-plugins 32 | .flutter-plugins-dependencies -------------------------------------------------------------------------------- /packages/fl_query/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | 32 | .flutter-plugins-dependencies 33 | .flutter-plugins 34 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | .flutter-plugins 32 | .flutter-plugins-dependencies -------------------------------------------------------------------------------- /packages/fl_query/lib/src/collections/connectivity_adapter.dart: -------------------------------------------------------------------------------- 1 | abstract class ConnectivityAdapter { 2 | bool _isConnectedSync; 3 | 4 | ConnectivityAdapter() : _isConnectedSync = true { 5 | isConnected.then((c) => _isConnectedSync = c); 6 | onConnectivityChanged.listen((isConnected) { 7 | _isConnectedSync = isConnected; 8 | }); 9 | } 10 | 11 | bool get isConnectedSync => _isConnectedSync; 12 | 13 | Future get isConnected; 14 | 15 | Stream get onConnectivityChanged; 16 | } 17 | 18 | class NoOpConnectivityAdapter extends ConnectivityAdapter { 19 | @override 20 | Future get isConnected => Future.value(true); 21 | 22 | @override 23 | Stream get onConnectivityChanged => Stream.empty(); 24 | } 25 | -------------------------------------------------------------------------------- /packages/fl_query/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: fl_query 2 | description: Asynchronous data caching, refetching & invalidation library for Flutter 3 | version: 1.1.0 4 | 5 | homepage: https://fl-query.krtirtho.dev 6 | issue_tracker: https://github.com/KRTirtho/fl-query/issues 7 | repository: https://github.com/KRTirtho/fl-query/tree/main/packages/fl_query 8 | 9 | environment: 10 | sdk: ">=2.17.1 <4.0.0" 11 | flutter: ">=1.17.0" 12 | 13 | dependencies: 14 | flutter: 15 | sdk: flutter 16 | async: ^2.10.0 17 | collection: ^1.16.0 18 | hive_flutter: ^1.1.0 19 | mutex: ^3.0.1 20 | state_notifier: ^0.7.2+1 21 | 22 | dev_dependencies: 23 | build_runner: ^2.2.0 24 | flutter_lints: ^2.0.0 25 | flutter_test: 26 | sdk: flutter 27 | mockito: ^5.2.0 28 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | .flutter-plugins 32 | .flutter-plugins-dependencies 33 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/src/jobs/use_query_job.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/fl_query.dart'; 2 | import 'package:fl_query_hooks/src/use_query.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | Query useQueryJob({ 6 | required QueryJob job, 7 | required ArgsType args, 8 | ValueChanged? onData, 9 | ValueChanged? onError, 10 | }) { 11 | return useQuery( 12 | job.queryKey, 13 | () => job.task(args), 14 | initial: job.initial, 15 | retryConfig: job.retryConfig, 16 | refreshConfig: job.refreshConfig, 17 | jsonConfig: job.jsonConfig, 18 | onData: onData, 19 | onError: onError, 20 | enabled: job.enabled, 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/lib/fl_query_connectivity_plus_adapter.dart: -------------------------------------------------------------------------------- 1 | library fl_query_connectivity_plus_adapter; 2 | 3 | import 'package:fl_query/fl_query.dart'; 4 | import 'package:fl_query_connectivity_plus_adapter/connection_checker.dart'; 5 | 6 | /// A [ConnectivityAdapter] that uses the `connectivity_plus` package. 7 | class FlQueryConnectivityPlusAdapter extends ConnectivityAdapter { 8 | final InternetConnectivityChecker _adapter; 9 | FlQueryConnectivityPlusAdapter({ 10 | Duration pollingDuration = const Duration(seconds: 30), 11 | }) : _adapter = InternetConnectivityChecker(pollingDuration); 12 | 13 | @override 14 | Future get isConnected async { 15 | return await _adapter.hasConnection(); 16 | } 17 | 18 | @override 19 | Stream get onConnectivityChanged => _adapter.onConnectionChanged; 20 | } 21 | -------------------------------------------------------------------------------- /docs/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | // By default, Docusaurus generates a sidebar from the docs folder structure 17 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], 18 | 19 | // But you can create a sidebar manually 20 | /* 21 | tutorialSidebar: [ 22 | { 23 | type: 'category', 24 | label: 'Tutorial', 25 | items: ['hello'], 26 | }, 27 | ], 28 | */ 29 | }; 30 | 31 | module.exports = sidebars; 32 | -------------------------------------------------------------------------------- /packages/fl_query/example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /packages/fl_query/example/lib/router.dart: -------------------------------------------------------------------------------- 1 | import "package:fl_query_example/pages/home.dart"; 2 | import "package:fl_query_example/pages/infinite_query.dart"; 3 | import "package:fl_query_example/pages/mutation/mutation.dart"; 4 | import "package:fl_query_example/pages/query.dart"; 5 | import "package:go_router/go_router.dart"; 6 | 7 | final router = GoRouter( 8 | initialLocation: '/', 9 | routes: [ 10 | GoRoute( 11 | path: '/', 12 | builder: (context, state) => const HomePage(), 13 | ), 14 | GoRoute( 15 | path: '/query', 16 | builder: (context, state) => const QueryPage(), 17 | ), 18 | GoRoute( 19 | path: '/infinite-query', 20 | builder: (context, state) => const InfiniteQueryPageWidget(), 21 | ), 22 | GoRoute( 23 | path: '/mutation', 24 | builder: (context, state) => const MutationPage(), 25 | ), 26 | ], 27 | ); 28 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/lib/lookups/connection_lookup_web.dart: -------------------------------------------------------------------------------- 1 | import 'dart:html'; 2 | import 'package:fl_query_connectivity_plus_adapter/connection_checker.dart'; 3 | 4 | mixin ConnectionLookupMixin implements ConnectionLookup { 5 | @override 6 | Future doesConnectTo(String address) async { 7 | try { 8 | final url = address.startsWith("http") || address.startsWith("/") 9 | ? address 10 | : "https://$address"; 11 | final request = await HttpRequest.request( 12 | url, 13 | requestHeaders: { 14 | 'Cache-Control': 'no-cache', 15 | 'Pragma': 'no-cache', 16 | }, 17 | ); 18 | 19 | return (request.status ?? 0) < 400; 20 | } catch (_) { 21 | return false; 22 | } 23 | } 24 | 25 | @override 26 | Future isVpnActive() { 27 | return Future.value(false); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | connectivity_plus 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /packages/fl_query/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | connectivity_plus 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.0+1 2 | 3 | - **FIX**: schedule to queue doesn't work and stale queries cause infinite loop. 4 | 5 | ## 0.1.0 6 | 7 | - Graduate package to a stable release. See pre-releases prior to this version for changelog entries. 8 | 9 | ## 0.1.0-alpha.5 10 | 11 | - **FEAT**(fl_query_connectivity_plus_adapter): only poll to check online when connection is false. 12 | - **FEAT**(fl_query_connectivity_plus_adapter): lookup based offline detection. 13 | 14 | ## 0.1.0-alpha.4 15 | 16 | - Update a dependency to the latest release. 17 | 18 | ## 0.1.0-alpha.3 19 | 20 | - Update a dependency to the latest release. 21 | 22 | ## 0.1.0-alpha.2 23 | 24 | - **FIX**(fl_query_connectivity_plus_adapter): lower the sdk constrains. 25 | 26 | ## 0.1.0-alpha.1 27 | 28 | - Update a dependency to the latest release. 29 | 30 | ## 0.0.1 31 | 32 | * TODO: Describe initial release. 33 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/src/helpers/jsonify_value.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:fl_query/fl_query.dart'; 4 | 5 | Object? jsonifyValue(data, JsonConfig? jsonConfig) { 6 | switch (data.runtimeType) { 7 | case String: 8 | case int: 9 | case double: 10 | case bool: 11 | case Null: 12 | return data; 13 | case Iterable: 14 | case Map: 15 | try { 16 | jsonEncode(data); 17 | return data is Iterable ? data.toList() : data; 18 | } catch (e) { 19 | return "[Parsing Error]: ${data.runtimeType} contains unsupported non-primitive and non-jsonEncodable value"; 20 | } 21 | default: 22 | if (jsonConfig == null) { 23 | return "$data" 24 | "\nProvide `jsonConfig: JsonConfig(...)` to enable Json view for data"; 25 | } else { 26 | return (jsonConfig as dynamic).toJson(data); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/collections/default_configs.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/src/collections/refresh_config.dart'; 2 | import 'package:fl_query/src/collections/retry_config.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | /// Default configurations for [RetryConfig], [RefreshConfig] and [Duration] 6 | /// 7 | /// This are opinionated defaults and can be overridden 8 | @immutable 9 | abstract class DefaultConstants { 10 | static const RetryConfig retryConfig = RetryConfig( 11 | maxRetries: 3, 12 | retryDelay: Duration(seconds: 1), 13 | cancelWhenOffline: true, 14 | ); 15 | 16 | static const RefreshConfig refreshConfig = RefreshConfig( 17 | staleDuration: Duration(minutes: 2, milliseconds: 250), 18 | refreshInterval: Duration.zero, 19 | refreshOnMount: false, 20 | refreshOnQueryFnChange: false, 21 | refreshOnNetworkStateChange: true, 22 | ); 23 | 24 | static const Duration cacheDuration = Duration(minutes: 5); 25 | } 26 | -------------------------------------------------------------------------------- /packages/fl_query/example/lib/pages/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:go_router/go_router.dart'; 3 | 4 | class HomePage extends StatelessWidget { 5 | const HomePage({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text('FL Query Example'), 12 | ), 13 | body: ListView( 14 | children: [ 15 | ListTile( 16 | title: const Text('Query'), 17 | onTap: () => GoRouter.of(context).push('/query'), 18 | ), 19 | ListTile( 20 | title: const Text('Infinite Query'), 21 | onTap: () => GoRouter.of(context).push('/infinite-query'), 22 | ), 23 | ListTile( 24 | title: const Text('Mutation'), 25 | onTap: () => GoRouter.of(context).push('/mutation'), 26 | ), 27 | ], 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/src/widgets/tabs/mutation_tab.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/fl_query.dart'; 2 | import 'package:fl_query_devtools/src/widgets/query_tile.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class MutationTab extends StatefulWidget { 6 | const MutationTab({super.key}); 7 | 8 | @override 9 | State createState() => _MutationTabState(); 10 | } 11 | 12 | class _MutationTabState extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | final client = QueryClient.of(context); 16 | 17 | return ListView.builder( 18 | itemCount: client.cache.mutations.length, 19 | itemBuilder: (context, index) { 20 | final mutation = client.cache.mutations.elementAt(index); 21 | return QueryTile( 22 | title: mutation.key, 23 | isLoading: mutation.isMutating, 24 | hasError: mutation.hasError, 25 | ); 26 | }, 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/src/jobs/use_mutation_job.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/fl_query.dart'; 2 | import 'package:fl_query_hooks/src/use_mutation.dart'; 3 | 4 | Mutation 5 | useMutationJob({ 6 | required MutationJob 8 | job, 9 | MutationOnDataFn? onData, 10 | MutationOnErrorFn? onError, 11 | MutationOnMutationFn? onMutate, 12 | required ArgsType args, 13 | List? keys, 14 | }) { 15 | return useMutation( 16 | job.mutationKey, 17 | (variables) => job.task(variables, args), 18 | retryConfig: job.retryConfig, 19 | onData: onData, 20 | onError: onError, 21 | onMutate: onMutate, 22 | refreshQueries: job.refreshQueries, 23 | refreshInfiniteQueries: job.refreshInfiniteQueries, 24 | keys: keys, 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query_connectivity_plus_adapter/fl_query_connectivity_plus_adapter.dart'; 2 | import 'package:fl_query_hooks_example/router.dart'; 3 | import 'package:fl_query/fl_query.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | void main() async { 7 | WidgetsFlutterBinding.ensureInitialized(); 8 | await QueryClient.initialize( 9 | cachePrefix: 'fl_query_hooks_example', 10 | connectivity: FlQueryConnectivityPlusAdapter(), 11 | ); 12 | runApp( 13 | QueryClientProvider( 14 | child: const MainApp(), 15 | ), 16 | ); 17 | } 18 | 19 | class MainApp extends StatelessWidget { 20 | const MainApp({super.key}); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | return MaterialApp.router( 25 | theme: ThemeData( 26 | colorSchemeSeed: Colors.red[100], 27 | useMaterial3: true, 28 | ), 29 | title: 'FL Query Hooks Example', 30 | routerConfig: router, 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/src/jobs/use_infinite_query_job.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/fl_query.dart'; 2 | import 'package:fl_query_hooks/src/use_infinite_query.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | InfiniteQuery 6 | useInfiniteQueryJob({ 7 | required InfiniteQueryJob job, 8 | required ArgsType args, 9 | ValueChanged>? onData, 10 | ValueChanged>? onError, 11 | List? keys, 12 | }) { 13 | return useInfiniteQuery( 14 | job.queryKey, 15 | (page) => job.task(page, args), 16 | initialPage: job.initialPage, 17 | nextPage: job.nextPage, 18 | retryConfig: job.retryConfig, 19 | refreshConfig: job.refreshConfig, 20 | jsonConfig: job.jsonConfig, 21 | onData: onData, 22 | onError: onError, 23 | enabled: job.enabled, 24 | keys: keys, 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/widgets/mixins/rebuilder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/scheduler.dart'; 3 | 4 | /// Guarantees that the [setState] method is called only if the widget is 5 | /// mounted and not in the middle of a frame. If it is in the middle of a frame, 6 | /// it will wait for the end of the frame and then call [setState]. Which ensures 7 | /// updates are not lost/skipped. 8 | /// 9 | /// Shamelessly copied from [StackOverflow](https://stackoverflow.com/a/64702218/13292290) 10 | /// 11 | /// Thanks to [dev-aggarwal](https://stackoverflow.com/users/7061265/dev-aggarwal) 12 | mixin SafeRebuild on State { 13 | Future rebuild([_]) async { 14 | if (!mounted) return; 15 | 16 | // if there's a current frame, 17 | if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.idle) { 18 | // wait for the end of that frame. 19 | await SchedulerBinding.instance.endOfFrame; 20 | if (!mounted) return; 21 | } 22 | 23 | setState(() {}); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/fl_query/example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/lib/pages/mutation/mutation-awaits-result.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query_hooks/fl_query_hooks.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:flutter_hooks/flutter_hooks.dart'; 5 | 6 | class MutationAwaitsResult extends HookWidget { 7 | const MutationAwaitsResult({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final mutation = useMutation('mutation2', (variables) { 12 | return Future.delayed(const Duration(seconds: 2), () => 'result value'); 13 | }, onData: (data, _) { 14 | print('done in onData: $data'); 15 | }); 16 | 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: const Text('Mutation awaits result'), 20 | ), 21 | body: Center( 22 | child: ElevatedButton( 23 | child: const Text('Run'), 24 | onPressed: () async { 25 | print('clicked'); 26 | final result = await mutation.mutate(null); 27 | print(result); 28 | }, 29 | ), 30 | ), 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/fl_query/lib/fl_query.dart: -------------------------------------------------------------------------------- 1 | library fl_query; 2 | 3 | export 'src/collections/default_configs.dart'; 4 | export 'src/collections/json_config.dart'; 5 | export 'src/collections/refresh_config.dart'; 6 | export 'src/collections/retry_config.dart'; 7 | export 'src/collections/connectivity_adapter.dart'; 8 | 9 | export 'src/collections/jobs/query_job.dart'; 10 | export 'src/collections/jobs/infinite_query_job.dart'; 11 | export 'src/collections/jobs/mutation_job.dart'; 12 | 13 | export 'src/core/cache.dart'; 14 | export 'src/core/client.dart'; 15 | export 'src/core/infinite_query.dart'; 16 | export 'src/core/provider.dart'; 17 | export 'src/core/query.dart'; 18 | export 'src/core/mutation.dart'; 19 | 20 | export 'src/widgets/query_builder.dart'; 21 | export 'src/widgets/query_listenable.dart'; 22 | export 'src/widgets/infinite_query_builder.dart'; 23 | export 'src/widgets/infinite_query_listenable.dart'; 24 | export 'src/widgets/mutation_builder.dart'; 25 | export 'src/widgets/state_resolvers/query_state.dart'; 26 | export 'src/widgets/state_resolvers/infinite_query_state.dart'; 27 | export 'src/widgets/state_resolvers/mutation_state.dart'; 28 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /docs/src/css/custom.css: -------------------------------------------------------------------------------- 1 | @tailwind components; 2 | @tailwind utilities; 3 | 4 | 5 | /** 6 | * Any CSS included here will be global. The classic template 7 | * bundles Infima by default. Infima is a CSS framework designed to 8 | * work well for content-centric websites. 9 | */ 10 | 11 | /* You can override the default Infima variables here. */ 12 | :root { 13 | --ifm-color-primary: #fa4c5e; 14 | --ifm-color-primary-dark: #e93a4c; 15 | --ifm-color-primary-darker: #d83747; 16 | --ifm-color-primary-darkest: #c0303e; 17 | --ifm-color-primary-light: #f85e6d; 18 | --ifm-color-primary-lighter: #f76977; 19 | --ifm-color-primary-lightest: #f17582; 20 | --ifm-code-font-size: 95%; 21 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); 22 | } 23 | 24 | /* For readability concerns, you should choose a lighter palette in dark mode. */ 25 | [data-theme='dark'] { 26 | --ifm-color-primary: #fa4c5e; 27 | --ifm-color-primary-dark: #e93a4c; 28 | --ifm-color-primary-darker: #d83747; 29 | --ifm-color-primary-darkest: #c0303e; 30 | --ifm-color-primary-light: #f85e6d; 31 | --ifm-color-primary-lighter: #f76977; 32 | --ifm-color-primary-lightest: #f17582; 33 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/src/widgets/explorers/explorer_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:json_view/json_view.dart' hide JsonConfig; 3 | 4 | class ExplorerView extends StatefulWidget { 5 | final String title; 6 | final Object data; 7 | final VoidCallback? onClose; 8 | const ExplorerView({ 9 | super.key, 10 | required this.title, 11 | required this.data, 12 | this.onClose, 13 | }); 14 | 15 | @override 16 | State createState() => _ExplorerViewState(); 17 | } 18 | 19 | class _ExplorerViewState extends State { 20 | @override 21 | Widget build(BuildContext context) { 22 | return Card( 23 | color: Theme.of(context).colorScheme.surface, 24 | child: Column( 25 | children: [ 26 | Row( 27 | children: [ 28 | IconButton( 29 | icon: const Icon(Icons.close), 30 | onPressed: widget.onClose, 31 | ), 32 | Text(widget.title), 33 | ], 34 | ), 35 | const Divider(), 36 | Expanded( 37 | child: JsonView(json: widget.data), 38 | ), 39 | ], 40 | )); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/lib/pages/home.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:go_router/go_router.dart'; 3 | 4 | class HomePage extends StatelessWidget { 5 | const HomePage({super.key}); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | title: const Text('FL Query Hooks Example'), 12 | ), 13 | body: ListView( 14 | children: [ 15 | ListTile( 16 | title: const Text('Query'), 17 | onTap: () => GoRouter.of(context).push('/query'), 18 | ), 19 | ListTile( 20 | title: const Text('Infinite Query'), 21 | onTap: () => GoRouter.of(context).push('/infinite-query'), 22 | ), 23 | ListTile( 24 | title: const Text('Mutation'), 25 | onTap: () => GoRouter.of(context).push('/mutation'), 26 | ), 27 | ListTile( 28 | title: const Text('Mutation awaits result'), 29 | onTap: () => GoRouter.of(context).push('/mutation-awaits-result'), 30 | ), 31 | ListTile( 32 | title: const Text('Multiple Queries'), 33 | onTap: () => GoRouter.of(context).push('/multiple-queries'), 34 | ), 35 | ], 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/lib/router.dart: -------------------------------------------------------------------------------- 1 | import "package:fl_query_hooks_example/pages/home.dart"; 2 | import "package:fl_query_hooks_example/pages/infinite_query.dart"; 3 | import "package:fl_query_hooks_example/pages/multiple_queries.dart"; 4 | import "package:fl_query_hooks_example/pages/mutation/mutation-awaits-result.dart"; 5 | import "package:fl_query_hooks_example/pages/mutation/mutation.dart"; 6 | import "package:fl_query_hooks_example/pages/query.dart"; 7 | import "package:go_router/go_router.dart"; 8 | 9 | final router = GoRouter( 10 | initialLocation: '/', 11 | routes: [ 12 | GoRoute( 13 | path: '/', 14 | builder: (context, state) => const HomePage(), 15 | ), 16 | GoRoute( 17 | path: '/query', 18 | builder: (context, state) => const QueryPage(), 19 | ), 20 | GoRoute( 21 | path: '/infinite-query', 22 | builder: (context, state) => const InfiniteQueryPageWidget(), 23 | ), 24 | GoRoute( 25 | path: '/mutation', 26 | builder: (context, state) => const MutationPage(), 27 | ), 28 | GoRoute( 29 | path: '/mutation-awaits-result', 30 | builder: (context, state) => const MutationAwaitsResult(), 31 | ), 32 | GoRoute( 33 | path: '/multiple-queries', 34 | builder: (context, state) => const MultipleQueries(), 35 | ), 36 | ], 37 | ); 38 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/src/widgets/query_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class QueryTile extends StatelessWidget { 4 | final String title; 5 | final bool isLoading; 6 | final bool hasError; 7 | final VoidCallback? onTap; 8 | const QueryTile({ 9 | super.key, 10 | required this.title, 11 | required this.isLoading, 12 | required this.hasError, 13 | this.onTap, 14 | }); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return ListTile( 19 | onTap: onTap, 20 | leading: AnimatedSwitcher( 21 | duration: const Duration(milliseconds: 100), 22 | child: isLoading 23 | ? const CircularProgressIndicator() 24 | : hasError 25 | ? Tooltip( 26 | message: "'$title' has Errors", 27 | child: const Icon( 28 | Icons.error, 29 | color: Colors.red, 30 | ), 31 | ) 32 | : Tooltip( 33 | message: "'$title' has fetched/mutated data successfully", 34 | child: const Icon( 35 | Icons.check, 36 | color: Colors.green, 37 | ), 38 | ), 39 | ), 40 | title: Text(title), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/fl_query/example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query_connectivity_plus_adapter/fl_query_connectivity_plus_adapter.dart'; 2 | import 'package:fl_query_devtools/fl_query_devtools.dart'; 3 | import 'package:fl_query_example/router.dart'; 4 | import 'package:fl_query/fl_query.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | void main() async { 8 | WidgetsFlutterBinding.ensureInitialized(); 9 | await QueryClient.initialize( 10 | cachePrefix: 'fl_query_example', 11 | connectivity: FlQueryConnectivityPlusAdapter(), 12 | ); 13 | runApp( 14 | QueryClientProvider( 15 | child: const MainApp(), 16 | ), 17 | ); 18 | } 19 | 20 | class MainApp extends StatelessWidget { 21 | const MainApp({super.key}); 22 | 23 | @override 24 | Widget build(BuildContext context) { 25 | return MaterialApp.router( 26 | theme: ThemeData( 27 | colorSchemeSeed: Colors.red[100], 28 | useMaterial3: true, 29 | ), 30 | title: 'FL Query Example', 31 | builder: (context, child) { 32 | return FlQueryDevtools( 33 | child: QueryStateResolverProvider( 34 | child: child!, 35 | offline: () => const Center( 36 | child: Text("Why u offline? How can u live?"), 37 | ), 38 | ), 39 | ); 40 | }, 41 | routerConfig: router, 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /packages/fl_query_connectivity_plus_adapter/lib/lookups/connection_lookup_io.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:fl_query_connectivity_plus_adapter/connection_checker.dart'; 4 | 5 | mixin ConnectionLookupMixin implements ConnectionLookup { 6 | @override 7 | Future doesConnectTo(String address) async { 8 | try { 9 | final result = await InternetAddress.lookup(address); 10 | return result.isNotEmpty && result[0].rawAddress.isNotEmpty; 11 | } catch (_) { 12 | return false; 13 | } 14 | } 15 | 16 | static const _vpnNames = [ 17 | 'tun', 18 | 'tap', 19 | 'ppp', 20 | 'pptp', 21 | 'l2tp', 22 | 'ipsec', 23 | 'vpn', 24 | 'wireguard', 25 | 'openvpn', 26 | 'softether', 27 | 'proton', 28 | 'strongswan', 29 | 'cisco', 30 | 'forticlient', 31 | 'fortinet', 32 | 'hideme', 33 | 'hidemy', 34 | 'hideman', 35 | 'hidester', 36 | 'lightway', 37 | ]; 38 | 39 | @override 40 | Future isVpnActive() async { 41 | final interfaces = await NetworkInterface.list( 42 | includeLoopback: false, 43 | type: InternetAddressType.any, 44 | ); 45 | 46 | if (interfaces.isEmpty) { 47 | return false; 48 | } 49 | 50 | return interfaces.any( 51 | (interface) => 52 | _vpnNames.any((name) => interface.name.toLowerCase().contains(name)), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "fl_query", 9 | "cwd": "packages/fl_query/example", 10 | "request": "launch", 11 | "type": "dart" 12 | }, 13 | { 14 | "name": "fl_query (profile mode)", 15 | "cwd": "packages/fl_query/example", 16 | "request": "launch", 17 | "type": "dart", 18 | "flutterMode": "profile" 19 | }, 20 | { 21 | "name": "fl_query (release mode)", 22 | "cwd": "packages/fl_query/example", 23 | "request": "launch", 24 | "type": "dart", 25 | "flutterMode": "release" 26 | }, 27 | { 28 | "name": "hooks fl_query", 29 | "cwd": "packages/fl_query_hooks/example", 30 | "request": "launch", 31 | "type": "dart" 32 | }, 33 | { 34 | "name": "hooks fl_query (profile mode)", 35 | "cwd": "packages/fl_query_hooks/example", 36 | "request": "launch", 37 | "type": "dart", 38 | "flutterMode": "profile" 39 | }, 40 | { 41 | "name": "hooks fl_query (release mode)", 42 | "cwd": "packages/fl_query_hooks/example", 43 | "request": "launch", 44 | "type": "dart", 45 | "flutterMode": "release" 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"example", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/widgets/state_resolvers/query_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class QueryStateResolverProvider extends InheritedWidget { 4 | final Widget Function(dynamic error)? error; 5 | final Widget Function()? loading; 6 | final Widget Function()? offline; 7 | 8 | QueryStateResolverProvider({ 9 | this.error, 10 | this.loading, 11 | this.offline, 12 | required super.child, 13 | }) : assert( 14 | error != null || loading != null || offline != null, 15 | 'Why are you using `QueryStateResolverProvider` with no resolver?\n' 16 | 'You should provide at least one resolver.', 17 | ); 18 | 19 | static QueryStateResolverProvider? maybeOf(BuildContext context) { 20 | return context 21 | .dependOnInheritedWidgetOfExactType(); 22 | } 23 | 24 | static QueryStateResolverProvider of(BuildContext context) { 25 | final provider = maybeOf(context); 26 | assert( 27 | provider != null, 28 | 'You are trying to access a `QueryStateResolverProvider` outside of its scope.\n' 29 | 'You should wrap your widget tree with `QueryStateResolverProvider`.', 30 | ); 31 | return provider!; 32 | } 33 | 34 | @override 35 | bool updateShouldNotify(QueryStateResolverProvider oldWidget) { 36 | return error != oldWidget.error || 37 | loading != oldWidget.loading || 38 | offline != oldWidget.offline; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"example", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /packages/fl_query_devtools/lib/src/widgets/devtools_root.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query_devtools/src/widgets/tabs/infinite_query_tab.dart'; 2 | import 'package:fl_query_devtools/src/widgets/tabs/mutation_tab.dart'; 3 | import 'package:fl_query_devtools/src/widgets/tabs/query_tab.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class DevtoolsRoot extends StatefulWidget { 7 | final VoidCallback? onClose; 8 | const DevtoolsRoot({super.key, this.onClose}); 9 | 10 | @override 11 | State createState() => _DevtoolsRootState(); 12 | } 13 | 14 | class _DevtoolsRootState extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return DefaultTabController( 18 | length: 3, 19 | child: Scaffold( 20 | appBar: AppBar( 21 | title: const Text('FlQuery Devtools'), 22 | actions: [ 23 | IconButton( 24 | onPressed: widget.onClose, 25 | icon: const Icon(Icons.close), 26 | ), 27 | ], 28 | bottom: const TabBar( 29 | tabs: [ 30 | Tab(text: 'Queries'), 31 | Tab(text: 'Infinite Queries'), 32 | Tab(text: 'Mutations'), 33 | ], 34 | ), 35 | ), 36 | body: const TabBarView( 37 | children: [ 38 | QueryTab(), 39 | InfiniteQueryTab(), 40 | MutationTab(), 41 | ], 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids", 15 | "typecheck": "tsc" 16 | }, 17 | "dependencies": { 18 | "@docusaurus/core": "2.4.3", 19 | "@docusaurus/preset-classic": "2.4.3", 20 | "@mdx-js/react": "1.6.22", 21 | "autoprefixer": "^10.4.16", 22 | "clsx": "^2.0.0", 23 | "postcss": "^8.4.31", 24 | "prism-react-renderer": "^2.1.0", 25 | "react": "^17.0.2", 26 | "react-dom": "^17.0.2", 27 | "react-icons": "^4.11.0", 28 | "tailwindcss": "^3.3.3" 29 | }, 30 | "devDependencies": { 31 | "@docusaurus/eslint-plugin": "^2.4.3", 32 | "@docusaurus/module-type-aliases": "2.4.3", 33 | "@tsconfig/docusaurus": "^2.0.1", 34 | "eslint": "^8.51.0", 35 | "eslint-config-prettier": "^9.0.0", 36 | "prettier": "^3.0.3", 37 | "typescript": "^5.2.2" 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.5%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 1 chrome version", 47 | "last 1 firefox version", 48 | "last 1 safari version" 49 | ] 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/widgets/state_resolvers/infinite_query_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class InfiniteQueryStateResolverProvider extends InheritedWidget { 4 | final Widget Function(List errors)? error; 5 | final Widget Function()? loading; 6 | final Widget Function()? offline; 7 | 8 | InfiniteQueryStateResolverProvider({ 9 | this.error, 10 | this.loading, 11 | this.offline, 12 | required super.child, 13 | }) : assert( 14 | error != null || loading != null || offline != null, 15 | 'Why are you using `InfiniteQueryStateResolverProvider` with no resolver?\n' 16 | 'You should provide at least one resolver.', 17 | ); 18 | 19 | static InfiniteQueryStateResolverProvider? maybeOf(BuildContext context) { 20 | return context.dependOnInheritedWidgetOfExactType< 21 | InfiniteQueryStateResolverProvider>(); 22 | } 23 | 24 | static InfiniteQueryStateResolverProvider of(BuildContext context) { 25 | final provider = maybeOf(context); 26 | assert( 27 | provider != null, 28 | 'You are trying to access a `InfiniteQueryStateResolverProvider` outside of its scope.\n' 29 | 'You should wrap your widget tree with `InfiniteQueryStateResolverProvider`.', 30 | ); 31 | return provider!; 32 | } 33 | 34 | @override 35 | bool updateShouldNotify(InfiniteQueryStateResolverProvider oldWidget) { 36 | return error != oldWidget.error || 37 | loading != oldWidget.loading || 38 | offline != oldWidget.offline; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/collections/retry_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/src/collections/default_configs.dart'; 2 | import 'package:fl_query/src/core/client.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class RetryConfig { 6 | final int maxRetries; 7 | final Duration retryDelay; 8 | final bool cancelWhenOffline; 9 | 10 | const RetryConfig({ 11 | required this.maxRetries, 12 | required this.retryDelay, 13 | required this.cancelWhenOffline, 14 | }); 15 | 16 | factory RetryConfig.withDefaults( 17 | BuildContext context, { 18 | int? maxRetries, 19 | Duration? retryDelay, 20 | }) { 21 | return QueryClient.of(context).retryConfig.copyWith( 22 | maxRetries: maxRetries, 23 | retryDelay: retryDelay, 24 | ); 25 | } 26 | 27 | factory RetryConfig.withConstantDefaults({ 28 | int? maxRetries, 29 | Duration? retryDelay, 30 | }) { 31 | return DefaultConstants.retryConfig.copyWith( 32 | maxRetries: maxRetries, 33 | retryDelay: retryDelay, 34 | ); 35 | } 36 | 37 | RetryConfig copyWith({ 38 | int? maxRetries, 39 | Duration? retryDelay, 40 | bool? cancelWhenOffline, 41 | }) { 42 | return RetryConfig( 43 | maxRetries: maxRetries ?? this.maxRetries, 44 | retryDelay: retryDelay ?? this.retryDelay, 45 | cancelWhenOffline: cancelWhenOffline ?? this.cancelWhenOffline, 46 | ); 47 | } 48 | 49 | Map toJson() { 50 | return { 51 | 'maxRetries': maxRetries, 52 | 'retryDelay': retryDelay.toString(), 53 | }; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/widgets/state_resolvers/mutation_state.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class MutationStateResolverProvider extends InheritedWidget { 4 | final Widget Function(dynamic error)? error; 5 | final Widget Function()? loading; 6 | final Widget Function()? offline; 7 | final Widget Function()? mutating; 8 | 9 | MutationStateResolverProvider({ 10 | this.error, 11 | this.loading, 12 | this.offline, 13 | this.mutating, 14 | required super.child, 15 | }) : assert( 16 | error != null || loading != null || offline != null, 17 | 'Why are you using `MutationStateResolverProvider` with no resolver?\n' 18 | 'You should provide at least one resolver.', 19 | ); 20 | 21 | static MutationStateResolverProvider? maybeOf(BuildContext context) { 22 | return context 23 | .dependOnInheritedWidgetOfExactType(); 24 | } 25 | 26 | static MutationStateResolverProvider of(BuildContext context) { 27 | final provider = maybeOf(context); 28 | assert( 29 | provider != null, 30 | 'You are trying to access a `MutationStateResolverProvider` outside of its scope.\n' 31 | 'You should wrap your widget tree with `MutationStateResolverProvider`.', 32 | ); 33 | return provider!; 34 | } 35 | 36 | @override 37 | bool updateShouldNotify(MutationStateResolverProvider oldWidget) { 38 | return error != oldWidget.error || 39 | loading != oldWidget.loading || 40 | offline != oldWidget.offline || 41 | mutating != oldWidget.mutating; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /packages/fl_query/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/widgets/state_notifier_listenable.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:state_notifier/state_notifier.dart'; 3 | 4 | typedef StateNotifierListenableBuilder = Widget Function( 5 | BuildContext context, 6 | StateNotifier value, 7 | ); 8 | 9 | class StateNotifierListenable extends StatefulWidget { 10 | final StateNotifier notifier; 11 | final StateNotifierListenableBuilder builder; 12 | const StateNotifierListenable({ 13 | required this.notifier, 14 | required this.builder, 15 | super.key, 16 | }); 17 | 18 | @override 19 | State> createState() => 20 | _StateNotifierListenableState(); 21 | } 22 | 23 | class _StateNotifierListenableState 24 | extends State> { 25 | VoidCallback? removeListener; 26 | 27 | void initialize() { 28 | removeListener = widget.notifier.addListener((_) { 29 | if (mounted) setState(() {}); 30 | }); 31 | } 32 | 33 | @override 34 | void initState() { 35 | super.initState(); 36 | WidgetsBinding.instance.addPostFrameCallback((_) { 37 | initialize(); 38 | }); 39 | } 40 | 41 | @override 42 | void dispose() { 43 | removeListener?.call(); 44 | super.dispose(); 45 | } 46 | 47 | @override 48 | void didUpdateWidget(covariant StateNotifierListenable oldWidget) { 49 | super.didUpdateWidget(oldWidget); 50 | if (oldWidget.notifier != widget.notifier) { 51 | removeListener?.call(); 52 | initialize(); 53 | } 54 | } 55 | 56 | @override 57 | Widget build(BuildContext context) { 58 | return widget.builder(context, widget.notifier); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/fl_query/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /docs/docs/getting-started/installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | title: Installation 4 | --- 5 | 6 | Fl-Query is just another Flutter "package" so no extra installation step needed just install it straight from https://pub.dev 7 | 8 | ```bash 9 | $ flutter pub add fl_query 10 | ``` 11 |
12 | 13 | ### Using with `flutter_hooks` 14 | 15 | 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 16 | 17 | ```bash 18 | $ flutter pub add fl_query_hooks 19 | $ flutter pub add flutter_hooks 20 | ``` 21 | 22 | The hooks can be imported as follows: 23 | 24 | ```dart 25 | import 'package:fl_query/fl_query_hooks.dart'; 26 | ``` 27 |
28 | 29 | ### Add offline support in your App (Optional) 30 | 31 | Fl-Query supports refetching queries when internet connection is restored. To enable this feature you need to install: 32 | 33 | ```bash 34 | $ flutter pub add fl_query_connectivity_plus_adapter 35 | ``` 36 | 37 | Add following in your `main.dart` file 38 | 39 | ```dart 40 | import 'package:fl_query_connectivity_plus_adapter/fl_query_connectivity_plus_adapter.dart'; 41 | 42 | void main() async { 43 | // .... 44 | await QueryClient.initialize( 45 | connectivity: FlQueryConnectivityPlusAdapter(), 46 | ); 47 | // .... 48 | } 49 | ``` 50 |
51 | 52 | ### Try out the new devtools✨ 53 | 54 | FL-Query now offers a devtool. It is still in alpha phase but it is expected to be complete in some time 55 | 56 | Install the devtools: 57 | 58 | ```bash 59 | $ flutter pub add fl_query_devtools 60 | ``` 61 | 62 | Add following to `MaterialApp`'s or `CupertinoApp`'s `builder` parameter: 63 | 64 | ```dart 65 | MaterialApp.router( 66 | title: 'FL Query Example', 67 | builder: (context, child) { 68 | return FlQueryDevtools(child: child!); 69 | }, 70 | //... 71 | ) 72 | ``` -------------------------------------------------------------------------------- /packages/fl_query/example/lib/pages/query.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:fl_query/fl_query.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class QueryPage extends StatelessWidget { 7 | const QueryPage({super.key}); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | final value = Random().nextInt(200000); 12 | return Scaffold( 13 | appBar: AppBar( 14 | title: const Text('Query'), 15 | ), 16 | floatingActionButton: 17 | QueryListenable('hello', builder: (context, query) { 18 | if (query == null) { 19 | return const SizedBox(); 20 | } 21 | return FloatingActionButton( 22 | onPressed: () { 23 | query.refresh(); 24 | }, 25 | child: Text(query.data ?? 'No Data'), 26 | ); 27 | }), 28 | body: QueryBuilder( 29 | 'hello', 30 | () { 31 | return Future.delayed( 32 | const Duration(seconds: 6), 33 | () => 'Hello World! $value', 34 | ); 35 | }, 36 | initial: 'Hello', 37 | // jsonConfig: JsonConfig( 38 | // fromJson: (json) => json['data'], 39 | // toJson: (data) => {'data': data}, 40 | // ), 41 | onData: (value) { 42 | debugPrint('onData: $value'); 43 | }, 44 | onError: (error) { 45 | debugPrint('onError: $error'); 46 | }, 47 | builder: (context, query) { 48 | return query.resolveWith( 49 | context, 50 | (data) => Center(child: Text(data)), 51 | error: (error) => Center(child: Text(error.toString())), 52 | loading: () => const Center(child: CircularProgressIndicator()), 53 | ); 54 | }, 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /packages/fl_query/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 17 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 18 | - platform: android 19 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 20 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 21 | - platform: ios 22 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 23 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 24 | - platform: linux 25 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 26 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 27 | - platform: macos 28 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 29 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 30 | - platform: web 31 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 32 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 33 | - platform: windows 34 | create_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 35 | base_revision: b06b8b2710955028a6b562f5aa6fe62941d6febf 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 9944297138845a94256f1cf37beb88ff9a8e811a 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 17 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 18 | - platform: android 19 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 20 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 21 | - platform: ios 22 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 23 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 24 | - platform: linux 25 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 26 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 27 | - platform: macos 28 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 29 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 30 | - platform: web 31 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 32 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 33 | - platform: windows 34 | create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 35 | base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /packages/fl_query/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/lib/pages/query.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:fl_query/fl_query.dart'; 4 | import 'package:fl_query_hooks/fl_query_hooks.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_hooks/flutter_hooks.dart'; 7 | 8 | class QueryPage extends HookWidget { 9 | const QueryPage({super.key}); 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | final value = Random().nextInt(200000); 14 | final query = useQuery( 15 | 'hello', 16 | () { 17 | return Future.delayed( 18 | const Duration(seconds: 6), () => 'Hello World! $value'); 19 | }, 20 | initial: 'Hello', 21 | jsonConfig: JsonConfig( 22 | fromJson: (json) => json['data'], 23 | toJson: (data) => {'data': data}, 24 | ), 25 | onData: (value) { 26 | debugPrint('onData: $value'); 27 | }, 28 | onError: (error) { 29 | debugPrint('onError: $error'); 30 | }, 31 | ); 32 | 33 | return Scaffold( 34 | appBar: AppBar( 35 | title: const Text('Query'), 36 | ), 37 | floatingActionButton: 38 | QueryListenable('hello', builder: (context, query) { 39 | if (query == null) { 40 | return const SizedBox(); 41 | } 42 | return FloatingActionButton( 43 | onPressed: () { 44 | query.refresh(); 45 | }, 46 | child: Text(query.data ?? 'No Data'), 47 | ); 48 | }), 49 | body: query.isFetching 50 | ? const Center( 51 | child: CircularProgressIndicator(), 52 | ) 53 | : query.hasError 54 | ? Center( 55 | child: Text(query.error.toString()), 56 | ) 57 | : Center( 58 | child: Text(query.data ?? "Unfortunately, there's no data"), 59 | ), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /packages/fl_query/example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/core/mixins/retryer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:async/async.dart'; 4 | import 'package:fl_query/src/collections/retry_config.dart'; 5 | import 'package:fl_query/src/core/client.dart'; 6 | import 'package:flutter/material.dart'; 7 | 8 | mixin Retryer { 9 | Future retryOperation( 10 | FutureOr Function() operation, { 11 | required RetryConfig config, 12 | required void Function(T?) onSuccessful, 13 | required void Function(E?) onFailed, 14 | }) async { 15 | for (int attempts = 0; attempts < config.maxRetries; attempts++) { 16 | final completer = Completer(); 17 | await Future.delayed( 18 | attempts == 0 ? Duration.zero : config.retryDelay, 19 | operation, 20 | ).then(completer.complete).catchError(completer.completeError); 21 | try { 22 | final result = await completer.future; 23 | onSuccessful(result); 24 | break; 25 | } catch (e, stack) { 26 | if (e is E?) { 27 | if (attempts == config.maxRetries - 1) { 28 | onFailed(e as E?); 29 | } 30 | } else { 31 | FlutterError.reportError( 32 | FlutterErrorDetails( 33 | exception: e, 34 | library: 'fl_query', 35 | context: ErrorDescription('retryOperation'), 36 | stack: stack, 37 | ), 38 | ); 39 | } 40 | if (!await QueryClient.connectivity.isConnected) { 41 | break; 42 | } 43 | } 44 | } 45 | } 46 | 47 | CancelableOperation cancellableRetryOperation( 48 | FutureOr Function() operation, { 49 | required RetryConfig config, 50 | required void Function(T?) onSuccessful, 51 | required void Function(E?) onFailed, 52 | }) { 53 | return CancelableOperation.fromFuture( 54 | retryOperation( 55 | operation, 56 | config: config, 57 | onSuccessful: onSuccessful, 58 | onFailed: onFailed, 59 | ), 60 | ); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/collections/jobs/mutation_job.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/src/collections/retry_config.dart'; 2 | 3 | typedef MutationJobFn = Future 4 | Function( 5 | VariablesType variables, 6 | ArgsType args, 7 | ); 8 | 9 | typedef MutationJobVariableFn 10 | = Future Function( 11 | String variableKey, 12 | VariablesType variables, 13 | ArgsType args, 14 | ); 15 | 16 | typedef MutationJobVariableKeyFn 18 | = MutationJob 19 | Function(String variable); 20 | 21 | class MutationJob { 22 | final MutationJobFn task; 23 | final String mutationKey; 24 | 25 | final RetryConfig? retryConfig; 26 | 27 | final List? refreshQueries; 28 | final List? refreshInfiniteQueries; 29 | 30 | const MutationJob({ 31 | required this.mutationKey, 32 | required this.task, 33 | this.retryConfig, 34 | this.refreshQueries, 35 | this.refreshInfiniteQueries, 36 | }); 37 | 38 | static MutationJobVariableKeyFn 40 | withVariableKey({ 42 | required String baseMutationKey, 43 | required MutationJobVariableFn task, 44 | RetryConfig? retryConfig, 45 | List? refreshQueries, 46 | List? refreshInfiniteQueries, 47 | }) { 48 | return (String variableKey) => MutationJob( 49 | mutationKey: "$baseMutationKey$variableKey", 50 | task: (variables, args) => task(variableKey, variables, args), 51 | retryConfig: retryConfig, 52 | refreshQueries: refreshQueries, 53 | refreshInfiniteQueries: refreshInfiniteQueries, 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/lib/src/use_query.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:fl_query/fl_query.dart'; 4 | import 'package:fl_query_hooks/src/use_query_client.dart'; 5 | import 'package:fl_query_hooks/src/utils/use_updater.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_hooks/flutter_hooks.dart'; 8 | 9 | Query useQuery( 10 | final String queryKey, 11 | final QueryFn queryFn, { 12 | final DataType? initial, 13 | final RetryConfig? retryConfig, 14 | final RefreshConfig? refreshConfig, 15 | final JsonConfig? jsonConfig, 16 | final ValueChanged? onData, 17 | final ValueChanged? onError, 18 | 19 | // hook specific 20 | final bool enabled = true, 21 | }) { 22 | final rebuild = useUpdater(); 23 | final client = useQueryClient(); 24 | final query = useMemoized>(() { 25 | final query = client.createQuery( 26 | queryKey, 27 | queryFn, 28 | initial: initial, 29 | jsonConfig: jsonConfig, 30 | refreshConfig: refreshConfig, 31 | retryConfig: retryConfig, 32 | ); 33 | return query; 34 | }, [queryKey]); 35 | 36 | useEffect(() { 37 | query.updateQueryFn(queryFn); 38 | return null; 39 | }, [queryFn, query]); 40 | 41 | useEffect(() { 42 | final removeListener = query.addListener(rebuild); 43 | if (enabled) { 44 | query.fetch(); 45 | } 46 | return removeListener; 47 | }, [query, enabled]); 48 | 49 | useEffect(() { 50 | StreamSubscription? dataSubscription; 51 | StreamSubscription? errorSubscription; 52 | 53 | if (onData != null) { 54 | dataSubscription = query.dataStream.listen(onData); 55 | } 56 | if (onError != null) { 57 | errorSubscription = query.errorStream.listen(onError); 58 | } 59 | 60 | return () { 61 | dataSubscription?.cancel(); 62 | errorSubscription?.cancel(); 63 | }; 64 | }, [onData, onError, query]); 65 | 66 | return query; 67 | } 68 | -------------------------------------------------------------------------------- /packages/fl_query/example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /packages/fl_query_hooks/example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /packages/fl_query/lib/src/collections/jobs/query_job.dart: -------------------------------------------------------------------------------- 1 | import 'package:fl_query/src/collections/json_config.dart'; 2 | import 'package:fl_query/src/collections/refresh_config.dart'; 3 | import 'package:fl_query/src/collections/retry_config.dart'; 4 | 5 | typedef QueryJobFn = Future Function( 6 | ArgsType args); 7 | typedef QueryJobVariableFn = Future Function( 8 | String variableKey, 9 | ArgsType args, 10 | ); 11 | 12 | typedef QueryJobVariableKeyFn 13 | = QueryJob Function(String variable); 14 | 15 | class QueryJob { 16 | final QueryJobFn task; 17 | final String queryKey; 18 | 19 | final DataType? initial; 20 | 21 | final RetryConfig? retryConfig; 22 | final RefreshConfig? refreshConfig; 23 | final JsonConfig? jsonConfig; 24 | 25 | // widget specific 26 | final bool enabled; 27 | 28 | const QueryJob({ 29 | required this.queryKey, 30 | required this.task, 31 | this.initial, 32 | this.retryConfig, 33 | this.refreshConfig, 34 | this.jsonConfig, 35 | this.enabled = true, 36 | }) : assert( 37 | (jsonConfig != null && enabled) || jsonConfig == null, 38 | 'jsonConfig is only supported when enabled is true', 39 | ); 40 | 41 | static QueryJobVariableKeyFn 42 | withVariableKey({ 43 | required String baseQueryKey, 44 | required QueryJobVariableFn task, 45 | DataType? initial, 46 | RetryConfig? retryConfig, 47 | RefreshConfig? refreshConfig, 48 | JsonConfig? jsonConfig, 49 | bool enabled = true, 50 | }) { 51 | return (String variableKey) => QueryJob( 52 | queryKey: "$baseQueryKey$variableKey", 53 | task: (args) => task(variableKey, args), 54 | initial: initial, 55 | retryConfig: retryConfig, 56 | refreshConfig: refreshConfig, 57 | jsonConfig: jsonConfig, 58 | enabled: enabled, 59 | ); 60 | } 61 | } 62 | --------------------------------------------------------------------------------