Tear-offs | Decoding Flutter

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025

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

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

    Nice! I was waiting so much to use the constructor tear-offs. I got obsessed with clean code practices since I turned on almost every linter rule and the constructors always looked bad without tear-offs.

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

    0:43 "Create a tear off when a what now will do?"
    I lol'd! Good job explaining this! My mnemonic is that tear-off literally *tears off* the parens.

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

    Wow...I've been using tear offs in callbacks but didn't know. I've heard about the new constructor tear feature in Dart and I've been confused because I didn't know what a tear of was. Thank you for this and thank you Dart team

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

    I love this guys' energy for some reason

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

    Surprisingly I have been using this for a while without knowing it was cool 😅

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

    Great content as always.Thank you Craig and flutter team.

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

    Thanks for the explanation of a tear-off. I had been wondering what all this hubbub regarding Dart tear-offs was about. I thought... What even is this new concept Dart has created called tear-offs? So now I know that it really is just syntactic sugar which the Dart compiler expands to a closure calling your function. Makes sense, and saves us from having to type a few more braces and parentheses. And we definitely don't need any extra bracing in our Flutter UI code...

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

    Learned the terms of the concepts that I use daily

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

    I m going mad abt flutter❤️🔥

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

    Good one! Thanks

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

    Great thumbnail ! 👌
    And video, like always

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

    you saved my day👌👌👌👌

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

    Very Nice! I think i Love flutter

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

    Nice done. In case I miss it why are tear-off better then lambda? Is it because of better readability or does it have performance impact. What are the implications, that would nice too, to explain, just for next time. Anyway great video serie

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

      Tear off uses the function object directly, while lambda will create a new function object which will execute the function. Take this with a grain of salt as I assumed it is the same with kotlin (inline function specifically)

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

      Thanks you for your answer. I had same thought 🤣. At least we have a possible explanation for future watchers / readers 😇 - I hope the next time they will decode it directly in the video.

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

      To make the explanation above make more sense!
      It means whenever a stateful widget updates it state, you are creating new lambda functions too!
      But using a tear-off, you are just passing the reference which already exists.

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

    yes thank you, but why ? is there any benchmark available ?

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

    flawless I will refactor my codes tomorrow

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

    Awesome!! Thanks for sharing

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

    This makes the codebase DRY. Very informative!!

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

    Hey flutter team, i was wondering if you can make a episode of "hell ya! Interesting development show" where you just focus on creating beautiful ui. Please🥺

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

    I love you guys @ Flutter team

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

    😆 okay I didn't knew what the tear-offs were but I have been using it for long time 😂😂. Well well well, now I know its name too, it's called tear-offs ❤

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

    Thanks ✌️

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

    It's like a method reference in Java.

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

    Impressive thumbnail!

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

    Amazing

  • @amin.kh0098
    @amin.kh0098 3 ปีที่แล้ว

    Hello My name`s Amin,
    I`d like to learn flutter zero to hero.
    does anybody know any blog or anything else to learn about Flutter Programming ?

  • @I-AmBoredToday
    @I-AmBoredToday 3 ปีที่แล้ว

    Hi! I am new to flutter. So a tear off basically removes the unnecessary use of lambdas.
    So the benefit is:
    1. Clean code practice: Supply the function when it needs to be supplied, call a function when it needs to be called.
    2. Not using lamda when we can do without using it. I guess, it is memory efficient.
    Am I right or am I not?

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

      The main benefit is pretty much cleaner code. You have less opening/closing braces/brackets (which Flutter already needs a billion of already!) and less lines to show the same result.
      You're right that (at least in theory) there's a memory advantage, but a single function has pretty much negligible memory usage on its own, and that's before we consider how the dart compiler probably optimises lambda expressions to save on even more memory anyway!

  • @天之渊
    @天之渊 3 ปีที่แล้ว

    nice

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

    Hello how the hell flutter handle GDRP? I’m stucked after developing app with flutter. There is no information about how to creat GDRP consent for admob when my app is developed in flutter. Help me. Please

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

    Tear-offs work with optional parameters that has n-1 && n != 0.

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

    I always used it but didn't know what its called until now

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

    Someone see CircularLightProgressIndicator widget?

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

    Waiting for video on proper pagination 😳,

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

    YearPicker please

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

    By the way, what you call lambda, i call that anonymous function.

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

      I think Lambda is the original terminology from mathematics, but you're right that they're pretty similar/the same concept.

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

    The Show is great but too many animation for this,
    I mean can you just use minimalism, like compare right and left which is better and which is very good?
    Thank you Flutter Dart Team.

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

      No I like the format

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

    Please disable automatic translation (at least to Russian). It creates misleading title and uses words with wrong meaning. It looks awful.

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

      Oh no! Thanks for telling us this. Would you mind DMing me on Twitter with some of the details? We aim to have useful translations, not silly ones :)