List.generate (Technique of the Week)

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • Use List.generate to programatically create child widgets of rows, columns, and any widget that doesn’t have a builder constructor.
    List.generate API documentation →goo.gle/3z3QsOS
    [Flutter tutorial] Create mixed lists with different items → goo.gle/4caRpn1
    Watch more Technique of the Week → goo.gle/Flutte...
    Subscribe to Flutter → goo.gle/FlutterYT
    #Flutter #TechniqueOfTheWeek
    Speaker: Eric Windmill
    Products Mentioned: Flutter
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @muhammaduzair9507
    @muhammaduzair9507 3 หลายเดือนก่อน +23

    Now thats a series I'll follow

  • @RICHIRAMDUTT
    @RICHIRAMDUTT หลายเดือนก่อน +1

    Это Словно Рождество))) ПРАЗДНИК!

  • @d.t.a6676
    @d.t.a6676 3 หลายเดือนก่อน +2

    finally , Technique of the week
    Thank You Flutter

  • @trevornatiuk1031
    @trevornatiuk1031 3 หลายเดือนก่อน +19

    If I use List.generate() inside a build method, I will have to generate the list every time I build the widget, no? I feel like if I can avoid having to generate the list every build, I could just run the generate constructor and set that to an inst var.

    • @ahmedmohamed1340
      @ahmedmohamed1340 3 หลายเดือนก่อน

      Use statemanagement to handle build method calls

    • @roman-proshin
      @roman-proshin 3 หลายเดือนก่อน +11

      I’d wrap that logic into a new widget so that the list is only generated when the widget is rebuilt.

    • @mikopiko
      @mikopiko 3 หลายเดือนก่อน +1

      Put it outside the build method?

    • @agustinbjr
      @agustinbjr 3 หลายเดือนก่อน

      Correct. Though It is useful if your List contents depend on a changing state (which rebuilds the widget)

    • @garthbartin
      @garthbartin 3 หลายเดือนก่อน +3

      It's literally just 5 elements. Don't perf optimize something that doesn't take any time.
      You don't bat an eyelid about writing a row with a list literal written out inside of it do you? Well that's constructing the list on every build too (assuming it's not const).
      Part of being good at frontend is learning to forget "time complexity" and other stuff you learned in school-its almost never the bottleneck.

  • @eliezercapuano
    @eliezercapuano 3 หลายเดือนก่อน +4

    The great Flutter❤

  • @TwenTweek
    @TwenTweek หลายเดือนก่อน +1

    Спасибо, всё работает. Ждём новых связок.

  • @xxThemoritzxx
    @xxThemoritzxx 3 หลายเดือนก่อน +5

    very nice.
    can you show us the most efficient way of doing a bottom navigation which will keep its state while switching tabs?
    greets

    • @jimking2692
      @jimking2692 3 หลายเดือนก่อน

      Use pageview then nest the pages in the children

    • @flutterdev
      @flutterdev  3 หลายเดือนก่อน +3

      Thanks, @xxThemoritzxx! This Code With Andrea resource on bottom navigation might shed some light! → goo.gle/3xAoObJ

  • @fernando_s97
    @fernando_s97 3 หลายเดือนก่อน +4

    Awesome initiative

  • @BôBo-b8x
    @BôBo-b8x 29 วันที่ผ่านมา

    Всё проверил, спасибо за связку.

  • @mohammedek6269
    @mohammedek6269 3 หลายเดือนก่อน +2

    Awesome ❤

  • @fille.imgnry
    @fille.imgnry 3 หลายเดือนก่อน +1

    Does it support .degenerate() ?

  • @esvictor
    @esvictor 3 หลายเดือนก่อน +1

    I always use this before consume real API, to test UI

  • @aestheticwildcat
    @aestheticwildcat 2 หลายเดือนก่อน

    Hi, can you please make a video on how we can collaborate on Firebase with Flutter! I am working on an app with my team and facing some problems.

  • @chenchou
    @chenchou 3 หลายเดือนก่อน +3

    where does StarIcon() come from please?

    • @mofidulislam2837
      @mofidulislam2837 3 หลายเดือนก่อน

      Its just an example,Consider it as Icon(Icons.star)

    • @flutterdev
      @flutterdev  3 หลายเดือนก่อน +1

      StarIcon is meant to be a generic widget used to illustrate the example. You could replace it with any other widget like a button or card.

  • @devgauravjatt
    @devgauravjatt 3 หลายเดือนก่อน +1

    Top level 🎚️

  • @codontv1000
    @codontv1000 3 หลายเดือนก่อน +1

    Usefull

  • @Jj_123-q5c
    @Jj_123-q5c 3 หลายเดือนก่อน

    Nice idea

  • @joelsongoncalves9402
    @joelsongoncalves9402 3 หลายเดือนก่อน

    Very cool 🤓

  • @saibotblack
    @saibotblack 3 หลายเดือนก่อน

    Great 🎉

  • @heshansandeepa9471
    @heshansandeepa9471 3 หลายเดือนก่อน

    awesome

  • @omarslimen-s6p
    @omarslimen-s6p หลายเดือนก่อน

    А как закрыть этот арбитраж?

  • @saiphaneeshk.h.5482
    @saiphaneeshk.h.5482 3 หลายเดือนก่อน

    Who's the new host?

  • @azet955
    @azet955 2 หลายเดือนก่อน

    Guys, please I beg u, fix mouse wheel scroll. It's blocking whole web platform

  • @avinashm7490
    @avinashm7490 3 หลายเดือนก่อน

  • @HermisLasty
    @HermisLasty 3 หลายเดือนก่อน

    Hiii

  • @krishna_mahaur
    @krishna_mahaur 3 หลายเดือนก่อน +3

    is flutter still popular?

    • @TheOrator_Ese
      @TheOrator_Ese 3 หลายเดือนก่อน +4

      Why not?

    • @iamvalenci4
      @iamvalenci4 3 หลายเดือนก่อน +3

      more popular than react if you compare it on google trends

  • @kamaravichow
    @kamaravichow 3 หลายเดือนก่อน +2

    Sounds like AI generated voice and flutter team is on auto pilot

  • @aymendenoub2503
    @aymendenoub2503 3 หลายเดือนก่อน +4

    Is Flutter running out of widgets so we're doing "techniques" now?

    • @TheOrator_Ese
      @TheOrator_Ese 3 หลายเดือนก่อน +5

      Which widgets are you lacking when you have dart? Lol skill issue

    • @mikopiko
      @mikopiko 3 หลายเดือนก่อน +1

      Yeah, Widget of the Week could start covering third party packages too?

    • @aymendenoub2503
      @aymendenoub2503 3 หลายเดือนก่อน

      @@TheOrator_Ese I don't lack any widget. I'm just saying

    • @aymendenoub2503
      @aymendenoub2503 3 หลายเดือนก่อน

      @@mikopiko Yeah, also I actually l8ke this techniques thing I was just joking

    • @bitdefend1
      @bitdefend1 3 หลายเดือนก่อน +1

      Cant get this joke😊

  • @flutterkg
    @flutterkg 3 หลายเดือนก่อน +1

    Cool🎉