feat: new widget query listable builder

This commit is contained in:
Kingkor Roy Tirtho
2023-02-16 13:05:23 +06:00
parent a85434a4db
commit 975f9eafe1
4 changed files with 108 additions and 0 deletions
+12
View File
@@ -21,6 +21,18 @@ class MainApp extends StatelessWidget {
final value = Random().nextInt(200000);
return MaterialApp(
home: Scaffold(
floatingActionButton: QueryListenable<String, dynamic, String>(
const ValueKey('hello'), builder: (context, query) {
if (query == null) {
return const SizedBox();
}
return FloatingActionButton(
onPressed: () {
query.refresh();
},
child: Text(query.data ?? 'No Data'),
);
}),
body: QueryBuilder<String, dynamic, String>(
const ValueKey('hello'),
() {