Flutter Tutorial for Beginners #34 - List View Builder

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024

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

  • @mikolajhenzel
    @mikolajhenzel 4 года назад +299

    List from this episode (with Athens url mistake changed):
    List locations = [
    WorldTime(url: 'Europe/London', location: 'London', flag: 'uk.png'),
    WorldTime(url: 'Europe/Athens', location: 'Athens', flag: 'greece.png'),
    WorldTime(url: 'Africa/Cairo', location: 'Cairo', flag: 'egypt.png'),
    WorldTime(url: 'Africa/Nairobi', location: 'Nairobi', flag: 'kenya.png'),
    WorldTime(url: 'America/Chicago', location: 'Chicago', flag: 'usa.png'),
    WorldTime(url: 'America/New_York', location: 'New York', flag: 'usa.png'),
    WorldTime(url: 'Asia/Seoul', location: 'Seoul', flag: 'south_korea.png'),
    WorldTime(url: 'Asia/Jakarta', location: 'Jakarta', flag: 'indonesia.png'),
    ];

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

      Thank you so much. Saved me some time :)

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

      @@juniorlanga4505 np :) but i didnt change mistake with berlin/athens, now its changed, so if you want it to work properly, you need to recopy this or change it on ur own

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

      @@mikolajhenzel it worked like a charm... Thanks again.

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

      You are awesome man ,Many thanks

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

      @@tahanabil8269 np

  • @neophyte88
    @neophyte88 3 года назад +28

    For those getting an error with the flag images
    - stop the app by clicking the red square button on the left of the hot restart button ...then run it again from the run button at the top..(this worked for me
    - try changing assets/ to assets/images in the pubspec file...then change it back to assets/ and get dependencies
    - try running 'flutter clean' in a terminal

    • @studentshaikh1054
      @studentshaikh1054 2 года назад +2

      thank you very much it worked may god bless you

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

      'flutter clean' ruined my code for fucks sake dude

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

      ran 'flutter pub get' after that. still doesn't work

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

      @@nielfollero5 man I'm sorry if it messed up your code... I commented what worked for me at the time and apparently people used it and it worked...I haven't worked on flutter in a while now...i guess I'll delete the comment if it's messing things up...sorry again

    • @nielfollero5
      @nielfollero5 2 года назад +3

      @@neophyte88 I tried googling about it. For some reason you have to save(ctrl-s) pubspec.yaml in order to make it work again. I was just shocked by those red underline I thought your comment was for trolling.

  • @fawaazshaikh5997
    @fawaazshaikh5997 10 месяцев назад +4

    For those who are getting error for setting Title, try this : title: Text(locations[index].location!)

  • @adewaleajayi3757
    @adewaleajayi3757 3 года назад +11

    Oh goodness, you are such a great teacher. You make flutter app development a breeze. Thank you so much for this course, you made me enjoy this so much. I would be saying bye bye to Ionic now. I am thrilled!!!!

  • @tahirdevlog2047
    @tahirdevlog2047 4 года назад +105

    I do not understand what kind of creature can give dislike to this tutorial

    • @vicyoslinuxofficial2607
      @vicyoslinuxofficial2607 4 года назад +2

      Me too.

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

      doğru valla

    • @andreranulfo-dev8607
      @andreranulfo-dev8607 4 года назад +4

      Most of times, people give deslikes to the ads but instead of click on the icon in the ad, people make the mistake to click on the in-page deslike.

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

      @@andreranulfo-dev8607 I have never heard that before, interesting...

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

      @@andreranulfo-dev8607 Oh wow😂🤣

  • @user-jh2xi1ck8u
    @user-jh2xi1ck8u 4 года назад +6

    You can get the square flag's images from the below link.
    (Egyptian)
    www.countryflags.com/en/egypt-flag-clipart.html
    (Germany)
    www.countryflags.com/en/germany-flag-clipart.html
    (Greece)
    www.countryflags.com/en/greece-flag-clipart.html
    (Indonesia)
    www.countryflags.com/en/indonesia-flag-clipart.html
    (Kenyan)
    www.countryflags.com/en/kenya-flag-clipart.html
    (Korea)
    www.countryflags.com/en/south-korea-flag-clipart.html
    (UK)
    www.countryflags.com/en/united-kingdom-flag-clipart.html
    (USA)
    www.countryflags.com/en/united-states-flag-image.html

  • @kinga3684
    @kinga3684 4 года назад +14

    Wow! This tutorial is so awesome

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

    Thank you so much, I learnt alot. Explaining things people brush over like context, and it just makes sense now with a quick mention and example. Not just context too, you did much more. Cheers. Will be watching more.

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

    i just start my first flutter by you're tutorial,now im creating many apps thanks your
    good teacher.

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

    I loved your entire tutorial! Very structured and considered every aspect so that your students don't get confused or overwhelmed. Thank you so much for making this :)
    Also, one thing I personally found helpful is to press Alt + enter whenever I need to import some file by moving the cursor to the usage (red line in code).

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

      That's great to hear Sudhanshu, glad it was helpful!

  • @JavierLopez-xu9ro
    @JavierLopez-xu9ro 4 года назад +7

    This was a great tutorial. Thanks to your dedication I was able to understand Flutter! Awesome channel. Looking forward to more videos!

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

      Glad it was helpful! :)

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

    if you cant load flags images just run on consle
    "flutter clean"
    Then save "pubspec.yaml" file >> ctrl+s

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

      flutter:
      # The following line ensures that the Material Icons font is
      # included with your application, so that you can use the icons in
      # the material Icons class.
      uses-material-design: true
      assets:
      - assets/
      //it will read all files from assets folder

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

    If you get an error as "Exception caught by image resource service" just change your image file type which is in png to jpg ...It Worked for me

  • @alexboyd2693
    @alexboyd2693 2 года назад +3

    I just started with Flutter, and your videos are great! Any chance you might update them to accommodate the new null safety that has been introduced?

  • @ahjed7397
    @ahjed7397 3 года назад +21

    if u have " The argument type 'WorldTime' can't be assigned to the parameter type 'String'.
    - 'WorldTime'"
    Just add .toString() to
    like here
    title: Text(locations[index].location.toString()),

  • @maxijoker1
    @maxijoker1 2 года назад +4

    I know this is old but, does it make any difference that the "choose location" class is stateful even though it never uses the set state function? Great tutorials by the way!!! :)

  • @Mark-nm9sm
    @Mark-nm9sm Год назад

    Very nice tutorial , 100% enjoyed it , finished it in 4 days sad that next one is the last video .
    One thing to note as I am greek, you put berlin in url of Athens xD regardless great series!

  • @ilyesmerzouk6682
    @ilyesmerzouk6682 4 года назад +2

    great one ;NOTE: you have used the BERLIN url for GREECE

  • @mojohit-games2208
    @mojohit-games2208 4 года назад +1

    You are very kind to make the time for this awesome course thank you

  • @vamshikrishna4679
    @vamshikrishna4679 16 дней назад

    good tutorial 👍. Thank you so much for this course.

    • @NetNinja
      @NetNinja  15 дней назад

      You are welcome! :) don't forget to check out our update Flutter crash course too: ruclips.net/video/j_rCDc_X-k8/видео.html

  • @dharmang
    @dharmang 4 года назад +2

    Finally wanted to learn List View a lot :D i dunno its my favourite widget lol at the moment. 🥳

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

    You don't know hoe much you help me. Thank you sooooooo much.

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

    Huhu bless u,, ur tutorials so good even noobs like me understand

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

    Thus far, I'm favoring the _List View Builder_ method. Thx!
    Actually, I have yet to see any method I don't like! lol

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

    thank you so much man for the great content

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

    Brother, you surely know how to teach. Thank you sensei 🙏

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

    love you bro, all your videos are love

  • @Cho1279624
    @Cho1279624 4 года назад +2

    It's beautiful!!!!!

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

    This is really well explained.

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

    Amazing videos, Sir ! Waiting for advanced flutter playlist..

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

    The best!!!!!! Thank youuuuuuuuu!!!

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

    you are great, keep going man... . thanks for this best tutorial course

  • @kameshparashar
    @kameshparashar 3 года назад +2

    I am making a news app which takes news from an api, so instead of hardcoding the available timezones like shown in the video I want it to update and add the news cards automatically from the api. How can I do it?

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

    Wow 🇪🇬 Egypt Flag is Here :D :D

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

    Great video, thank you!!

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

    That desktop background similar to soul land anime :D

  • @user-kw9cu
    @user-kw9cu 4 года назад +1

    You added this video twice in the playlist

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

    Thank you :)

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

    Thank you!

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

    Thanks, it was a great video
    Can you make a video on GridView as well please.

  • @pranavjeurkar6848
    @pranavjeurkar6848 4 года назад +2

    Hey i just tried to add some different locations in list like Asia/Kolkata but it not showing the correct time?It is showing half an hour late time.Can you just tell me why is it showing so?

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

      yeah so utc_offset is only being calculated till the first digit i.e 5 so the +05:30 is being rounded off to 05 which is causing you the troble

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

      to solve this calculate another offset for minutes and substring the 30 and then add it to now

  • @ashiqullahmg
    @ashiqullahmg 3 года назад +2

    You may use this asset for flags. iconscout.com/icon-pack/country-flags

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

    Great tutorial!
    I facing a problem actually I am working on a like button similar Facebook has. if a user has a login then he will be able to like or unlike the post. using a listview builder for it. if you have an idea or have code then please share it with me. Thanks

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

    hi,
    thank you for the tutorial... but there is a error when i am using ListView.builder. It sais: horizontal viewport was given unbounded height.
    would be nice if someone could help me out. thanks....
    P.S. i waant to use a horizontal listview

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

    can you use .map function to access from list instead of listViewBuilder?

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

    Thank yu sensei

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

    Anyone else having list no longer usable due to depreciation?
    THX in advance

  • @7icod
    @7icod 4 года назад +1

    Hello man can you help me!!
    I'm trying to get two different data then put it in two listview in the same page in flutter

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

    Think you messed up with Athen and Berlin in your locations list haha

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

    Guys, if someone is having problems with finding flags, there is a site called countryflags.com. It is excellent!

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

    can u make a tutorial on how to deal with listview builder when the data is of type "Future ". I dont know how to display this type of data using listview. Can u help plz.

  • @udaynj
    @udaynj 4 месяца назад

    How is the context able to know what the locations list is and iterate through that list? That's not clear to me. Can someone help?

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

    Devil lies in the details ;)

  • @andreranulfo-dev8607
    @andreranulfo-dev8607 4 года назад

    Wow!!!!!!!!!!

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

    Thanks for the whole series, I am just unable to understand, why is it showing the times of south and North American countries wrong.
    If anyone knows the reason, please tell me.

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

    Hello you can start with onesignal ios and android 🙏

  • @user-fg3hs6or3o
    @user-fg3hs6or3o Год назад +1

    Hey everyone, I have one small doubt,, when I write Asia/Kolkata at that time it showing 30minutes behind of current time. why is it happening?

    • @parthdasawant
      @parthdasawant Год назад +1

      because Asia/Kolkata has offset is +5:30 where London has +01:00 and the method shown in video only considered the hour part of the offset.

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

      String offset = data['utc_offset'].substring(1,3);
      String min_offset =data['utc_offset'].substring(4,6); //NEW CODE
      DateTime now = DateTime.parse(datetime);
      now = now.add(Duration(hours: int.parse(offset), minutes: int.parse((min_offset)))); //NEW CODE

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

    I always getting an error of height while returning Container inside listview.builder??

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

    whats the difference between onTap and onPressed

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

    it shows a blank grey page when I run this app on my android. please reply . it will be a great help. thanks

  • @piyushkumar-vy9cq
    @piyushkumar-vy9cq Год назад

    caught error:NoSuchMethodError: The method 'substring' was called on null.
    Receiver: null
    Tried calling: substring(1, 3)
    can someone help me out with this error

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

    How to put two listview builders in the body?

  • @emmanuelsahrsewah
    @emmanuelsahrsewah 4 года назад +4

    Hi boss ninja... firstlythanks for the tutorial so far.. i have been following along until now i have got to a point that i am stuck.. loading the images from my assets folder into the cirlcle avatar in the leading properting in the Listtiles widgets don't seems to be working .. i am getting this error: Unable to load asset: assets/greece.png

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

      have you added the image to your project?
      And if yes, then have you added it to your pubspec.yaml?
      check out this link:
      flutter.dev/docs/development/ui/assets-and-images

    • @erzloh
      @erzloh 4 года назад +4

      I got the same error here is what i did:I opened up the pubspec.yaml file, and in assets, under assets/, i added the full path of one image (assets/uk.png) then i saved and i retried and it worked. Then i could remove the full path code and just keep "assets/" and it still worked!

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

      @@erzloh YEah sure.. thanks that fixed it

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

      @@erzloh thank you. it solved mine problem too.

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

      @@erzloh This worked!

  • @sarahismail-ob4is
    @sarahismail-ob4is 4 года назад

    Hai, how do I make a list that contains classes ? Is it possible ? Thank you !

  • @williamtheodorlehn-schiler7224
    @williamtheodorlehn-schiler7224 3 года назад

    Does anyone know if it is possible to position a list of widget? I want to place a list of images in specific positions, any help?

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

    Anyone has a problem with the "null to bool " thing ? If anyone has a solution for this please tell me as i'm stuck in this problem for 2 weeks now !

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

      me too, i can't seem to find the solution

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

      try to write late before bool

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

      I found the solution. Sorry I am 2 years late, but let me know if you still need the answer.

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

    how to show ads between a nth element

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

    why we only have Berlin and Nairobi here :))

  • @amitsrivastava4584
    @amitsrivastava4584 4 года назад +5

    I faced a problem with this tutorial. When I was loading the country flag, my choose location screen stopped functioning. This was because it couldn't locate the image.
    This can be solved:
    1. By adding manually all the location of countries flag in pubspec.yaml.
    2. In home.dart, I replaced $bgImage with greece.png, hot restart. Then I replaced it with uk.png and so on. Finally I reverted back to $bgImage. I don't know why but it worked. I think that choose_location.dart is unable to find the file but once we use the image file it is able to locate. Can anyone tell why this problem arises.

    • @hauntedspear5728
      @hauntedspear5728 4 года назад +2

      yup i also have this error, what I do is
      1. rename the assets/ to assets/images. Click save and get dependencies
      2. Then rename back to assets/ again. Click save and get dependencies
      3. Go to android studio terminal, and run flutter clean
      I think this error occur when we move the image to assets folder and try to get dependencies, where the android studio cannot load a lot of image at the same time
      I hope this help, this is my reference
      stackoverflow.com/questions/53659809/fluttererror-unable-to-load-asset

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

      @@hauntedspear5728 thanks. you save my day!

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

      Same problem. Stopped the app, hot restarted, problem solved!

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

      Faced the same problem, simply changed a random thing on pubspec and then did get dependencies, it worked!

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

      @@hauntedspear5728 I am still unable to do so .

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

    the flags are not being displayed for me. "Exception caught by image resource service The following assertion was thrown resolving an image codec:
    Unable to load asset: assets/uk.png" I get this message for all the images. The paths are correct

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

      did you solve this getting the same error

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

      I have zero idea why this worked, but I added assets/uk.png directly to pubspec, then I changed the isDaytime bgImage to uk.png. That forced it to load. then I was able to delete the assets/uk.png line in pubspec (leaving just assets/), change all the code back, and now it worked for some reason.

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

      @@callowclay3021 I am still facing the same issue .

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

      @@codemantis5986 Were you able to solve ?

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

    Source code pls

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

    hello shaun .
    i am trying to make an app that get data from sharedpreferences and put then in a list then show them with an listview builder .
    lets say that the length of list is N, my problem is that the listview shows only N-1 items .

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

    is it just me or is the git branch containing the material completly empty?
    For the once looking for flags:
    github.com/hjnilsson/country-flags

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

      It's all there in the master branch inside any of the size directories.

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

      @@disizanand The url I provided is a different one: The NET Ninja github is found here: github.com/iamshaunjp/flutter-beginners-tutorial but only contains a Readme.md file.
      I looked a bit further and in a branch called Lesson 34 the files can be found: github.com/iamshaunjp/flutter-beginners-tutorial/tree/lesson-34/world_time_app/assets

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

    Maybe you realized that this video is duplicated :)

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

    If you are getting this error "I/vndksupport(28805): sphal namespace is not configured for this process. Loading /vendor/lib64/hw/gralloc.msm8998.so from the current namespace instead"
    1. Install the app
    2. Then restart the device. Then open the app. It works perfect.
    Been told it's a security issue with regards to android settings.

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

    is any one else getting these errors every time u edit the source code?
    caught error: HandshakeException: Connection terminated during handshake
    E/flutter (19845): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: LateInitializationError: Field 'isDayTime' has not been initialized.