hello, just want to know how to config this correctly, hope that is not bug...
got this file job
import 'package:fl_query/fl_query.dart';
import 'dart:convert';
import 'package:http/http.dart' as http;
final exampleQueryJob = QueryJob.withVariableKey<Map, void>(
keepPreviousData: true,
task: (queryKey, externalData) async {
final res = await http.get(Uri(
scheme: 'https',
host: 'jsonplaceholder.typicode.com',
path: 'todos/${getVariable(queryKey)}',
queryParameters: {}));
return jsonDecode(res.body);
},
);
2. then after come to specific page, lets call its a news page (news.dart), the data is loaded and show the data which i call from
```dart
QueryBuilder<Map, void>(
job: exampleQueryJob(id.toString()),
externalData: null,
builder: (context, query) {
if (!query.hasData || query.isLoading) {
return const CircularProgressIndicator();
} else if (query.isSuccess) {
return Text(query.data!['title'],
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w700,
color: Colors.red,
));
} else {
return const Text('error...');
}
},
),
then, the issue that i want to ask about is when, i left the page and re clicking the widget that made me accessing the news.dart again, the fetch process just like stuck and even not showing the CircularProgressIndicator at all; the terminal not displaying any error too, this just like query job is not triggered, the api is not consumed, and the response is not provided anymore...
I already try this again, and after the second access the page, sometime it will stuck (mostly) and sometime (very rare) is show the data.
since, i was only learn flutter a month ago, i don't know if my current project probably causing the errors or not... the is the folder structure of mine:
libs
/components -> all components here
/query_job -> my query job only one here
{pages}.dart -> my pages here
any my pages just like this:
has main.dart and additional had homescreen class as homepage
has {pages_name} as class as statelesswidget and no material app and or no access of QueryBowlScope / QueryBowl directly (since i only put on main.dart file only)
hello, just want to know how to config this correctly, hope that is not bug...
final exampleQueryJob = QueryJob.withVariableKey<Map, void>( keepPreviousData: true, task: (queryKey, externalData) async { final res = await http.get(Uri( scheme: 'https', host: 'jsonplaceholder.typicode.com', path: 'todos/${getVariable(queryKey)}', queryParameters: {})); return jsonDecode(res.body); }, );
then, the issue that i want to ask about is when, i left the page and re clicking the widget that made me accessing the news.dart again, the fetch process just like stuck and even not showing the CircularProgressIndicator at all; the terminal not displaying any error too, this just like query job is not triggered, the api is not consumed, and the response is not provided anymore...
I already try this again, and after the second access the page, sometime it will stuck (mostly) and sometime (very rare) is show the data.
since, i was only learn flutter a month ago, i don't know if my current project probably causing the errors or not... the is the folder structure of mine:
any my pages just like this: