If you know the index it is quite easy, you can just overwrite it. stackoverflow.com/a/63757729/3690032 To find the index you can use methods like indexOf. I hope that helps :)
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 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); }
Very nice explanation
Excelent explanation. Thanks
You are most welcome!
What a great topic ...much love sending to you.
Great Content ! ✌😁 Keep up the good work
very nice and simple video keep it 👆 👆
Very nice description of the .fold() method, thank you!
I am glad that it helped you :)
nice channel ⭐keep going plz
Awesome tutorial... I liked it ..
great it helped a lot
You are very good teacher :)
I like how you pronounce Flutter, thank you for your video.
Thank you so much, you made my day!
You are most welcome :)
awesome !!! Thank you so much (from S.Korea)
You are welcome :)
good video thanks a lot from spain!!!
Awesome tutorial !! I learnt many things.
Thanks ❤
Interesting, I didn't knew about this method ! Thanks for the video.
Great I am very happy that it helps you along your way :)
Thank you
Good one !!!
I am glad that you enjoyed it :)
Thanks
grt & tnx.
Most welcome
well explained 👍
Thank you 🙂
please need Map Properties in Dart and Flutter
♥️♥️
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)
If you know the index it is quite easy, you can just overwrite it.
stackoverflow.com/a/63757729/3690032
To find the index you can use methods like indexOf. I hope that helps :)
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.
Great stuff, thanks Eli :) yes, this was done in a non-null safe environment!
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 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);
}