List Method .fold() in Dart and Flutter

preview_player
Показать описание
In this series, we will learn more about different list methods in #Dart and see how we can use them in #Flutter. In this episode we have a closer look at .fold() method in different list types and see how we can use this method to calculate the total amount of prices in a table in a flutter application.

00:00 - Introduction
00:22 - Example one: forEach and fold method explanation on a list of String
03:40 - Example two: fold method on list of integer
04:14 - Example three: fold method on list of object
05:18 - Overview over the boilerplate code
07:14 - fold method in Text Widget
08:26 - Outro

⭐️⭐️Helpful Ressources ⭐️⭐️

Tools we use to grow our YouTube channel
TubeBuddy Review - Manage Your YouTube Channel Easily

Our current YouTube gear

⭐️⭐️Follow us ⭐️⭐️

⭐️⭐️ Support ⭐️⭐️
If you read this so far, thank you once more. If you like to support us, here are some links that could help us a lot.

Donation via Streamlabs - You are free to donate us a small amount, so we can keep up our work.

Рекомендации по теме
Комментарии
Автор

Great Content ! ✌😁 Keep up the good work

RetroPortalStudio
Автор

very nice and simple video keep it 👆 👆

jamshaidmalik
Автор

Very nice description of the .fold() method, thank you!

longtimedeveloper
Автор

What a great topic ...much love sending to you.

ahmednafiunoman
Автор

I like how you pronounce Flutter, thank you for your video.

pvarela
Автор

awesome !!! Thank you so much (from S.Korea)

내신비서
Автор

Interesting, I didn't knew about this method ! Thanks for the video.

esentakos
Автор

Awesome tutorial !! I learnt many things.

WebPhix
Автор

if you get an error in 2021 about num not being int - simply disable null safety. This is a problem with dart not the code.

eliudnjai
Автор

please need Map Properties in Dart and Flutter

actionscript
Автор

how can I replace an item in a list with another item in the same index? (ie delete an item and place another item in the same place as it was)

igorms
Автор

I get error while running this...I think it's a null safety issue...how to resolve please

//Find sum age of all friends and print it.
List<Friend> myFriends = [
Friend(name: 'Mahtab', age: 18),
Friend(name: 'Sara', age: 25),
Friend(name: 'Mathias', age: 32),
Friend(name: 'Alex', age: 22)
];

int sumAge = myFriends.fold(0, (prev, friend) => prev + friend.age);
print(sumAge);
}

ahmedebrahimn