How to Create Stateless Widgets - Flutter Widgets 101 Ep. 1

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2018
  • In this first episode of Flutter Widgets 101, Martin Aguinis goes over what Flutter widgets are, how they combine to become interfaces, how to compose with stateless widgets, and more.
    Get started with Flutter → bit.ly/2qu9EP2
    Try a Flutter codelab → bit.ly/Flutter-Codelab
    Watch other episodes in the series → bit.ly/FlutterWidgets101
    Stay tuned and subscribe for latest releases → bit.ly/googledevs
  • НаукаНаука

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

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

    These series will be really helpful, loving flutter more and more every day, good job!

  • @KenPetri
    @KenPetri 5 лет назад +8

    Good to see short, concise but technical explanations of Flutter. Please cover the semantics widgets (for accessibility) at some point in the series.

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

    Great video! A quick suggestion... take advantage of the IDE's "wrap a widget" and "add padding" features (Cmd-.). This also works in VSCode, which makes editing the Flutter code so much easier! Keep up the great work! Looking forward to the series!

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

    Hope these come in faster than once a week. Thanks for the vid.

  • @BO-nn9up
    @BO-nn9up 2 года назад

    Just can say 4 words for his explanations Simple, Quick, Useful, Exciting

  • @YasinIlhan61
    @YasinIlhan61 5 лет назад +34

    This series will be good :) Thanks.

  • @dilshoduskanov
    @dilshoduskanov 2 года назад +1

    Hello everybody ! These videos are pretty awesome and explain the details perfectly. We want to have a lot of videos like this, thank you GOOGLE, thank you all !!!

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

    Thank you so much for all of this flutter stuff. If y'all could, hurry it up so I can finish my school project faster. xD

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

    wandered through lots of articles and books to learn flutter, but this single instruction is just better than those.

  • @chickenbloodmachine
    @chickenbloodmachine 3 года назад +4

    It's worth mentioning at the end that the body of the build() method for DogName could be simplified to return a single Container widget with a Text child.

  • @TashingaPemhiwa
    @TashingaPemhiwa 5 лет назад +36

    5:07 should be StatelessElement

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

    This is really exciting. It seems very easy to build complex apps across platforms. I will try it out to justify this.

  • @nerellavenkatapathidattatr9005

    Really amazing brother.
    Glad to learn flutter from people like you. simply wounderful 🙌🙌❤❤❤❤❤❤

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

    Great! can't wait for the Statefull widget vid :D

  • @caduenglish421
    @caduenglish421 5 лет назад +1

    Flutter rocks, keep up with the good work!

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

    This tutorial series has helped me a lot to understand the differences between stateless widget and stateful widget but I have seen use cases where both are implemented at a time an example use case is where a stateless widget was created first with a home method that calls the stateful widget class. Please I would like to understand why are stateless widget used to call a stateful widget class and why are both used at the same time. This may be a dummy question but it has been a question I had searched on Google and got no answer

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

    Perfect, really very nice, thanks alot.

  • @user-dx4iv4qu7u
    @user-dx4iv4qu7u 3 года назад

    Thank you! 😊
    I watched it today.

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

    10/ 10 good teaching - the reveal at the end had me shook

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

    Perfect. I got it.
    Thank you!

  • @TheT2day
    @TheT2day 5 лет назад +1

    Awesome series

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

    Nicely explained !

  • @themorbidhero2987
    @themorbidhero2987 5 лет назад +10

    Flutter is the Future!

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

    Flutter is great... I can't wait for the new videos ...

  • @LawZist
    @LawZist 5 лет назад +1

    Keep there videos coming!!!

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

    Great job!

  • @groveroq
    @groveroq 4 года назад +1

    Been some time developing apps on Flutter. Sometimes I think how the hell could it be soo easy :). Good job Google.

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

    Thank you for the helpful explanation

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

    Thanks. Flutter is an interesting framework

  • @Smart-workers.VS.Hard-workers
    @Smart-workers.VS.Hard-workers 3 года назад

    Nice presentation bro… Thanks a lot bro

  • @lone.wo1f
    @lone.wo1f 5 лет назад

    Hope this series continues..

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

    beautifully explained.

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

    Great Video. Thks

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

    Excellent video

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

    Hey Flutter Team, from what I see soon you'll end up publishing hundreds of videos. please have your own channel and create playlists. It would be easy to keep track of videos. This is the right time to begin with!!

  • @jpkontreras
    @jpkontreras 5 лет назад +1

    Please release new videos daily or three times a week. Thx

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

    when the next video will be published , is it like the widget series each week ?

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

    Element tree doesn't show 'what actually on screen' , it only have reference/location to that current build widget.
    RenderObject Tree is the actual representation of the screen. RenderObject is created by using configuration details from widget and reference details from element.
    (RenderObject = widget(configuration details) + Element(location details)).
    This how I understood about flutter framework, But after watching this video i'm get confused.
    (Am I right or wrong?)

  • @mohamedhussien4013
    @mohamedhussien4013 2 года назад +1

    Short and to the point.
    I hope I will be a member of any department in Google in the nearest future.

  • @matthewslaton1366
    @matthewslaton1366 3 года назад +1

    why make a difference between stateful and stateless or why split i should say? join them together and then add a switch or boolean that you can set to stateful or stateless, seems like extra work coding wise for something that can just be specified with less code. but whatever, i am not on the flutter dev team. thanks for sharing.

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

    Thanks !

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

    I am a fan of flutter in China. Can I translate this series of videos and upload them to the Chinese website (purely sharing, no profit)? For some well-known reasons, it is difficult for Chinese developers to see these excellent official flutter videos.

  • @ehsanhasin8092
    @ehsanhasin8092 Год назад

    good job

  • @heshansandeepa9471
    @heshansandeepa9471 Год назад

    Very nice

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

    This content is great but i was searching for a long time to find them maybe a new desing in the order in your channel could be help ;)

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

    Flutter is going to be future ❤️

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

    very useful

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

    Defining a const constructor doesn't make every instance of the class a constant, you need to to actually initialise it with the "const" keyword, e.g "const DogName('Nico')"

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

    Stateless, Stateful, Element, etc. Can anyone provide a link that can explain this for dummies. Hard to get my head around such abstract concepts.

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

      abstract? stateless means things doesn't change inside that widget, stateful means you would want to listen to when the values inside that state changes.

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

    Can't wait to use Flutter

  • @elmeroranchero
    @elmeroranchero 3 года назад +1

    Why are they always using sizedbox in these tutorials, isn't there MainAxisAlignment.spaceEvenly for this?

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

    not able to visualize the tree structures :(
    pls include more animation .

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

    A visual of the finished product would help

  • @ucmeytsc7302
    @ucmeytsc7302 Год назад

    New to this, totally lost, will it get easier?

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

    讲的太好了,虽然我一句也听不懂

  • @Akua-hx3rb
    @Akua-hx3rb 20 дней назад

    So I have been working on Flutter soon 2 years but I still don't understand. So you made a parent that it is a Stateless but then you have children widgets that they are mixed with Stateless and Stateful. So you say that if I wanna get data and re-render a widget I should call Stateful.. but my parents is in Stateless. I wish that Flutter can make Stateless and Stateful in to *one* because this give me so much headache and helps us to code better.

  • @plutterpluttery3256
    @plutterpluttery3256 4 года назад +9

    *'adding a padding widget'*
    He is rhyming...

  • @ucmeytsc7302
    @ucmeytsc7302 Год назад

    How can I learn flutter/dart in a simplified manner?

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

    Why we don't use native code like Swift? I'm a developer in IOS for 4 years, I can do everything, This kind of framework create less required of the customer.

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

    What's about performance? We have a lot of StatelessWidgets inside each other and this number of nesting elements will increase .

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

      In most cases, an app can be pretty smart about only rebuilding the widgets it has to when data changes, so most updates only produce a few new widgets. Because Stateless widgets are constants, you can also do things like reuse them at multiple places in the Element tree or cache them for repeated use.
      The team just added some new features to the IntelliJ/Android Studio plugins that report on performance stats, if you're curious about how well one of your apps is performing: groups.google.com/forum/?linkId=52478434#!topic/flutter-dev/oJ55FjL5Izc

  • @TectonicPlate-gu9bs
    @TectonicPlate-gu9bs Год назад

    On 5:08 it is said "stateful element then says, hey, I" why stateful? I thought we were seeing stateless widgets and elements!

    • @ScaryStories84
      @ScaryStories84 Год назад

      Hey there! 🎶 In that particular moment, the mention of "stateful" refers to a concept in music production and not related to widgets or elements. 🎵 If you have any more questions or need recommendations, feel free to ask! 😊

  • @dmitriyobidin6049
    @dmitriyobidin6049 5 лет назад +1

    Sized Box seems more like a hack, rather a good design principle. Can we achieve this without Sized Box?

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

      There are several ways to space things out in a column, including the use of a Padding widget. I recommend having a look at the catalog of layout-related widgets on flutter.io, which has a bunch of options: flutter.io/docs/reference/widgets/layout

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

    How u emulate an iphone on Android Studio bro?

    • @alexr.4409
      @alexr.4409 5 лет назад

      It's flutter

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

      Using Flutter Inspector, you would select 'Toggle Platform' to switch between Android and iOS emulation

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

    Pog!

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

    please create chanel Google devloper indonesia. indonesia lugage

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

    Nyc google

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

    Nice video :) think about putting music in the parts where you dont speak so there won't be any awkward pauses xD cheers

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

    So put stateless widgets inside a stateful widget is one way of handling rebuilding stateless widgets.

  • @mokhefiabdelkrim3815
    @mokhefiabdelkrim3815 5 лет назад +7

    I found this really complicated for this simple interface

    • @devithuotkeo
      @devithuotkeo 5 лет назад +5

      Practice and exploring will make that complication goes away ;)

    • @TheVictorotciV
      @TheVictorotciV 5 лет назад +1

      I think it's pretty simple compared to an arcaic XML file...

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

      sometimes its better to compare it to HTML. first you have to make a bunch of divs, or say UL, LI LI LI, then you have to go set a class, make a new CSS file, link it into your HTML doc, then make a class and share it with the 3 elements, then make CSS code for that class that has the padding and color and etc.. so you could argue that its complicated in everything if you know nothing, but those that know what to do see it as simple. it only becomes simple with memorization and memorization happens with practice.

    • @Alex-vi6fr
      @Alex-vi6fr 5 лет назад +1

      @@TheVictorotciV XML is far easier than this in my opinion

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

    thanks dude . i just newbie. how i'll be master.

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

    It's very confusing to call a widget "stateless". It has a state. The one it was created with. It should've been called ImmutableWidget or something more accurate.

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

      This is a late response but all Widgets (Stateless / Stateful) are actually immutable. You cannot modify Widget objects once initialised. That's why the build method exists: To rebuild the Widget when a change is made.
      State here is a class that stores properties of the Widget that can change.
      Stateful Widgets store an instance of this State class. Again, Stateful Widgets are immutable, so they hold onto that same State object, but State is mutable.
      That State object is where all the modification happens. Essentially the properties inside the State object are the current "state" of a Widget.

  • @alexherrera4763
    @alexherrera4763 5 лет назад +1

    this is so confusing compared to making an app traditionally in Java (understanding how it works, what does what, and how things are related) 🙄😂

    • @jasongoossens
      @jasongoossens 4 года назад +1

      Spend some time following tutorials and you'll be set!

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

    Composition > Configuration.. wow google is really several steps ahead of MS.

  • @ArturKlesun-zq7ns
    @ArturKlesun-zq7ns 3 года назад +1

    this stare scares me...

  • @ElGuapoSalsero
    @ElGuapoSalsero 3 месяца назад

    So I kind of get why Flutter is popular and look past the overtly complicated syntax, but man the documentation is terrible to navigate. I cannot easily find all of the different declarations and how they should interact let alone the different options to use for styling for example. I should be able to read the documentation without watching videos.
    For example. How do I know that SizedBox() exists, or that mainAxisAlignment is an attribute for Column() and what alignment options are available? The Flutter documentation do not easily provide these. I have to bounce between different pages within the Flutter documentation to finally find it AND it just lists a few options for Column() which are the most popular. Good documentation is how W3 schools made it available.

    • @ElGuapoSalsero
      @ElGuapoSalsero 3 месяца назад

      OK Apologies. I just saw you call it the Flutter API reference documentation where all of the packages are listed with every single option in there. It was tough to find but I can finally get everything I need.

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

    Please, I need subtitles in Korean.

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

    El que no apunte aprender Flutter que se dedique hacer Galletas...

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

    In this video, the speed at which you write the code is too slow. You should make it so fast that our eyes can't follow it. Do you really think a beginner can follow this video at that speed?

  • @emreonay4939
    @emreonay4939 3 года назад +4

    omg please blink...

    • @blktux
      @blktux Месяц назад +1

      he did it in 3:04