Null safety in Dart - Introduction

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2020
  • Dart is becoming null safe. In this video, we're going to introduce the concept and why it's valuable. You'll learn about the basics, including syntax.
    As of the release of this video, in November 2020, Dart null safety is in beta. This means you are free to experiment with the feature but should not use it in production apps.
    To learn more, visit → goo.gle/391m8Fz
    Learn everything about Flutter at → goo.gle/2WAhEN1
    Subscribe to Flutter! → goo.gle/Flutter
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 257

  • @filiphracek
    @filiphracek 3 ปีที่แล้ว +928

    I'm really sorry about my mispronunciation of "variable" and other English words. By the time I realized my error, it was too late to re-shoot. Apologies for butchering the English language. (Again.) I'll try to do better next time.

    • @valternegreiros4511
      @valternegreiros4511 3 ปีที่แล้ว +83

      No worries

    • @sainoba1
      @sainoba1 3 ปีที่แล้ว +156

      It actually gives it a little bit of a charm

    • @AlvarLagerlof
      @AlvarLagerlof 3 ปีที่แล้ว +63

      Don't worry. I'm not native either. It's totally clear what you were meaning to say and the content is great!

    • @filiphracek
      @filiphracek 3 ปีที่แล้ว +134

      Thanks all! I'm feeling a lot better about it. This community is so wonderful.

    • @emekachukumah7016
      @emekachukumah7016 3 ปีที่แล้ว +26

      No need to apologize. Great video!

  • @josiahsaunders4936
    @josiahsaunders4936 3 ปีที่แล้ว +178

    This is a beautiful thing. I can't imagine how hard it was to create this feature. Thank you flutter/dart devs :)

    • @stainly7529
      @stainly7529 3 ปีที่แล้ว +2

      Yeah but it’s copied from other languages. Swift is the first to have it.

    • @robbet2477
      @robbet2477 3 ปีที่แล้ว +9

      @@stainly7529 Bro the important thing is the improvement in the language, Swift has copied things from Java and C ++ 😜, but for that reason it is not necessary a Fanboy saying it everywhere, languages ​​are to solve problems, and developers use them as tools, create problems = bad programmer 🙄😒

    • @lx2222x
      @lx2222x 3 ปีที่แล้ว

      It isn't hard at all, it is actually easier

    • @yiweima4412
      @yiweima4412 3 ปีที่แล้ว

      @@lx2222x Yup, its not about difficulty, its about innovation. No matter how hard something is its still some what achievable, but if lack of innovation you cant even imagine it.

    • @pranjal86able
      @pranjal86able 3 ปีที่แล้ว

      @@stainly7529 I have seen this idea been discussed before swift existed. Swift made it mainstream. Chris Lattner never claimed that swift/him invented this. Swift is awesome and so is dart imo.

  • @hatema
    @hatema 3 ปีที่แล้ว +93

    Dart is a really good language and I hope it grows out of Flutter's shadow.

    • @promisenwanno5969
      @promisenwanno5969 3 ปีที่แล้ว +5

      Yes, I think so too. It's one of those languages that was created with sense of reality. Just like javascript and php. Provides the needed and avoids unnecessary formalities.

    • @michasengotta2295
      @michasengotta2295 3 ปีที่แล้ว +8

      @@promisenwanno5969 except JavaScript is a mess and Dart isn't

    • @androov2797
      @androov2797 3 ปีที่แล้ว +1

      Eminem Fan, you got my support

  • @albertoazinar1209
    @albertoazinar1209 2 ปีที่แล้ว +3

    This guy is really good at explaining Flutter stuff. Amazing video

  • @christiang.3616
    @christiang.3616 3 ปีที่แล้ว +5

    Beautiful. This reminds of the time when I had to copy null-safety boilerplate code and paste through a number of dart files.
    Thank you Dart devs ❤❤

  • @amirgamil
    @amirgamil 3 ปีที่แล้ว +11

    I learnt about Flutter and Dart shortly after I started learning Kotlin. Not having null safety seemed like such a loss. Now that it'll be in Dart soon, I'm super happy to see that it'll be in Dart soon. And sound safety as well. Thanks Filip and the Flutter and Dart teams for all your hard work!

  • @IsaacLarbiOnline
    @IsaacLarbiOnline 3 ปีที่แล้ว +2

    I sure will stay null safe, thanks for a down to earth presentation, you did a great job explaining.

  • @mohamedoumast60
    @mohamedoumast60 3 ปีที่แล้ว +1

    Thank you Flutter for the great effort to solve this old problem, now I can program safely, thank you

  • @kherelable
    @kherelable 3 ปีที่แล้ว +6

    I love you guys. Thank you for revive the joy of coding.

  • @DionisiusWahyuAdiSaputra
    @DionisiusWahyuAdiSaputra 3 ปีที่แล้ว +4

    Thank you for the hard work! Keep it up :)

  • @HenriqueMDerosa
    @HenriqueMDerosa 3 ปีที่แล้ว +4

    Awesome video! Great! Thanks for that! 🌟

  •  3 ปีที่แล้ว +22

    I can't wait to be able to use this, I come from Kotlin and I totally miss this feature

    • @kishorekittu4800
      @kishorekittu4800 3 ปีที่แล้ว +1

      Can anyone explain How this is different from the kotlin's null safety? What is this sound null safety and how is it different from the normal one?

  • @carloselilopeztellez7802
    @carloselilopeztellez7802 3 ปีที่แล้ว +2

    Love the feature, awesome vid!

  • @abdullahalmaruf5513
    @abdullahalmaruf5513 3 ปีที่แล้ว

    Beautifuly explained. Thanks a lot 👍

  • @tdrkDev
    @tdrkDev 3 ปีที่แล้ว

    Thank you for such informative and easy to understand guide 😁

  • @ilkercankaya3779
    @ilkercankaya3779 3 ปีที่แล้ว +23

    I was expecting this to arrive sooner or later. Things are very easy when it has null safety such as in kotlin.

    • @NextLevelCode
      @NextLevelCode 3 ปีที่แล้ว +3

      Did you notice though that it has more in common with Swift than Kotlin? List at 2:47

  • @donathmm3881
    @donathmm3881 3 ปีที่แล้ว +2

    Awesome!!!!!!! Thank you google!!! Flutter and dart are the best! Syntax is exactly like in swift I love it 😍

  • @SibirianWolf1987
    @SibirianWolf1987 11 หลายเดือนก่อน

    Very well explained!

  • @user-v2eqj8xiz4l
    @user-v2eqj8xiz4l 3 ปีที่แล้ว +19

    Since I coded with Dart, when I come across JavaScript & PHP variables, I ask myself what is this? what I supposed to do!?
    I love how dart make me unsafety on another language.

  • @vutuananh747
    @vutuananh747 3 ปีที่แล้ว +4

    Totally same with Swift, but it's still awesome. Thanks Flutter team :D

  • @shivambulsara8509
    @shivambulsara8509 3 ปีที่แล้ว +1

    This is great! Thank you!

  • @moazelsawaf2000
    @moazelsawaf2000 2 ปีที่แล้ว

    Thanks a lot, great and simple video ❤

  • @heaven7pro
    @heaven7pro ปีที่แล้ว

    Great explanation! Thanks a lot

  • @mohammadelkhatib
    @mohammadelkhatib 3 ปีที่แล้ว +1

    Awesome
    Great feature from flutter team 👌

  • @samuellamanyeaglago6919
    @samuellamanyeaglago6919 2 ปีที่แล้ว

    my 2 hour search is over. At long last, a question mark saved the day!

  • @chordfunc3072
    @chordfunc3072 3 ปีที่แล้ว

    This is going to be great! Can't wait for it to be out of beta!

  • @ameedsayeh97
    @ameedsayeh97 3 ปีที่แล้ว

    Thanks, very useful. And the best part that it looks almost identical to Swift.

  • @hasansalim1868
    @hasansalim1868 2 ปีที่แล้ว

    Thanks. Nice video as usual.

  • @meetpanchal8809
    @meetpanchal8809 3 ปีที่แล้ว +2

    The introduction music is so soothing 😅

  • @MaximoPower2024
    @MaximoPower2024 3 ปีที่แล้ว +5

    Really interesting

  • @pepepriest5973
    @pepepriest5973 2 ปีที่แล้ว

    This really changed a lot from the last time i coded in dart

  • @abigailchin9050
    @abigailchin9050 3 ปีที่แล้ว +31

    The devil works hard to introduce null errors but the dart development team works harder 😂🙏🏼

    • @msjahun
      @msjahun 3 ปีที่แล้ว +2

      😂🤣

  • @mehmetedex
    @mehmetedex 3 ปีที่แล้ว

    this is what we needed thanks

  • @atabayilker
    @atabayilker 3 ปีที่แล้ว +2

    Null exceptions always happen and hurt a programmer's feelings :D nice feature. Loving the Dart and Flutter more and more everyday. Hopefully google never stops developing on this particular technology.

  • @Magnetron692
    @Magnetron692 2 ปีที่แล้ว

    Thank you, much appreciated!

  • @algeriennesaffaires7017
    @algeriennesaffaires7017 3 ปีที่แล้ว

    I wasn't able to understand what null safety mean but now i understand thank you

  • @tananga1523
    @tananga1523 3 ปีที่แล้ว

    Super video. Please create more news videos and tutorials.

  • @notaspectator
    @notaspectator 3 ปีที่แล้ว

    If im not mistaken, this was one of the neat features of ruby and using question mark , also available in typescript

  • @mihaelablenche
    @mihaelablenche 3 ปีที่แล้ว

    Great content!

  • @promisenwanno5969
    @promisenwanno5969 3 ปีที่แล้ว +6

    I love Dart! One of those languages that was created with sense of reality. Straight to the point without unnecessary formalities- just like javascript and php.

  • @hosseinazem520
    @hosseinazem520 2 ปีที่แล้ว +1

    Nice thank u.
    i have a question. we should use ! when we guess maybe the value is null?

  • @pkgo1122
    @pkgo1122 5 หลายเดือนก่อน

    Awesome!
    🚀

  • @valternegreiros4511
    @valternegreiros4511 3 ปีที่แล้ว +16

    Better than Kotlin, thank you so much

    • @aadarsh8869
      @aadarsh8869 3 ปีที่แล้ว +2

      Kotlin has also null saftety

    • @SEGVeenstra
      @SEGVeenstra 3 ปีที่แล้ว +4

      @@aadarsh8869 think he is aiming for the sound null safety. Which indeed makes it better then Kotlin imo

    • @thedude61636
      @thedude61636 3 ปีที่แล้ว

      @@SEGVeenstra what is null sound exactly I'm not sure I understand it

    • @SEGVeenstra
      @SEGVeenstra 3 ปีที่แล้ว +1

      @@thedude61636 there is a difference in null-safety and sound null-safety.
      Kotlin is null-safe, which means you can declare fields to be non-nullable but technically things can still be null in some ways. We have it in a project that serializes Json. We can define properties as non-nullable, but it could still turn out to become null.
      With sound null-safety you are guaranteed it will never be null, allowing the compiler to be optimized. Swift for example is also sound null-safe.

    • @sindrenm
      @sindrenm 3 ปีที่แล้ว

      @@SEGVeenstra So how exactly does Dart make sure that fields from a back-end API are null safe? Will it not allow non-null types from a network call, for instance?

  • @ymi_yugy3133
    @ymi_yugy3133 3 ปีที่แล้ว +4

    I like the new syntax but it would have been nice to introduce the concept in a more general form, i.e. tagged union, or better yet also introduce tuples to give dart the full power of algebraic data types.

  • @sabuj745
    @sabuj745 2 ปีที่แล้ว

    Great Video

  • @ninjaasmoke
    @ninjaasmoke 3 ปีที่แล้ว +3

    Yes. YES. *YES* THANK YOU😭😭😭😭♥️♥️♥️♥️

  • @blablablabla29382
    @blablablabla29382 3 ปีที่แล้ว +3

    sound great !! Wp

  • @arjundureja
    @arjundureja 3 ปีที่แล้ว

    Similar to optionals in Swift. Nice

  • @FlutterInsights
    @FlutterInsights 3 ปีที่แล้ว

    I either check null value nd validate them or use null aware operator nd set the default value

  • @1995taunus
    @1995taunus 3 ปีที่แล้ว

    Thank you!

  • @akshattamrakar9071
    @akshattamrakar9071 3 ปีที่แล้ว +2

    Thanks

  • @MatthewPolack
    @MatthewPolack 2 ปีที่แล้ว

    Thanks for this...there is a few of us taking a Beginner Flutter course with Angela Yu...and in one of the lesson she has us coding like this:
    void main() {

    greet(greeting: 'Hey', namePerson: 'Cindy');
    }
    void greet({String namePerson, String greeting}){
    print("$greeting $namePerson");
    }
    But this now throws a Null error in the latest Dart.......us beginners in the comments note that we can fix this either by putting a '?' at the end of the String...or by placing the word 'required' before 'String'...but what should we do in this case ideally? Thanks for any clues if you have a moment!

  • @PamudasanTutorial
    @PamudasanTutorial 3 ปีที่แล้ว

    Hi, how do I add interstitial ads and admob banner ads to flutter ? Help me !

  • @ludanaltegani5654
    @ludanaltegani5654 2 ปีที่แล้ว

    Thank you

  • @sodiboo
    @sodiboo 3 ปีที่แล้ว +1

    nice disclaimer at the start, i figure it's meant to be easy to remove with youtube's video editor on pre-uploaded videos? for anyone watching in the future when null safety is stable, remove about 15 seconds from any timestamps that seem to link to the wrong part of the video and see if it makes any more sense, since that disclaimer is about 15 seconds long

  • @SisirKumarPathy
    @SisirKumarPathy 3 ปีที่แล้ว +2

    Will enabling null-safety, break existing code? Like moving from "@required" to "required" is already doing.

    • @sodiboo
      @sodiboo 3 ปีที่แล้ว +1

      Yes, the type system is changing and thus code will clearly code will break, preexisting code may return "String" and return null sometimes, now that's not possible, instead you need "String?" - albeit an easy fix, but so is actually most code broken by this, even if a bit tedious to do everywhere (oh hey have you heard of that migration tool that makes it less tedious?)

  • @jarnopunt
    @jarnopunt 3 ปีที่แล้ว

    I really like this null safety feature, but I do not really understand why it is not possible to throw a warning (like @ 3:38 ) when you declare a function that only allows non-null variables but you send a possible null variable, like @ 4:18. This kind of feels like an 'incomplete null safety' Or am I wrong?

  • @navczydev
    @navczydev 3 ปีที่แล้ว

    I am writing Kotlin day to day job, and it's also has sound null safety, when we have nullable variable we need to treat it properly otherwise compiler shows an error

  • @lasindunuwanga5292
    @lasindunuwanga5292 3 ปีที่แล้ว

    Great vid

  • @wandermonk1266
    @wandermonk1266 3 ปีที่แล้ว

    Thanks for your explanation. What is your native language anyway?

  • @zakariasahri
    @zakariasahri 3 ปีที่แล้ว +1

    Can anyone explain to me what's the difference between dart null safety and kotlin null safety??

  • @heshansandeepa9471
    @heshansandeepa9471 ปีที่แล้ว

    very nice

  • @mokshchadha9151
    @mokshchadha9151 ปีที่แล้ว

    beautiful

  • @yuri4n
    @yuri4n 3 ปีที่แล้ว +2

    Lovely

  • @davidchopin6583
    @davidchopin6583 3 ปีที่แล้ว

    Any guard let/if let?

  • @goldmenberd1350
    @goldmenberd1350 3 ปีที่แล้ว

    Good feature = good practices = good code = good software = good results. Thx to devs

  • @trungledang5225
    @trungledang5225 3 ปีที่แล้ว

    very respect

  • @agung_laksana
    @agung_laksana 3 ปีที่แล้ว

    Finally, I can use it like Swift and Kotlin. When is it ready to production then?

  • @kazukihiromoshito2935
    @kazukihiromoshito2935 3 ปีที่แล้ว

    I really am looking for some "or alternative" code that looks up to the "alternative" value if the preceding value is null or undefined, like...
    Color color = favoriteColor | Colors.blue;
    where "|" is some "or alternative" operator, such that if favoriteColor is null, it opts to the Colors.blue value.
    I tried it on Dart but didn't work... or are there some syntax to that?
    I'm rooting for a response, and if there is no operator like that yet, I hope something comes up.

    • @king4053
      @king4053 3 ปีที่แล้ว

      Color color = favoriteColor ?? Colors.blue

  • @arslankhan8825
    @arslankhan8825 3 ปีที่แล้ว

    @Filip
    is java has null safety?? I don't think @2:25

  • @DexterTalha
    @DexterTalha 3 ปีที่แล้ว

    Useful😍

  • @maksym.koshovyi
    @maksym.koshovyi 2 ปีที่แล้ว

    C# has the same feature since C# 8, why there's no check here? 2:25
    Complier analyzes code flow and warns if some value can be null where is shouldn't be

  • @VarunArora14
    @VarunArora14 3 ปีที่แล้ว

    Hi. I have a question. If I fetch data as Json object from 'jsonplaceholder.typicode.com/albums' and show its contents after jsonDecode in listView builder with child: Text(drinks[index]['title'])
    where drinks is jsonDecode(response.body) then it gives error " An expression whose value can be 'null' must be null-checked before it can be dereferenced.
    Try checking that the value isn't 'null' before dereferencing it" and after putting the question mark after word 'drinks' removes the error. I tried searching about it but did find only declaration with question marks and null safety with '?.' , '??', '!' . Is child: Text(drinks?[index]['title']) correct and what does this question mark after drinks imply in layman language as it gets a little confusing.

  • @dnnnvx
    @dnnnvx 3 ปีที่แล้ว +2

    Awesome language, and awesome community

  • @abdullahhejazi6907
    @abdullahhejazi6907 3 ปีที่แล้ว +1

    That's actually a great one.
    Just one question, will I be able to cast Nullable values to non-Nullable and vice versa ?

    • @h8moss766
      @h8moss766 3 ปีที่แล้ว +1

      Not flutter nor affiliated with flutter, but 3:49 will probably work with variable casting too

    • @abdullahhejazi6907
      @abdullahhejazi6907 3 ปีที่แล้ว +1

      @@h8moss766 oh yes, I think you're right

  • @softcoda
    @softcoda 3 ปีที่แล้ว

    lol...it's OK. Very good presentation

  • @yoavgodelnik
    @yoavgodelnik 3 ปีที่แล้ว +2

    Litttt 🔥

  • @TheMr82k
    @TheMr82k 3 ปีที่แล้ว +1

    What about the existing codebase? Is null safety going to be optional? If not then will there be a official tool to help in migrating?

    • @ciriousjoker
      @ciriousjoker 3 ปีที่แล้ว

      It's optional. Idk about a migration tool but I'd expect there will be

    • @filiphracek
      @filiphracek 3 ปีที่แล้ว +1

      Yes, there is a migration tool. I'm showing it off in this part of a different video: th-cam.com/video/b6YntQSKS7g/w-d-xo.html.
      And yes, it is also optional. You have to actively opt into the feature.

  • @qingbaohe7082
    @qingbaohe7082 3 ปีที่แล้ว

    Can I get authorization to share to Chinese media? Such as WeChat.

  • @srikika
    @srikika 3 ปีที่แล้ว

    great!

  • @nromancarcamo
    @nromancarcamo 3 ปีที่แล้ว

    is this already done in Mid Feb, 2021?

  • @harry356
    @harry356 2 ปีที่แล้ว

    Instead of a null crash I now have empty screens which are harder to debug. Not sure if this is an advancement.

  • @mileusna
    @mileusna 3 ปีที่แล้ว

    What about initial values?
    int count;
    Is count still null or 0? Will this be allowed without question mark?

    • @redbrogdon
      @redbrogdon 3 ปีที่แล้ว

      Non-nullable fields are required to be initialized with values, though you can mark them "late" in the rare case that you aren't able to initialize them right away (but will before they're read).

    • @filiphracek
      @filiphracek 3 ปีที่แล้ว

      Also, thanks to flow analysis, you can do something like this:
      int count;
      if (blah) {
      count = 10;
      } else {
      count = 0;
      }
      // ...
      Here, `count` is _non-nullable_, even though it starts uninitialized. Dart proves the count is not read before it is assigned, and allows this. Note that this only works for local variables (e.g. in functions). For class fields, Dart can't prove things like that, so you need something like `late`.

    • @mileusna
      @mileusna 3 ปีที่แล้ว

      @@filiphracek Thanks. Since I do go-lang on server side I was secretly hoping it would be similar like in the Go where by default int is 0, string is "" etc. 😁 It will be interesting migration. 😁

  • @YolunSonu1
    @YolunSonu1 2 ปีที่แล้ว

    Oh god, I developed an android app 2 years ago with older Dart version and I started to upgrade it in these days without knowing the language is almost completely changed.

  • @francisgeorge7639
    @francisgeorge7639 3 ปีที่แล้ว +2

    I don't get it. I find null is a way to catch my mistakes which I think I would be more liable to miss and end up with subtle bugs, and the crashing thing, does it really happen? The ?. and ?? operators were already as much as I think we needed. Even with Delphi, 25 years ago, null exceptions were caught in the event loop and simply showed an error box, no crashing at all. And Flutter/Dart is arguably the new Delphi. C++, Java etc apps might bug out, but that was because they didn't have Anders Hejlsberg to show them the way. Can someone give me a persuasive example of how this improves our lives?

    • @Canaris
      @Canaris 3 ปีที่แล้ว +3

      All the "old" null-value-errors occured at runtime. Which sucks. Now all null-value-errors occure at compile(!) time. If you program/script/tool compiles, it is guaranteed to not have any null-value-errors. That's why it's so awesome.

    • @francisgeorge7639
      @francisgeorge7639 3 ปีที่แล้ว +1

      @@Canaris ahh, I get it. That is awsome.

  • @gokulakrishnan1977
    @gokulakrishnan1977 3 ปีที่แล้ว +1

    Finally I can say goodbye for Red screen 🤩.

  • @JoshuaKisb
    @JoshuaKisb 3 ปีที่แล้ว

    nice

  • @vinceramcesoliveros6739
    @vinceramcesoliveros6739 3 ปีที่แล้ว +2

    How about the late keyword? Wasn't that part of dart's null safety feature?

    • @TheMr82k
      @TheMr82k 3 ปีที่แล้ว +2

      Yeah I was waiting for that one too most of time in Flutter apps we have null due to initState, this feature also does the job but will have to add null checks everywhere

    • @user-v2eqj8xiz4l
      @user-v2eqj8xiz4l 3 ปีที่แล้ว +1

      Yes, it is. new feature is ?, ! and late. you can read more here dart.dev/null-safety

    • @sodiboo
      @sodiboo 3 ปีที่แล้ว +2

      Indeed. The "late" keyword works very similarly to what non-sound null safety did, it simply means "This variable should always have a value by the time it is accessed, but i can't prove that by putting it in an initializer".
      An example would be a "Coffee" class that has "heat()", "cool()" and "serve()" methods, in the user of this coffee library they would always either heat or cool their coffee before serving it, otherwise that's invalid - heat() and cool() each assign the "temperature" field, and before they're called that field won't have a value.
      Dart's type system can't know you're meant to use that method before serve(), so when accessing the temperature to decide whether to serve "ice cold", "cool", "chilly", "room temperature", "warm", "hot" or "burning" coffee dart will tell you "Hey! that value can be null".
      To get around this you want a bang, but if that's the intended use, just put a bang everytime, you might wanna remove the explicit bang operator, so instead the "late" keyword at variable declaration would say "Hey i can't exactly prove this to you, but just trust me that when i access this i know it won't be null unless another developer did something wrong".
      When a variable has the "late" modifier, the same checks will be performed as when accessing null with a bang operator (or any variable access in non-nullsafe dart), mainly because the dart type system has trust issues from several null reference errors, and when the late variable does *not* have a value (i.e. null) it throws a LateInitializationError.
      There is one more benefit than just removing the bang, the "late" modifier doesn't actually change the type of the variable according to what values are allowed in it, so with a nullable type and then using a bang everywhere you can assign null, with a late modifier and non-nullable type you *cannot* assign null, once it *has* a value it will *always* have a value, even if it changes if the field/variable isn't final
      TL;DR it's like a nullable type you can't assign null, and the dart type system will null-check it for you and throw a LateInitializationError if it's uninitialized, and it signifies it will always be assigned before usage when the type system doesn't know that.

  • @reactiveland3111
    @reactiveland3111 3 ปีที่แล้ว

    common, ? mark. Wasn't it possible to use something like annotations instead?

  • @davidchopin6583
    @davidchopin6583 3 ปีที่แล้ว

    Yay!

  • @pranjal86able
    @pranjal86able 3 ปีที่แล้ว +1

    "Stay null-safe out there", hahaha that's hilarious

  • @nicolasdupere
    @nicolasdupere 3 ปีที่แล้ว

    Flutter forever

  • @MammadBehify
    @MammadBehify ปีที่แล้ว

    Good

  • @kamushekdev
    @kamushekdev 3 ปีที่แล้ว

    Is it possible to write `null!` like in C# 8? :D

    • @filiphracek
      @filiphracek 3 ปีที่แล้ว +1

      Last I checked, yes, it was possible! :) I guess it doesn't go against any of the static rules, though it _is_ silly.

  • @heinzbert3342
    @heinzbert3342 3 ปีที่แล้ว

    take this feature in the compiler instead of tons of lines with questions marks

  • @casul-4891
    @casul-4891 3 ปีที่แล้ว

    Safety can be fun !

  • @gameplaydosabao
    @gameplaydosabao 3 ปีที่แล้ว

    You guys are missing the optional cats tag (as?). This is really important when you’re writing a safe null source code.

    • @hardiannicko
      @hardiannicko ปีที่แล้ว

      It is now possible. For example:
      Color? color = aVariable as Color?

  • @user-v2eqj8xiz4l
    @user-v2eqj8xiz4l 3 ปีที่แล้ว +7

    This feature change everything, now all project make many errors? how deal with old project since they has many variable without question mark?

    • @EdgarFroes
      @EdgarFroes 3 ปีที่แล้ว +3

      Elbow grease the heck out of that project, I say.

    • @redbrogdon
      @redbrogdon 3 ปีที่แล้ว +5

      The Dart team created a tool to help you migrate your code to use null safety: dart.dev/null-safety/migration-guide. There''s still some elbow grease required, but you're not on your own!

  • @erlangparasu6339
    @erlangparasu6339 3 ปีที่แล้ว +1

    why kotlin is not 'sound null safety' ?

    • @filiphracek
      @filiphracek 3 ปีที่แล้ว +1

      Here's an analysis of Kotlin and other languages: github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/roadmap.md#kotlin

  • @NBSgamesOfficial
    @NBSgamesOfficial ปีที่แล้ว +1

    Knowing how annying NullPointerExceptions can be in Java and how NullSafety like this can be from Kotlin and Swift. I am going to love Dart even more than now... I hope it does grow out of java lol. Like. Go on. We have a Dart to javascript transcompiler. And I used it with a Cordova app a while back.