Convert User Input String To Int - Learn Dart Programming 11

preview_player
Показать описание
In this video we'll learn how to take user input and convert it's type from a String to an Int with Dart.

Whenever we get user input, dart takes that input as a string by default.

But to convert it to an Int, we need to deal with nullability using the ?? operator.

I'll show you how to do that in this video.

#dart #codemy #JohnElder

Timecodes

0:00​​ - Introduction
1:14 - Get User Input
2:06 - Understand The Nullability Problem
3:11 - Int.Parse()
3:45 - Dart ?? Operator
4:41 - Test It Out
4:53 - Conclusion
Рекомендации по теме
Комментарии
Автор

▶ Watch Entire Dart Playlist ✅ Subscribe To My YouTube Channel:
▶ See More At: ✅ Join My Facebook Group:
▶ Get The Code:

Codemycom
Автор

Excellent video, will definitely be watching you more!

nudistofdespair
Автор

Would have been nice to know if the ?? operator actually returns a value to use or whether it mutates the given variable to the assigned value.

johnpearcey
Автор

nice! but how can i do that with a TextEditingController.text ??

maurosergiorodriguesdasilv
Автор

What if text is entered Or any other character form the keyboard other than number?

nikashdeka
Автор

Are you finished with Django Wednesdays/all django related content?

DarcyMiyamoto