Dart Futures - Flutter in Focus
HTML-код
- Опубликовано: 20 июн 2019
- This is the second video in the Flutter in Focus series on asynchronous coding in Dart. In this episode, learn everything about Future objects, Dart’s most basic API for async, including how to handle data, catch errors, and put futures to work building Flutter widgets with FutureBuilder.
For more deep dives on things like Stateless and Stateful widgets, Flutter on iOS, and other advanced topics, check out the other episodes of Flutter in Focus.
Asynchronous programming: futures & async-await → goo.gle/2XJLPSd
Isolate Class → goo.gle/2F8Mg1g
Flutter in Focus Playlist → goo.gle/FlutterInFocus
Get started with Flutter → flutter.dev
Try a Flutter codelab → goo.gl/d3fHPo
Join the conversation → goo.gl/68oUnb
Subscribe to the Flutter channel → goo.gle/FlutterYT
#dart #darttopic
The quality of these videos is astounding. Please keep 'em coming!
Gift boxes dont contain errors bro! That would be a sad day
If your gift box comes with a pair of socks, it's definitely an error
It could have arrived by Australian Post and most likely broken.
It's like receiving a ticking box. You don't know if it's a cool new clock or a bomb.
nice
Maybe gift box contained Galaxy Note 7
Dude, you just won the Nobel prize for Simplicity! I struggled to understand how Future works when I started to use Firebase; now, it is all clear. I'm in love with Dart & Flutter.
This portrayal of the Future as a superposition of result and error was approved by Schrödinger and his cat.
And wasn't.
this comment is way underrated i guess Schrodinger isnt that well known :/
@@zewafff it also isn't underrated
Loved this video, thank you for explaining things in such a straightforward way.
Man you articulated that really well, Thank you so much for a great video!
Great video, simply put but with sufficient detail for beginner devs!
What a great team behind the flutter, love it ❤
i was learning flutter 1 years ago, and i falling in love with this framework, make an simple app for school, and now i am make some games with flutter too. i create bunch of png sequence from after effect, glue it into single image and paint it with drawRrect, this future delayed come in handy when display spesific size frame from image, i test it with flutter inspector in real device, some times get 60 fps sometimes not even with bloc state management plugin. struggle with performance problem, still try to learn :)
Love these series !
Clean and crisp slides and diagram.
Thank you! Very helpful and informative!
I learned Future so good , thanks
Thanks for the explanation ! Great job !!!!
Any chance we can get a comprehensive flutter team created course with multiple little app builds to learn the concepts and finally a large app putting everything together?
This could be awesome
Yes. Its available in appbrewery.co at just 10 bucks
There are already a lot of Cookbooks, Codelabs, Tutorials and Samples on the flutter.dev page. Have a look
You can check out course by Angela yu on Udemy. It's exactly how you want .
Agree with all who mentioned app brewery. Angela is an excellent instructor. I am more than 70% done with the course and boy, it's awesome 👍
Awesome explanation !!!
Great explanation thank you
Best way to think about async future api!!!
Loved it !
Brilliant video !
Great! Thank you!
so clear!!!
merci pour le tuto très bonne information cool :)
great, thank you
This is quite similar with promises in ES6, JavaScript.
And the async/await is quite similar with async/await in ES7, JavaScript.
Thanks🙏
Flutter is Future !
Thank you ^^
Thanks for watching, Neil! If you enjoyed this, be sure to check out the "Flutter in Focus Playlist" here:
goo.gle/FlutterInFocus
Happy Fluttering 🙌
Your videos are great! But please improve documentations by adding imporant notes so that we can easily find out why that error happens. Now only way to find out the error/ good practice is to checkout the core code using the code editor features.
For example TextFormField does not accept any other type values other than strings. I had spent lot of time to figure out that even though it is a small fix.
2:45 my face when he said gifts contain errors ...but it's a gift thou...
Perfect 👍
Can ( provider + future ) + widget be used in the same way as set state , with the only difference of rendering that widget instead of whole screen?
Thank you
I read a Json file from storage, converted to map and then update into global configuration
For me the widget gets updated with old map data while there is a delay in reading file content
If I put the reading global configuration inside future.then( ), it does not work and gives some exception
I don't want to use bloc pattern for small data
Any clue?
Also shared preferences does not seem to work
I don't see a cancel/dispose method in the API docs. What happens if user has moved on to some other task and we don't need the future data we requested? Related to this - if widgets don't cancel long-running futures, and move on to new screens, are we leaking memory? I am from an Android background, and essentially trying to understand if future callbacks hold weak references to the widgets.
What would be the most idiomatic way to synchronize Futures. For example I may have to wait on multiple Futures until I can start processing the data.
well done.
Is there a better way to nest FutureBuilders? I need 3 different resources for 3 different widgets on the same screen? Something equivalent of MultiProviders would be really great
very nice
I love flutter
Is the syntax for the second argument for the delayed method wrong? I can't find it anywhere 5:00
It would be nice of you to show how to handle multiple futures without waiting one another
Easy to follow explanation. Why wasn't async/await included? I am unclear after watching this video when/whether to use then vs. await....?
Async/await are covered in the fourth video in this series. It's currently in post-production, but should be released in a week or two!
i love it
Good explanation but I wonder about that method supplying a Future to the FutureBuilder; won't that Future be created on every call to build()? The docs recommend creating that future around initState instead
Oke thank you
Ótima explicação, só que diferente disso eu uso o Connection.state que faz os devidos retornos de acordo com o a resposta.
hardest part to understand and grasp
The Event Loop described badly, please clarify how it works. If it works like V8 then please add stack call, queue, and tell about external threads for API.
If I read something from disk, is that handled by a different thread?
Lol. This series is a safe space.
Gift boxes are awesome
What's the difference between catchError and onError callbacks? both are triggered in case of errors, so why are there two of them?
Can anyone tell me what is the datatype of myFuture at 3:27. final means it can't be changed, but what is the datatype of myFuture ??
This channel could potentially make non coders jump in directly as a mobile application devs❤️❤️.
Uhh sorry cross platform 😁
感谢字幕制作人员
Is this like android handler? Well, handler begins when the app starts and not delayed the first time if its a loop
Can anybody tell me exactly what coding color theme that was?????????????????????????????????????????
Hello, I'm beginner in Flutter.
I want call multiple APIs in single screen with Future Builder, So how can I do this.
Can you make some tutorials which handle Share Extension in iOS? Currently, I want to share some files with my application via Share Extension, but I do not know how to pass data from Share Extension to my app.
Looks like some folks are working on it: github.com/flutter/flutter/issues/16712
nice
is there a dart equivalent to the javascript "resolve" and "reject" methods passed to a promise handler?
function getUserInput() {
return new Promise(resolve => {
setInputEventHandler(data => {
resolve(data);
});
});
}
Because futures in dart seem to just be based on synchronous code that returns a value... but that doesn't really make sense?
I’ve figured it out! A Completer from the dart:async is *exactly* what i want, imo the usage isn’t the most intuitive at first, BUT IT’S THE EXACT THING I WANT! api.dart.dev/stable/1.21.1/dart-async/Completer-class.html
🎉
Does Future create new thread
The async/await feature has been copied from C# and it's so powerful!
I thought it's from JS. Thanks for the info.
Yep. The concepts behind async/await have been around for a long time, but C# is generally credited with introducing those particular keywords and the way they work. I was a professional C# coder at the time, so I've been able to write with them for a while!
Make a video on HOW TO MANAGE STATE???
ruclips.net/video/d_m5csmrf7I/видео.html
I think catchError and whenComplete are strange. just catch and finally are simple!
but catch and finally are keywords !
2:41 I know what you said, but ouch 😂
After watching this video, I learned that there's an alternative way to pronounce json.
i pronounce it like the name Jason
How's the future status named "uncompleted"?
I am getting "Flutter intent redirection " issue as i upload the app on playstore, and they have given me until 21st December 2020 to clear this issue. if not they'll remove my app
Please help me
And scopes and closures work like in javascript?
String url = '';
http.get(url).then((resp) {print(resp); print(url)} )
I'm not a JS expert by any means, but you can definitely close over a variable like that when creating a callback for a Future in Dart.
But seriously though, why we don't have Promise.delayed in JavaScript.
Because you can implement it yourself wit setTimeout
Google announced big plans for Dart and was about to replace JS with it but couldn't do it. They dumped it in midway despite being superior than JS. Why they are sticking with Dart now!?
What is the name of the host? I want to follow him on Twitter!
Am I the only one who thought the gift example was funny AF?
Where is Emily Fortuna??? :(
She runs our whole channel now, so her influence is everywhere. :)
bel homme
Future: schrodingers giftbox
this thing kinda sucks lol. i'm trying to filter a stream from firestore by userID (i have objects that saved wich user created them)
been trying for hours, still nothing
my latest attempt
child: StreamBuilder( stream: Firestore.instance.collection('properties').where('uid', isEqualTo: getUserId()).snapshots(), ......
getUserId() async {
String userId;
await _authService.getUserId().then((value) => userId = value);
return userId;
}
does not work
I dropped mobile development...
I think PWA will terminate mobile development.... it gives you notifications, hardware controller and operates offline... you build it once and it will work all over ...
if you don't think so , please tell us why?
PWA can't really replace native apps. Native apps give you a superior experience while PWA is getting better and better but it can't replace native apps. Also all of the apps can't be PWA. However I would love it if native apps can be made irrelevant, windows would be back as mobile OS but this time as WCOS.
what is PWA? its like build apps using html and css? cuz i hate css also css and flexbox is harder than flutter web
How to cancel (interrupt, etc) an uncompleted future?
future dart is a promise in js world
Release videos faster!;
Why not just name them: then, catch, finally?
haaaaa.
0 likes? Am I on RUclips?
I think Future API lacks readability.