Dart Null Safety: The Ultimate Guide to Non-Nullable Types

Sdílet
Vložit
  • čas přidán 28. 07. 2024
  • Written tutorial here: 👇👇
    codewithandrea.com/videos/202...
    A complete tour of Null Safety & non-nullable types, the syntax changes they introduce in Dart 2.9, and how to use them in practice.
    HIGHLIGHTS
    00:00 - Intro
    01:23 - Null References: Some History
    01:53 - Dart: Sound Type System
    03:19 - Null Safety: Intro & Non-Nullable variables
    03:53 - Null Safety: Advantages
    05:00 - Nullable Variables
    06:43 - The Assertion Operator
    08:17 - Flow Analysis: Null Checks & Promotion
    10:25 - Flow Analysis: Definite Assignment
    11:12 - Using non-nullable variables with classes
    11:33 - Non-nullable named and positional arguments
    13:47 - Null-aware cascade operator
    14:37 - Null-aware subscript operator
    14:53 - The late keyword
    17:01 - Static and global variables
    17:29 - Conclusion
    Join my FREE email course to become a Flutter expert with the best resources, at your own pace: codewithandrea.com/newsletter/
    Want more? Check out all my Flutter courses: 👇👇
    codewithandrea.com/courses/
    Happy coding!
  • Věda a technologie

Komentáře • 30

  • @tHekrack23
    @tHekrack23 Před 4 lety +6

    Great video. I just can't understand why any strongly typed language is not null safe. This is a giant step for dart

  • @ahlalfiqh
    @ahlalfiqh Před 4 lety +6

    Thank you so much for your tutorials. May God bless you. Your courses are awesome.

  • @RaymondAtivie
    @RaymondAtivie Před 4 lety +3

    This would help avoid soooooo many potential errors! Thanks for this video and perfect explanation and examples

  • @rafatrashidrahi9353
    @rafatrashidrahi9353 Před 3 lety

    Best Video on Null Safety. Watched many video, null checks weren't clear on docs. But you made it so simple. Thanks Andrea

  • @rohitsrao
    @rohitsrao Před 2 lety

    Thank you so much. This was an epic tutorial. So concise and every minute had value.

  • @bakanndy
    @bakanndy Před 3 lety

    Day 2, I've learned something new: Null safety. Thank you Andrea

  • @gatispelcers2792
    @gatispelcers2792 Před 2 lety

    Very helpful, thanks!

  • @workflop4117
    @workflop4117 Před 4 lety

    Wow really an amazing explanation thanks :D

  • @moazelsawaf2000
    @moazelsawaf2000 Před 2 lety

    Thanks a lot Andrea ❤
    Great Video ❤

  • @thecodeblooded8508
    @thecodeblooded8508 Před 3 lety

    I was struggling this null safety concept as I am new to flutter. Thank you.

  • @2SourceFort
    @2SourceFort Před 2 lety

    thankyou so so so much

  • @bashiruibrahim8443
    @bashiruibrahim8443 Před 4 lety

    Thank you sir

  • @warperone
    @warperone Před 3 lety

    Well explained

  • @himesh_89
    @himesh_89 Před 4 lety

    thank you

  • @trapeye3464
    @trapeye3464 Před 4 lety +2

    thanks I love u

  • @arunyogeshwaran3083
    @arunyogeshwaran3083 Před 4 lety +1

    Hey Andrea, being your follower for around an year. Havent known any credible person to ask this question.
    Can you make a video about the future of Flutter especially with regards to the plugin development?
    Will flutter collapse if there is not enough plungin development for the native features?

    • @CodeWithAndrea
      @CodeWithAndrea  Před 4 lety +2

      I don’t think that’s a problem, plugin development has accelerated considerably from 2018 to 2019. If anything, there are already so many plugins that finding and highlighting good quality ones is one area of focus these days.

  • @doha.saqlain
    @doha.saqlain Před 3 lety

    Andarea in ur Flutter course we create a time tracker in this.child and many more is give's error I added ? in some places and before this.child I added require but still in super function give me error is quit confusing i cant understand what to do

  • @peekpt
    @peekpt Před 4 lety

    OMG here they come...

  • @osamaali6603
    @osamaali6603 Před 4 lety +2

    Hello Andrea! Can you spare a minute to answer my query please. As part of a project, I have to implement a chat feature in a flutter app with firebase backend. The users should be able to send documents and images through chat. As a proof of concept, I have implemented something similar by using firebase streams i.e. by using the snapshots method to listen to document or collection changes in real time. I want to know if this is a production grade technique. I have heard that sockets are a more proper way. Can you point me to some tutorial and share your ideas and experience. Thank you!

    • @yandelyano
      @yandelyano Před 3 lety

      Interested, if you have any update on this subject I would like to know.

  • @codewithvino7066
    @codewithvino7066 Před 4 lety

    Are you planning to create any new course in udemy for flutter?

  • @_undecided
    @_undecided Před 4 lety

    'late' it mean bye bye setState() and await?

    • @CodeWithAndrea
      @CodeWithAndrea  Před 4 lety +2

      No. You still need setState to rebuild widgets, and await for asynchronous code. late is only for deferring initialization of variables, without having to make them nullable.

    • @_undecided
      @_undecided Před 4 lety

      @@CodeWithAndrea Ohh.. with setState() I was thinking about initState() 🙈 I didn't notice how I wrote it 😀

  • @storylineteam
    @storylineteam Před 4 lety

    i will miss my huge list of assertions :(

  • @gripzy7571
    @gripzy7571 Před 4 lety

    Hi! I sent you an email regarding a bug from one of your github packages.

  • @asavchuk
    @asavchuk Před 3 lety +1

    it's impossible to listen it, he sounds like a robot

  • @pubgpanda4772
    @pubgpanda4772 Před 2 lety +2

    Bad accent not easy for me 😡