Testing, JSON serialization, and immutables (The Boring Flutter Development Show, Ep. 2)
HTML-код
- Опубликовано: 5 авг 2024
- In this episode, Andrew and Filip address a bug from the last episode that a user mentioned in the comments.
Then, they continue to develop with Flutter and cover parsing Json, using built_value (Dart’s open source package for immutable object models), and widget testing in an emulator.
Let us know your thoughts and requests for future episodes in the comments below or on Twitter using #BoringShow.
Watch more episodes of the boring show here → bit.ly/BoringShow
Get started with Flutter → flutter.io
Try a Flutter codelab → goo.gl/d3fHPo
Join the conversation → goo.gl/68oUnb
Subscribe to the Google Developers channel → goo.gl/mQyv5L Наука
Loved how Filip did the noise, and then said "it's not part of flutter, Yet" at 12:38
Loving the show! Eagerly waiting for the next episode! The pace of the video is perfect and the way you guys are working is exactly how a normal developer works in day to day life, breaking things and learning while fixing those things. Excited to see you complete the built_value portion and move on to fetching data from network. I hope you guys will cover widget testing when a server call is involved and how to use HttpOverrides. Thanks again for doing this show, it is really helpful for new flutter developers!
Its been 5-6 months from the last Boring show. Please release at least 20-30 every year or more, if you are generous, but anyways, great work by the Flutter Team
I like the scene that Andrew introduce the event loop model that flutter use and they write code start with a test, it is just a great thing to see how top coder code .
Was checking the channel constantly waiting for the episode, love the show and love the channel in general, great help for a new dev like me. Thanks guys! Can't wait for episode 3!
Thank you guys, it's great that you're hearing comments, moving towards more advanced topics and not trying to make tutorials.
The only thing that remains is, please do it more often!
We're planning to. The first was just a test to see if the format was useful for people, but we're geared up to make these a regular thing now. :)
It is, actually now that you mention the format, I love the interaction between you two and how it is fun but not over the top like a lot of other videos on this channel.
They call it boring, but for me that's the most exciting thing I ever watched on youtube! The moment with debugging the weird test 47:30 was just utterly absorbing! And you know, this whisper "what are we missing?" around that timecode, I can imagine that to be in a movie trailer for "The Boring Show" with dramatic music and building up atmosphere!
I had forgotten about this show when you appeared in my subscription list. Took me by surprise to hear my name as a student is asked suddenly by the teacher as the class starts. Luckily I had no homework to do. I am satisfied with the answer but still my mind is unsettled because I don't know how the rendering engine is working in Flutter. It is reacting but how reacts?
I like to see you both in all kinds of problems and how you react : confused debugger, conflicts in the package manager, in reading the prospect of built_values. It's fun.
Thank you so much for doing this show! Please keep on going!
Loving the show! Loving you guys! Loving the taking style and the coding - debugging content, it was so real.
Great job Team, it's really enjoyable and the pace is perfect, got to learn a lot from this and the previous episode.
Little late to the show. Loved the show. Enjoyed and grasping concepts of Flutter... Kudos to the team :) :)
I think the format is really great and as a beginner in Flutter/Dart programming I like the detail you get into. If anything, I would appreciate more explanation but understand that there may be others who want less. Personally, I would also appreciate a few more words up front on what you are trying to do and why you have adopted the approach you have. Having said that, I could watch you two all day and I am sure my programming skills would improve markedly - not to mention my coffee drinking capacity!
Guys, these are awesome! Please do some serious state management with Built Value + Built Redux! You can give us a 2-hour show if you want. I'm certain most people who follow you have done a lot of basic leg-work in Flutter already. Keep breaking things and coding the way you do!
Watching this after the null safety. You guys are fun to watch and informative.
Hahah i wasnt watching it because of the “boring” title but now i gave it a chance and it is actually pretty good! Cool keep it going!
Thank you! It wasn't boring at all! I was chilling with you and learning something new!
Keep the episode going guys, we are loving the Boooring show..... If you can add
Awesome show! Please upload more like this.
thank you for doing this. Love to know more about flutter's inner architecture.
Greetings from the Future, folks! With Dart 2, you can decode that json String with one line!
List parseTopStories(String json) => (jsonDecode(json) as List).cast();
how is that more efficient? if it is the case. Written human-readable code is really important. From the original code a small improvement could be, to not copy the "parsed list" to a new "list of ID" but instead just return a spread like this `return [...parsed]`
We need more of these videos.
I Love this Series. Please make more videos.
These video series are really helpful!
Another great episode, though I did find myself shouting at my screen at about 50mins, "You're trying to watch parsed before that line has been executed! Step over it!" 😂
Thanks for this videos! They are really helpful to start in the flutter world :)
i Love it really thank you guys, i am learning Flutter and i find this very useful for me
Loved it! Examples for (de-) serialization for Lists and a List of objects would also be great! :D
I think this is hilarious show. You guys doing great. I learn a lot from this show.
Start watching the whole show from the very beginning in 2022... anyone? And the stuff covered in the show still relatable 4 years later.
And I think my new year's resolution is to binge-watch this show more instead of the soap opera😅
Yea. Kinda weird though seeing this not being null safe. 46:05 The factory is nullable, yet the Article object (l. 38) is not
Watching it very late but loving it and getting to know things which I cannot through a course or tutorials.
You guys are awesome 😁
i was waiting for part 2
thank you!
Which one is part 1?
ruclips.net/video/yr8F2S3Amas/видео.html
Ibrahim Shaglil Thanks
Very helpful
keep going :)
Didn't know I love boring stuff like this!
More of this plz🐱
Can you guys do some more explanation about Futures and async and await type things in Flutter?
Yes! We're thinking of finishing up built_value and then starting on networking in the next one.
49:00 My suggestion is that you added a breakpoint while debug mode was running.
White label product.
Currently have native iOS and android apps.
For each of our clients, we have an iOS scheme, and an android module.
The architecture is very simple, and the only differences from client to client are some configurations (colour scheme, icon, app name, bundle identifiers) and the firebase project config file. The modules and schemes all have a common code base that has all the pages, business logic etc.
Was wondering if achieving this kind of architecture would be simple in Flutter
Great show!
Very simple to do this with flutter, you can actually make an app and add theme functionality to it, for scheme, and make seperate directions for icons, or add icons based on the client/user, let the client choose their app name atc..
Props for making beeps.
0:00 Bug fix
5:30 Testing
16:40 JSON Parsing
24:45 Deserialising a list
37:00 Deserialising an object
50:00 Source generation
53:44 Built value
59:53: Solving flutter dependency issues like a pro
Tx
Nice video
PLEEEASE Keep doing it!
It's great show.
Nice one
Thank you for this lecture ,i have a a question and i searched about it and i didn’t get an answer the question is how to make json encode/decode for datatype like timeofday
#theBoringShow
really love the show
so where can i find the source code of this show ?
i have a problem .i did exactly what you did in this video but i got an Error: Not found: 'dart:ui' why did it happen?and how can i fix it?
hilarious and decent tutorial
please continue your videos
I love Dart !
For json de/serialization json_serializable package is a must have !
Would be nice to have tips and tricks and good practice on how to share codebase between AngularDart(5) & Flutter.
Thank
Hey I am hoping to know the advantages of using json_serializable vs built_value? I tried a lazy google search and found no real good explanation and am currently too lazy to try both. Hope you can give light. Thanks in advance!
I have never used built_value so my answer may not be accurate, but in my understanding is that built_value is a full serialization library, json_serializable is meant only for json serialization/deserialisation (ie restful api). Also, it (looks) simpler to implement, you just need to define your class and add the annotation @JsonSerializable() to it.
Well I am newbie in flutter. I created json_parsing.g.dart class with build_runner but on it doesn't update with change in json_parsing.dart. What could be the reason?
Flutter does tree shaking to remove unused code parts from project and libraries. Which is against reflection because it expects everything in the code to be there at runtime. I read this somewhere as the reason to exclude mirror library from flutter.
And these episodes are nice. I would like to hear about architecturing a really huge app. I couldn't find any proper way of doing this. There were couple of articles but they are not practical and had too much boilerplate code. So I designed one architecture by myself. I wrote couple of source generators for that. It works but feels a bit hacky. I wonder if you guys have any thoughts about this?
(limited) reflection in flutter is now available via github.com/dart-lang/reflectable
it slowly grows on you :)
There's no reflection in Flutter because of the 60fps goal of the Framework. Reflection can be done AFAIK in any platform, even c++ does it in native code.
I got completely lost from source gen and built value, Although I have opened bunch of channels to help me out but as it might have matured a lot, would love to see a Boring show video on it.
it is nice to test on the device
I am getting Error: Method not found: 'BuiltValueSerializer'
What is the point of having a factory constructor if we also have a regular constructor? is that sort of like a static class method? Loving the show, btw
David Anaya ,I think it can return null,regular can not
Please test on Android One (1st Gen) devices. Those are low end/budget phones but quite powerful (Quad core/1G ram). On Shrine, scrolling is jerky (it has images), but scrolling on Contact Profile is fine (text only). On Studies> Animation, it really is laggy. Everything else is quite performant though. Btw, tested on Flutter Gallery from Play Store and release buld from /example from master.
At the point in time you hit break point the code has not run yet. Just afterwards. That's why you just see the watcher value after the debug step.
How to handle a case where sometimes I can get a field in json and sometimes not. Like this -
{"id":"89", "name":"Flutter"} and sometimes like -
{"id":"89", "name":"Flutter","address":"earth"}
It might also be in form like completely missing or receiving null value (in case its a nested object)
I am using plain dart convert library.
can i integrate outlook api using flutter?
what mac do they use
whats dynamic and strongly typed?
Can I think of factory constructors as Static methods?
Guys, you know these keyboard shortcuts Mac / Win that show up on the screen when you press them. Is this an Android Studio plugin or is it a post production labelling?
I use this plugin, which advises about keyboard shortcuts: plugins.jetbrains.com/plugin/9792-key-promoter-x
Character In the video It's great, I like it a lot $$
wonder how to take a screenshot for failed flutter integration tests?
why use package:project syntax instead of just importing the dart file?
liked for the epic switch
Anywhere we can get a Flutter shirt ?
The problem with flutter is Its performance on low end devices. It doesn't have that swiftness.
What devices are you using? The team definitely wants a good experience everywhere, so if you're seeing poor framerates, we'd love to hear about it.
Andrew Brogdon Turkcell T-60 which is mock up of ZTE Blade S6
@@redbrogdon I love this response. True class. Much respect my friend. You guys are doing a good thing here and many of us appreciate and are grateful for Flutter and all of you. I am building a real production app for my business and am totally happy with the performance on all the devices I have tested so far. And my time saved to build is of infinite value to me and my family.
Why iphone? Why not pixel?
The Json examples are now available in this URL: github.com/HackerNews/API/blob/master/README.md
My solution to the dependency conflicts which still exist when you search for individual plugins in the pub directory and install the latest, is to just use the vesions in this file:
github.com/google/built_value.dart/blob/master/example/pubspec.yaml
factory constructor 35:51
The last 25 minutes were too hard for a newbie in Flutter
flutter come along way I am afraid to watch the pre 2020 videos because of the probability of a better way to write the same code now
This library github.com/k-paxian/dart-json-mapper has less boilerplate and more features
Can i build a social network app using flutter I mean a complex one
Nader Elarnaouty I don't see why not.
There is a social network app totally written in Flutter you can Google it
I wonder why Dart/Flutter does not have easy to use JSON serialization like GoLang. built_value brings unnecessary complexity and quite a lot of boilerplate code. ref : github.com/dart-lang/sdk/issues/36066
Don't you guys think that json_serializable is simpler than built_value? I personally didn't like built_value
I'm curious as well, it seems built_value has more to offer? as immutable perhaps?
Allan Dale Ho yes, built_value has more to offer. But its so complicated to use! And json_serializable supports immutability too, but in the dart's regular way, not using getters to declare the properties
Naph thanks! Will check both out! :)
Yeah! we love doing taxes, lets party.
#BoringShow
Hey! 😅
Someone likes Elon Musk
faltu
Or someone explain wy they do not add it
why is everything white, It's killing me
It is super boring. :(
I am feeling that I would learn more from reading than watching this. Sorry, man.
I will always vote down videos about Flutter until google add XML support
Pedro Massango Why do you care about XML? It's really old and everyone hates it
Design on Flutter is very confuse and hard
I like the separation of code and design of android
Actually I think flutter is the first non confusing mobile dev environment
Me too but not for design for the Localization strings.xml makes everything just easier.