Questions tagged [flutter-futurebuilder]

For questions relating to Flutter's FutureBuilder class. Use this tag in combination with the general [flutter] tag. If your question applies to Flutter more generally, use the [flutter] tag only.

Reference:

667 questions
-1
votes
3 answers

How to add markers to a flutter google map after the map has been created and change the camera position?

I am new to Flutter and I have created a google map using the flutter_google_maps package. I have the following code in my parent widget, SizedBox( child: _showFindHouseModal ? FutureBuilder( future: _locationDataFuture, …
-1
votes
1 answer

While using FutureBuilder inside any interaction callback, its future method called twice

I am having a custom widget, where I have updated my list of data in the horizontal and vertical drag end callback. In that call back, I have returned and updated the data using the FutureBuilder. But the method returned from future event of…
-1
votes
1 answer

The argument type 'AsyncSnapshot' can't be assigned to the parameter type 'Map'

I had a factory method for converting json into an object which accepted Map json as argument from sqlite database like below factory Lecturer.fromJson(Map json)=>Lecturer( name:json['name'], email:…
-1
votes
1 answer

Filter ListView with FutureBuilder?

How can I upgrade this code into searching listview? I try with using two lists and using where keyword but it not worked. some problem with filling data into a list, then printing the list it always shows Instance of User class ListBuilder extends…
-1
votes
1 answer

Error: Class 'String' has no instance getter 'token'. I/flutter ( 3268): Receiver: "dc9e0de8fa2eaa917657e810db06aad2458e4f65"

I have been struggling with this problem for like two days. My social media app should save its state, when signed in so that when you leave the app and come back again it should start from the home page, not the sign in page. I have found that it…
Davrick
  • 301
  • 1
  • 4
  • 13
-1
votes
3 answers

FutureBuilder shows the loading indicator althought the result is cached

I'm facing an issue trying to use FutureBuilder with Provider and cache. The computation is done one time and then its cached. The code looks like this: FutureBuilder( future: model.calculateStats(chartType: getChartType()), builder:…
user10027134
-1
votes
2 answers

Flutter futurebuilder nested futures returning null

I am trying to work with different user roles and after logging in they should be directed to different pages however the futurebuilder I am trying to use to do so returns null. The element.data['role'] is correct and is being printed out before the…
eoghanC01
  • 41
  • 4
-1
votes
1 answer

Asynchronous function returns only null (Flutter)

I'm new to Flutter and trying my best to write a function "getUserPictures" which should return a List of Pictures which are either saved locally on the device or fetched from Google Firebase. The plan is to use that returned Future from this…
-1
votes
2 answers

The method '[]' was called on null. Receiver: null Tried calling: [](0) ! What am I doing Wrong here?

════════ Exception caught by widgets library ═══════════════════════════════════ The following NoSuchMethodError was thrown building: The method '[]' was called on null. Receiver: null Tried calling: main.dart void main() { …
Nikash Deka
  • 427
  • 2
  • 4
  • 15
-1
votes
1 answer

Scrolling ability in listveiw builder

I am trying to build a list using future builder in flutter, which i succeeded in. but now the list is not scrolling, when we scroll through little space around sides (dark complexion shown in image), it scrolls and show full list bul it does not…
-1
votes
2 answers

Flutter FutureBuilder() causing null exception for a second

class MyClass extends StatelessWidget { @override Widget build(BuildContext context) { var _userSnapshot; List myContactsList; return StreamProvider.value( value: DatabaseService("").myUser, …
-1
votes
1 answer

Flutter: FutureBuilder no list shown

I have a list that comes in the form of future Future> _future; List showList = []; String showCode; Future> getCode() async { final show = await SharedPreferences.getInstance(); setState(() { …
kimSoo
  • 283
  • 1
  • 4
  • 10
-2
votes
1 answer

The operator '[]' isn't defined for the type 'Object'. Try defining the operator '[]'. Why I am getting this error in my listview builder?

before puting "!", I was getting this error: The method '[]' can't be unconditionally invoked because the receiver can be 'null'. This is my code: FutureBuilder( future: getCity(), builder: ((context, snapshot)…
-2
votes
1 answer

How to handle async load of data to display in flutter

what I'm trying to achieve here is a functionality that firstly tries to load the data stored in local storage (if any) and then fetch the new data from the API and displays and stores them in local storage. I'm thinking of two ways to do that but…
-2
votes
2 answers

A value of type 'List?' can't be assigned to a variable of type 'List' Flutter Retrofit

so am trying to use the Retrofit package to auto generate my Rest Api Get request to return a listView of a url, name and id. This is my code for the API request. part 'api_request.g.dart'; @RestApi(baseUrl:…
1 2 3
44
45