Networking and FutureBuilder (The Boring Flutter Development Show, Ep. 3)

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 106

  • @burhanuddinrashid891
    @burhanuddinrashid891 6 лет назад +18

    Flutter Tip at 34:15 - If you make changes to a const or final variable than while hot reload only const changes will reflect because its a stateful hot reload which maintain the state of the object having the final state.
    Looking forwards to this small tips.

  • @praharsh_bhatt
    @praharsh_bhatt 5 лет назад +18

    press Shift+End to select the whole line!

  • @raqbit
    @raqbit 6 лет назад +5

    Love the show, it's (somehow) entertaining to see how you tackle these problems!

  • @theGoldyMan
    @theGoldyMan 6 лет назад +4

    on line 29 of the test res should be storyRes. Great video. I though i have to write more code for making http requests

  • @michelfeinstein
    @michelfeinstein 6 лет назад +3

    Andrew, you really need to learn some IntelliJ IDEA shortucts.... If you used a multi-line caret you would have edited all those field, from the API, in no time.
    Just multi-line caret... Then press "home", then cmd+arrow right (at least in windows)... Then cmd+shift+arrow right.. Then delete, and you have all the fields....then "home".... Then type "String get"... Then "end" and ";" and you are almost done, just need to change some Strings for int and etc.

  • @mokhosh
    @mokhosh 6 лет назад +35

    Oh... Where is Philip?! It's literally boring if you all have perfect accents guys :(

  • @prasadbankar1301
    @prasadbankar1301 6 лет назад +22

    This episode was not up to the mark of previous two episodes. You were discussing among yourselves instead of telling us what you actually did.

  • @RoderickGroesbeek
    @RoderickGroesbeek 5 лет назад

    The http response code ('res') is inspected twice, the second check should be 'storyRes'. And could you elaborate if all the HTTP calls would fail, the test would still succeed or not? Great show btw! I learn a lot... (not only flutter/dart)

  • @benjaminli21
    @benjaminli21 2 года назад

    Not boring at all, in my opinion. Love this live coding thing!!!!

  • @ibrahimshaglil1141
    @ibrahimshaglil1141 6 лет назад +14

    please create a lesson in SQLite or animation or permission and thanks a lot for this show

    • @filiphracek
      @filiphracek 6 лет назад +10

      This is totally on our list. Roughly in that order, too. Next episode won't be it, but soon.

    • @mrunfunny
      @mrunfunny 4 года назад

      @istanbul There are good Udemy courses for getting started with Flutter, but none of them compare to The Boring Show if you know basics of Flutter.

  • @ZoranSmilevski
    @ZoranSmilevski 6 лет назад +2

    Shouldn't be in test "expect(res.statusCode, 200)" better option over "if (res.statusCode == 200)"?

    • @HumanoidTyphoon91
      @HumanoidTyphoon91 6 лет назад

      Yes, it would be better, as with the if version the tests don't fail.

  • @PraveenAV
    @PraveenAV 6 лет назад +1

    Looking forward for a tutorial on State Management. Almost all apps get new state from web, subscribe to state change, update state back to web. If will be great if you can give an idea on best practices to achieve these tasks.

  • @ChasedByPenguins
    @ChasedByPenguins 3 года назад

    Alt+Shift+Down Arrow in VSCode is one of my favourite shortcuts...

  • @shiqiyang1144
    @shiqiyang1144 5 лет назад

    A suggestion: When trying to do the import stuff, take advantage of the dart_language_server to speed things up.

  • @parihar-shashwat
    @parihar-shashwat 6 лет назад +4

    I couldn't find one thing in future builder is that, how do I change a single card's text on button click in the same card. All the cards are inside list which is being created using Json data from inside future builder, Now I have used setState() but it's refreshing whole future builder and refetching data from the server. Any ideas?
    I am creating an e-commerce like app where user can increase or decrease the quantity from each service. All the services are being fetched using FutureBuilder, Now I can't make the increment and decrement counter make work with increasing text on each cards.

    • @andrewbrogdon558
      @andrewbrogdon558 6 лет назад +1

      Can you show a little of the code so I can see exactly what you mean? You could point me toward something like a GitHub gist, for example.

    • @parihar-shashwat
      @parihar-shashwat 6 лет назад

      gist.github.com/50shashwat/e2ea92c2f376e25c09e0bddbd8163a96 on line 274 I am using setState(){} to update the next container on line 332. I want to update the text of card using a button where the text and button both are in List build using FutureBuilder .

  • @karthithilax19
    @karthithilax19 3 года назад

    In my point of view Andrew and Filip are the best pair

  • @xingqiangwang8846
    @xingqiangwang8846 5 лет назад

    The course is very good. Now you have a serialized tool, not a command line. I look forward to your reply. Thanks!

  • @michelfeinstein
    @michelfeinstein 6 лет назад

    I am new to Dart and Flutter, but in Java, you could use RxJava2 flatMap() to take the ID and return a Future for each Article.

  • @leviroelofsma7958
    @leviroelofsma7958 5 лет назад

    It's nice these video's obviously don't have any ads.

  • @krupeshanadkat635
    @krupeshanadkat635 4 года назад

    intense debugging and silence at 23:05 , lol. So much for parsing json into a dart object :)

  • @CalebGosiak
    @CalebGosiak 6 лет назад +1

    Love the show thanks for putting this together! Out of curiosity, when Andrew got rid of all the `new` keywords; what did he use to select those?

    • @andrewbrogdon558
      @andrewbrogdon558 6 лет назад +3

      So handy. It's called "Select Next Occurrence." IntelliJ (and therefore Android Studio) has offered it for a while: blog.jetbrains.com/idea/2014/03/intellij-idea-13-1-rc-introduces-sublime-text-style-multiple-selections/

    • @murkyglasses
      @murkyglasses 6 лет назад

      If your using VS Code, I think its cmd + D (for each occurrence) and cmd + shift + L (for all occurrence).

  • @aritraroygosthipaty3662
    @aritraroygosthipaty3662 4 года назад

    Can the async snapshot be null? If so, would a ternary operation be useful to filter it?

  • @nobodys2358
    @nobodys2358 5 лет назад

    -Your code is perfect!
    -Because it's being _reviewed_!
    38:45
    So true :)

  • @andresrestrepo823
    @andresrestrepo823 5 лет назад

    Shouldn't change the expected value in order for the test to pass? For the story 18812875 the by valur is "docbrown".

  • @aleksoft1
    @aleksoft1 5 лет назад

    Thank you guys for the great show! 👍

  • @marianoarganaraz
    @marianoarganaraz 6 лет назад

    I currently have an Socket.io server working with a web site, and I would like to develop an app with flutter that can stream the server content, I've found that this communication with Flutter and Socket.io is not possible right now, my question is wich websockets server could I use in oder to have this desired communication?

  • @semicognitive
    @semicognitive 6 лет назад +3

    Is Flutter ever planning on having built it in better support for Tablets/Chromebooks

    • @filiphracek
      @filiphracek 6 лет назад

      What, in particular, are you missing? Flutter runs well on these devices but I know there are things that need more love. I wonder what you consider the most important issues.

    • @semicognitive
      @semicognitive 6 лет назад +4

      Filip Hráček It runs well, yes, but I would be interested to see layouts designed to easily switch to multiple panels, like how an email client would look. For example, Gmail on mobile has the list of emails which can be opened up to show the email, but on a Chromebook/Tablet it expands out to two different panels

    • @AhmedAli-jx9ie
      @AhmedAli-jx9ie 6 лет назад

      chromebooks os will be replaced with fuchia , where flutter is gonna be the official way to develop fuchia apps

  • @whiteapps
    @whiteapps 6 лет назад +1

    IntelliJ has a multiline cursor... would save you a lot of time

  • @andriikapynos4875
    @andriikapynos4875 2 года назад

    This is a great show. I start learning dart and flutter to develop app for android.
    But I can not find information about @nullable annotation. Is @nullable is standard annotation and if so where is information about it?

    • @andriikapynos4875
      @andriikapynos4875 2 года назад

      I am sorry. I found nullable annotation in API documentation for built_value.

  • @DakshGargas
    @DakshGargas 6 лет назад

    Hi, my parseArticle() works well under `Test` but it does not work in the App.
    I get an error while performing this
    `serializers.deserializeWith(Article.serializer, parsed);`
    Error: type '_$Article' is not a subtype of type 'Article' in type cast
    Can you help me out.
    Again, It works perfectly fine under `Test`

  • @michelfeinstein
    @michelfeinstein 6 лет назад

    Is it possible for you guys to make a library like Retrofit for Android to simplify the whole Network connection process?

  • @subtex
    @subtex 6 лет назад +1

    I'm only 21 mins in so this comment may be premature but the set up for the built value stuff with going back and forth copying/pasting (seemingly) random lines of code into your Article class is super confusing. The on-the-fly coding in this series is great, but without some overall discussion about exactly what and why you're doing what you're doing it's not very coherent.
    Am I supposed to remember what random github issue you went to to grab the lines of code for the plugin, and serializer, etc?

  • @apf14378
    @apf14378 6 лет назад

    I didn't really understood the advantages of using built_value instead of other, simpler, solutions like json_serializer, i'm not familiarized with the "built value" concept at all and I don't see exactly how could it improve the quality of the code or the code perfomance or even the coding speed at all. For the moment I'll be going with json_serializer but will keep an eye in the build_value thing just in case I see a real advantage of using it.

    • @andrewbrogdon558
      @andrewbrogdon558 6 лет назад

      If you're just looking for serialization, json_serializable is perfect. The built_value package is really meant to make immutable objects that behave like value types, and it gets serialization almost as a side effect. There are advantages and disadvantages of using immutable data models, some of which you can see here: www.quora.com/What-are-the-advantages-and-disadvantages-of-immutable-data-structures

  • @pradipkoravi4590
    @pradipkoravi4590 6 лет назад

    Thank you for this video but can you tell me how can I reduce the app size build in flutter

  • @gouky100
    @gouky100 6 лет назад

    It was a good episode. I would like to Know if serializations with build_value could manage complex json structure, I mean a List inside a map o viceversa, 2 level of list. To be more precise I using Drupal 8 as backend, in this APIs for nodes or user has more complex JSON structure

    • @andrewbrogdon558
      @andrewbrogdon558 6 лет назад

      Yes, you can use built_value with nested object structures (e.g. one object has a list of another, or something like that). You can check out our json sample for some example code: github.com/flutter/samples.

    • @gouky100
      @gouky100 6 лет назад

      Thank you for the support and examples. I will study it :)

  • @MaballoNet
    @MaballoNet 6 лет назад

    I'm here to learn something. Great video as always 😀

  • @vinceramces
    @vinceramces 6 лет назад +2

    Why won't you include the State management tutorial in the documentation? We always read the documentation in the official website. thanks!
    Request: Emily Fortuna to be in the next episode of the boring flutter development sometime. She really loves memes. just to spice it up 🤣

    • @filiphracek
      @filiphracek 6 лет назад

      Emily is definitely coming to a future episode. Great tip!

    • @vinceramces
      @vinceramces 6 лет назад

      Glad to know!

  • @martinv4914
    @martinv4914 3 года назад

    Close the calendar notification PLEASE!

  • @locationserviceslocationse7253
    @locationserviceslocationse7253 6 лет назад +1

    What is the difference between
    import 'package:boring_show_example/src/serializers.dart';
    and
    import 'serializers.dart';
    ???
    Because I had a nasty problem where my json wouldn't parse, and it was because of this import!
    It was throwing "type '_$Article' is not a subtype of type 'Article' in type cast" no matter what...
    I was following what you were doing, and had the same folder structure. Everything was the same except for this import.
    Couldn't figure out what was wrong until I found your code in github and started comparing it line by line with mine.

    • @andrewbrogdon558
      @andrewbrogdon558 6 лет назад +1

      Either one is fine; the important thing is not to mix them. Dart considers those two imports to be declaring two different namespaces (even though they ultimately point to the same file), and will create two different sets of class definitions for them. The team is considering a change to the system that'll detect and fix this, but in the meantime I recommend just standardizing on one approach (I always use `package:`, myself).

    • @tranquil_kit
      @tranquil_kit 6 лет назад

      Thank you so much for the fix! I've been struggling with the same issue for a few hours now! :D

    • @HumanoidTyphoon91
      @HumanoidTyphoon91 6 лет назад

      @@andrewbrogdon558 I was using everywhere the import serializers.dart form for all my files in the lib folder, yet, it was still complaining about that weird error "type '_$Article' is not a subtype of type 'Article' in type cast". I changed it to package:.... long form imports and everything works. Is that expected? I really liked (together with the dart autoformatter) organizing my imports kind of like in python, that first come dart imports, then package: imports, then my imports from lib folder.

  • @eldersonlaborit2290
    @eldersonlaborit2290 6 лет назад

    Hi and thank's for it, i have one questions, pre- requerimient for learn this? i mean need some lenguaje (js, typescript)?

    • @filiphracek
      @filiphracek 6 лет назад +1

      Flutter is in Dart. But if you're familiar with something like JS or TypeScript (or any other object-oriented, and ideally also class-based language), you should be fine. I'm not sure if the Boring Show is good introductory content. Fortunately, there seem to be a lot introductory-level courses and tutorials for Flutter all over RUclips (and elsewhere).

    • @eldersonlaborit2290
      @eldersonlaborit2290 6 лет назад

      Yes, i'm developer on JS (front with Angular) i take a course on Udemy www.udemy.com/flutter-dart-the-complete-flutter-app-development-course/ thank' s sir for ask me.

  • @saiprasad8445
    @saiprasad8445 3 года назад

    How Can I Fetch the data from two separate api's and pass it to a stateful widget

  • @jibraniqbal7830
    @jibraniqbal7830 5 лет назад

    these are really fun, even though I prefer faster pace in learning.

  • @yuliangwang879
    @yuliangwang879 6 лет назад

    dear andrew, how can set a proxy to flutter http method? i come from china,i need proxy to get hacker-news...thanks

  • @truongsinhtran-nguyen7129
    @truongsinhtran-nguyen7129 5 лет назад

    Love the kindness :))

  • @RostikShunlov
    @RostikShunlov 4 года назад

    thanks alot

  • @thatismartin4021
    @thatismartin4021 5 лет назад +2

    If you are used to use gson or moshi every day for de/serialization, the dart/flutter way feels like pain in the a@&. It took you at least about 30min to define one single data class and I think you didn't do this for the first time. I like this show but this episode was more a monologue than a show. :(

  • @delosssh
    @delosssh 6 лет назад +2

    Is copying and pasting those properties and removing the excess characters/words faster than typing them? =)

  • @irperera
    @irperera 5 лет назад

    what esp did they use moor?

  • @user-oi5pv3wh2c
    @user-oi5pv3wh2c 5 лет назад

    What is the app of that icon like the letter C?

  • @RahulPalVlog
    @RahulPalVlog 6 лет назад

    Thanks

  • @mbn188
    @mbn188 5 лет назад

    This built value seems like too much magic. I wonder if it would be better to parse that by simpler traditional code.

  • @nitinmehta001
    @nitinmehta001 6 лет назад

    My flutter default app size is 90.40 MB. why ?

  • @michelfeinstein
    @michelfeinstein 6 лет назад

    Andrew, ALT+Enter than "Import Class"

  • @tuliomagalhaes362
    @tuliomagalhaes362 6 лет назад

    How do I parse json arrays?
    Ex: [{},{}]

  • @truongsinhtran-nguyen7129
    @truongsinhtran-nguyen7129 5 лет назад

    30:56 , (limited) reflection in flutter is now available via github.com/dart-lang/reflectable

  • @hariangr
    @hariangr 6 лет назад

    what is the current state of webview?

    • @filiphracek
      @filiphracek 6 лет назад

      A WebView widget is planned, but - unfortunately - I don't think it's coming very soon. It's obviously something we want to have in the future. For showing full websites, the only option right now is to use something like url_launcher or write a hook in the underlying app (like, having the underlying Android app create a new Activity with a WebView on request).
      If what you seek is displaying rich text, there's the RichText widget. (In many apps, WebView is basically used just for displaying a little bit of text w/ formatting. You can even use pub.dartlang.org/packages/flutter_markdown if needed.)

  • @anacarolinacabral2898
    @anacarolinacabral2898 3 года назад

    56:00 future builder

  • @HarisuddinThohir
    @HarisuddinThohir 6 лет назад

    ❤️ Flutter

  • @praneetnigam316
    @praneetnigam316 6 лет назад

    #BoringShow How can we open these links in a webview ?

    • @filiphracek
      @filiphracek 6 лет назад

      Flutter currently doesn't have a webview widget - that's obviously something we want to have in the future. For showing full websites, the only option right now is to use something like url_launcher or write a hook in the underlying app (like, having the underlying Android app create a new Activity with a WebView on request).
      If what you seek is displaying rich text, there's the RichText widget. (In many apps, WebView is basically used just for displaying a little bit of text w/ formatting. You can even use pub.dartlang.org/packages/flutter_markdown if needed.)

    • @praneetnigam316
      @praneetnigam316 6 лет назад

      Thanks

  • @yaguanglei4308
    @yaguanglei4308 5 лет назад

    storyRes.statusCode not res.statusCode

  • @sanukumar4786
    @sanukumar4786 5 лет назад

    Shift+Cmd+left

  • @ephraimschmitt3106
    @ephraimschmitt3106 6 лет назад

    man, this seems like an awful lot of code compared to something like Retrofit.

  • @Simon-oy7kf
    @Simon-oy7kf 6 лет назад +12

    So is google using MacBooks now?

    • @semicognitive
      @semicognitive 6 лет назад +4

      Simon Deelstra They always have

    • @andrewbrogdon558
      @andrewbrogdon558 6 лет назад +40

      Many engineers around campus use Thinkpads running Linux, but those of us that do mobile tend toward MacBooks so we can build iOS apps. I imagine a lot of people at Apple use Google Search, so it's not that weird. :)

    • @andrewpande984
      @andrewpande984 6 лет назад

      That's a great answer you just gave!

    • @jesselima_dev
      @jesselima_dev 6 лет назад

      \o/

    • @hariangr
      @hariangr 6 лет назад

      Andrew Brogdon which mac model do they usually use?

  • @LeandroCoutinho
    @LeandroCoutinho 6 лет назад

    speak louder please. nice show guys

  • @truongsinhtran-nguyen7129
    @truongsinhtran-nguyen7129 5 лет назад +1

    45:58, guys, if I am to review your code, I would raise some serious red flags on this unit test.
    Firstly, line 29, you would mean `storyRes.statusCode == 200` (not rest.status code, it's the copy-paste evil!)
    Secondly, why nested if's? I bet most code smells analyzers will crazily scream out and kindly ask you to reverse the conditional check and use early return.
    Thirdly, if's in unit test is a big no. Maybe you want this test to pass even if network is broken, in which case we should have clear WARNING logs. Otherwise, `expect(res.StatusCode, 200); expect(idList.isNotEmpty, true); expect(storyRes.StatusCode, 200);`

  • @sudhanshusiddh9303
    @sudhanshusiddh9303 6 лет назад

    Thank you so much for covering built_value, I had been trying to implement it in my project but I have been hitting the wall and getting this weird error which I am not able to make sense of, I have posted this question on stackoverflow, I will really appreciate if you could look into it and suggest where I am going wrong.
    stackoverflow.com/questions/51372133/dart-built-value-builtlist-error-in-serializer-arguments-of-a-constant-creati

  • @yudhisthirsingh8401
    @yudhisthirsingh8401 5 лет назад

    Do checkout "Built Value Tutorial for Dart & Flutter" by Reso Coder and thank me later.

  • @yudhisthirsingh8401
    @yudhisthirsingh8401 5 лет назад

    Speak LOUDER

  •  6 лет назад

    Honestly, this show was promising at the pilot but then descended to this, I'm dropping out. Seriously, you're building the app and 2nd and 3rd part is about testing?

  • @kabalida3062
    @kabalida3062 6 лет назад

    Bro I don't understand what r u doing?

  • @meigo9688
    @meigo9688 5 лет назад

    +1 gson is much better than this, to much boilerplate to start coding

  • @AhmedAli-jx9ie
    @AhmedAli-jx9ie 6 лет назад +2

    this episode was a waste of time