Dart Optional Positional Parameters in Functions. Dart Tutorial for Flutter #6.4

Dart Optional Positional Parameters in Functions. Dart Tutorial for Flutter #6.4

Smartherd

5 лет назад

57,457 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Quvothe
Quvothe - 17.07.2023 16:21

Updated version:

//Optional Positional Parameters
void printCountries(String name1,[String? name2, String? name3]){
print("Name 1 is $name1");
print("Name 2 is $name2");
print("Name 3 is $name3");
}

Ответить
Steve Cooper
Steve Cooper - 18.05.2023 03:17

In Dart 3.0, the code in the video doesn't work. Dart 3.0 has null safety rules that won't allow: func([int parameter]). That function won't compile. So for the examples in the video to compile and run, you'll need to write it as: void printCountries(String name1, [String name2 = "Italy", String name3 = "England"]) { ... Note the equals string syntax.

Ответить
sundhar rajhan
sundhar rajhan - 30.10.2022 08:22

Recent Rules void printCountries(String name1, [String? name2, String? name3])

Ответить
BrainJoy
BrainJoy - 24.05.2022 09:50

Really awesome playlist with all the required information of dart language. Loving it

Ответить
Syeda Komal Shah
Syeda Komal Shah - 22.04.2022 18:47

short videos full of knowledge, i am just loving it.

Ответить
Rudresh S P
Rudresh S P - 09.03.2021 10:27

1.does optional parameters should be always be at the end, ??
2. can we have the only middle parameter as optional..??

Ответить
Fazril Arief Nugraha
Fazril Arief Nugraha - 17.02.2021 07:15

AWESOME!

Ответить
Manik Sony
Manik Sony - 09.10.2020 18:07

you didn't mention that optional parameters must be present at last

Ответить
سيف الشمري
سيف الشمري - 30.09.2020 13:07

you are THEE BEST teacher in the world! thank you very much

Ответить
Mohamed sami Khiari
Mohamed sami Khiari - 31.08.2020 01:20

great tuto

Ответить
Manikandan D
Manikandan D - 14.06.2020 20:14

nice

Ответить
Sai Sasi Kumar Reddy Telluri
Sai Sasi Kumar Reddy Telluri - 06.04.2020 07:52

Nice 👌 Tutorial series ...!

Ответить
Nasir Mehmood
Nasir Mehmood - 28.11.2019 21:29

is it valid on return statements ?

Ответить
Shiva Tiwari
Shiva Tiwari - 26.11.2019 08:34

👍

Ответить
shaul black
shaul black - 31.10.2019 12:25

a. thanks for the great tutorial
b. is there any way to turn parameter String name2 into optional without changing the order?

Ответить
KARTHICKRAJA
KARTHICKRAJA - 08.09.2019 14:02

0m 30 sec
Thanks for your Slide about Parameters
👍👍👍👍👍
3m 35sec
Awesome
Optional Parameter
4m 19sec
Great Guide
Extenslding Optional Parameter

Ответить
Iuri Almeida
Iuri Almeida - 06.06.2019 11:50

does somebody know if i can make like the first parameter opcional and the las one too but keep the second parameter required?

Ответить
Iftee
Iftee - 07.04.2019 18:59

You are awesome bro... Your videos are very detailed and well explained..

Ответить
Defense Mantra
Defense Mantra - 01.01.2019 14:59

how to call function through parameter.


pls anyboddy help

Ответить