Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
83 views

I've been trying to solve this problem for a couple of days now, but to no avail. I have a simple app with three tabs: Deliveries Page: Has a DropdownMenuFormField (basically just a DropdownMenu with ...
Antonio S.'s user avatar
0 votes
1 answer
148 views

I'm trying to use Dart isolates to offload JSON parsing in my Flutter package. However, when I run the following function, I get an error about an "unsendable object" in isolate messages. ...
Jonathan Getachew's user avatar
1 vote
1 answer
54 views

The following code compiles: import 'dart:async'; void main() { final streamNullable = StreamController<int?>(); final streamNotNullable = StreamController<int>(); streamNullable....
ph3rin's user avatar
  • 4,948
1 vote
1 answer
77 views

extension FutureIterable<T>.wait does not work properly from the documentation: /// Similar to [Future.wait], but reports errors using a /// [ParallelWaitError], which allows the caller to /// ...
Fractale's user avatar
  • 1,704
1 vote
1 answer
144 views

Streams are meant to handle asynchronous flow of data which keeps on emitting data, but I want to understand how these streams are handled by event loop and where do they exist in main memory. In a ...
pranay avvaru's user avatar
1 vote
1 answer
198 views

I'm using Flutter with flutter_bloc, and I'm in front of the following scenario. Scenario I have a Cubit with two methods beings loadFoo and loadBar: class UserCubit extends Cubit<UserState> { ...
SyncroIT's user avatar
  • 1,578
2 votes
1 answer
131 views

I have an async method which in turn calls some other async methods which can throw errors. The problem is that the try-catch only handles the first exception thrown. I'm assuming that once a function ...
Alvaro Mateo's user avatar
0 votes
0 answers
59 views

I'm trying to make a Stream modifier function which adds 'latency' to all items going through it: extension SE<T> on Stream<T> { Stream<T> delayed(Duration latency) { return ...
dwb's user avatar
  • 2,694
0 votes
0 answers
101 views

I'm working with dart as part of a hobby project and I found something kind of strange, namely the StreamController class as part of the Dart:async library returns different streams each time you call ...
Avynn's user avatar
  • 1
1 vote
1 answer
678 views

I have two Future functions which I run asynchronously: List<Future<bool>> jobs = []; jobs.add(asyncFunction1()); jobs.add(asyncFunction2()); jobsResults = await Future.wait(jobs); If ...
Max's user avatar
  • 93
0 votes
1 answer
90 views

I'm running this code: import 'dart:async'; void main() { final c = Future.value(); // Other constructors and `Completer.future` all yield same results. print(c == sync(c)); print(c == aSync(...
BobLoblaw's user avatar
1 vote
1 answer
141 views

In Dart is there any way to capture all Future's created inside a Zone? Currently, I'm forced to manually capture them all, but this seems prone to forgetting to do it. So I want to automate this if ...
Matthiee's user avatar
  • 493
0 votes
1 answer
96 views

I am trying to use a FutureBuilder with a ListView to display a list of documents from a Firestore db. I am getting errors saying the future: is not defined and the builder: is not defined. I also get ...
LostTexan's user avatar
  • 921
0 votes
1 answer
148 views

I would like to create a matcher that takes async or non-async callback, sets up some listeners, invokes callback, verifies listeners received expected events, and then clean up listeners. However, I ...
polina-c's user avatar
  • 7,205
1 vote
2 answers
1k views

I've just stumbled upon a github repo containing an example of flutter application for google_sign_in package. I'm confused about a particular usage of unawaited used inside the example : Future<...
Calvin Alfredo's user avatar
2 votes
1 answer
3k views

I'm trying to write a test for an app which isn't well-implemented, and has an exception that is thrown inside a Timer callback. I'd like to ignore that exception inside my integration test, because I'...
Bartek Pacia's user avatar
  • 1,806
1 vote
2 answers
1k views

How to fix this kind of errors when using then? void handleSubmitWrapper() { final future = handleSubmit(); future.then(context.loaderOverlay.hide()); // error } Future<void> handleSubmit() ...
rozerro's user avatar
  • 7,376
1 vote
1 answer
312 views

While using shared prefs plugin it's common to explore code like below void saveList() async { final prefs = await SharedPreferences.getInstance(); prefs.setStringList("listKey", aList); ...
rozerro's user avatar
  • 7,376
0 votes
1 answer
242 views

I am trying to execute a function after a dialog is dismissed/popped. I read this article How to run code after showDialog is dismissed in Flutter? and tried to do it as recommended but it wouldn't ...
Yuki's user avatar
  • 325
0 votes
2 answers
285 views

I would like to base on a future bool value, to set different icons pass back to a data card inside a list, I tried .then or FutureBuilder, but still not successful. Scaffold: child: ListView.builder( ...
Tony Lam's user avatar
  • 249
16 votes
2 answers
4k views

Let's say in a Flutter app we want to catch any uncaught exceptions/errors at the top level, so we do this as per the docs: main() { // All uncaught errors thrown from synchronous code blocks ...
Nerdy Bunz's user avatar
  • 7,743
1 vote
0 answers
153 views

I have a class that contains a stream that listens for objects to be created. class Conversation { // variables for live query late QueryBuilder<ParseObject> message_live_query_; final ...
OBurnsy22's user avatar
0 votes
1 answer
584 views

I'm trying to understand how to use streams to notify listeners when there is a new addition to a list, below I wrote an example program that sums up what I'm trying to accomplish. Everytime there is ...
OBurnsy22's user avatar
0 votes
1 answer
695 views

I would like to create a StatefulWidget which I'll use all over the app for listening streams of different types. Since I try to keep all the widgets Stateless I wanted to extract this functionality. ...
Karzel's user avatar
  • 1,538
1 vote
0 answers
24 views

My Flutter app is executing the code inside the .then() function after everything is finished. I thought that this function was used to wait for the code to be executed. Am I understanding something ...
JAgüero's user avatar
  • 716
-1 votes
1 answer
61 views

void main() async { check(); print('end'); } Future check() async { var version = lookUpVersion(); print(version); } int lookUpVersion() { return 12; } void main() async { check(); ...
illust's user avatar
  • 1
0 votes
1 answer
71 views

I have a class like below & method readJson which returns Future<Map<String, dynamic>> and in constructor TestRemoteConfigManager(){}, I want to assign the returned value to testValues ...
Jagadeesh's user avatar
  • 408
1 vote
1 answer
772 views

I have a screen that loads shopping cart items in a ListView.builder: Expanded( child: RefreshIndicator( onRefresh: refresh, child: ...
mvasco's user avatar
  • 5,131
3 votes
2 answers
855 views

Building an app with Flutter and Riverpod, using a lot of: ref.watch(someProvider).when(data: (someData){ // render layout with data }, error: (err, stack) { // do stuff with error }, loading: ()...
Majoren's user avatar
  • 1,053
0 votes
1 answer
141 views

I currently have a class that stores images after fetching images asynchronously over GRPC. There is an issue with the handling of events. The problem can be shown here: import 'dart:async'; main() { ...
George Gayton's user avatar
0 votes
1 answer
236 views

I am trying to check whether a boolean value in Firestore is true for a list of documents. On trying to compile the code below I keep on getting the error The argument type 'Future<bool> ...
Stereo's user avatar
  • 1,223
0 votes
1 answer
299 views

How can I correct this code? That might have sparked the need to win another solution. enter image description here This result is only after a hot reload, and at the first start it is empty. class ...
Nicola Bogolyub Frutorian's user avatar
0 votes
1 answer
1k views

I am working on a chat app using Flutter and Firebase. I am new to Dart and so got stuck when I wanted to create a function which fetches (using await) a particular document from one collection (...
Ali99's user avatar
  • 23
0 votes
0 answers
81 views

Can I have multiple asynchronous operations that call controller.add(myEvent) on a single broadcast StreamController? In other words, can I have multiple producers that emit stream events on the same ...
ig-dev's user avatar
  • 529
0 votes
3 answers
232 views

I'm trying to understand proper execution order of async functions in Dart. Here is a code that puzzles me: void main() async { print(1); f1(); print(3); } void f1() async { print(2); } ...
Ralfeus's user avatar
  • 825
0 votes
0 answers
61 views

I'm struggling with testing the piece of functionality that is highly asynchronous . Overal idea is following: function A puts data to local storage function B monitors local storage and syncs ...
Ralfeus's user avatar
  • 825
2 votes
1 answer
9k views

In Kotlin there is Flow.flatMapLatest() function that: Returns a flow that switches to a new flow produced by transform function every time the original flow emits a value. When the original flow ...
Sergio's user avatar
  • 31.1k
0 votes
1 answer
401 views

Basically, I'm trying to make an app, that on one of the screens - the content of a listview will be updated by choosing one of the options listed in the toggleButtons (One shows only upcoming events ...
Shon22's user avatar
  • 101
0 votes
3 answers
2k views

I am using TextFormField in my code and I have added the suffix icon inside it. I want that the value of textformfield will be assigned to the variable name "city" and the value of the ...
user avatar
0 votes
3 answers
120 views

I have created a demo for learning async and await Here it is happening that a statement is executed before await function.. According to me output should be A second Z First but its giving output ...
Irfan Ganatra's user avatar
3 votes
2 answers
5k views

Is it possible to perform async steps with Timer instead of Future.delayed? The main reason is the availability of cancel() method in the Timer class, which allows me to cancel a running timer when a ...
Miguel de Sousa's user avatar
0 votes
2 answers
386 views

I have a problem with flutter printing out the name and rendering Widget name after running the application class MyApp extends StatefulWidget { const MyApp({Key? key}) : super(key: key); @...
lemu's user avatar
  • 64
0 votes
1 answer
402 views

So I've read the docs and this example in particular: runZoned(() { HttpServer.bind('0.0.0.0', port).then((server) { server.listen(staticFiles.serveRequest); }); }, onError: (e, stackTrace) =&...
Guy's user avatar
  • 155
0 votes
1 answer
907 views

So basically Iam working with the network_info_plus package to read the current connected Wifiname of the device. I want to use a FutureBuilder to get the future from await info.getWifiName();. The ...
WhatIsLove's user avatar
1 vote
2 answers
3k views

I need to do the widget with Flutter like "N users watch on it now", where N comes from the backend, and I need to update it every 5 seconds if the widget is visible. I tried a few ...
anber's user avatar
  • 3,685
1 vote
1 answer
722 views

So I'm trying to create a qr scanner feature, I manage to do all the function and functionality for the code, but when my code try to fetch the data the widget build run first resulting some data is ...
Kim San's user avatar
  • 855
1 vote
4 answers
2k views

I want to see a the value of a counter in a flutter UI when the counter is updated asynchronously. Staring from the sample flutter project, I would expect the below would make it, but only the final ...
Ste's user avatar
  • 434
0 votes
1 answer
1k views

I'm trying to use an Isolate that will send a request, so as not to block the main thread/isolate. After using so, the function of the spawned Isolate is called only once, on the initial passed ...
David Gomes's user avatar
0 votes
1 answer
574 views

Function: navigateToAudioScreen(file, aPlay) async { // await Future.delayed(Duration(seconds: 3)); WidgetsBinding.instance!.addPostFrameCallback((_) async { await Future.delayed(...
Prannesh Sathyamoorthy's user avatar
2 votes
1 answer
2k views

I am learning Flutter and Dart currently. Now I want to read and write files to memory. I have code for reading and writing. Now I want tests for that. Here is where I run into problems. I always get: ...
El_Loco's user avatar
  • 1,916

1
2 3 4 5
7