Closed agavrel closed 4 years ago
@agavrel: could you please add more details to this? I'm not sure what StreamBuilder
you are referring to...
Instead of
@override
Widget build(BuildContext context) {
return FutureBuilder<List<Data>>(
future: _get_data(),
builder: (context, snapshot) {
(...)
use:
@override
Widget build(BuildContext context) {
return StreamBuilder<List<Data>>(
stream: _get_data(),
builder: (context, snapshot) {
(...)
In order to get data as a stream
I am not sure how you're getting your data from postgres to the app, but I'm sure using Stream.fromFuture(_get_data()) can return a stream from a future
Is there a way to use StreamBuilder with this Postgresql package ? (return a Stream instead of Future in order to feed results every 20 rows for example)