Dart Functions - Named and positional arguments

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Quick and straight to the point. You got a new suscriber

somtonnamani
Автор

Nice and Quick explanation. Thank you.

RSUtsha
Автор

Lovely explanation, thank you! I'm currently switching from Kotlin, and this greately helped me understand the concept clearly.

tarapogancev
Автор

your expansion is very good and easy under stable My dart concept is now little bit cleared...thanks

prakashanuvadia
Автор

There is not just two ways to fix them. There is 4 ways: 1) Making them required -> printCustomDiscount({required String name, required int age}) so the values MUST be passed for those named parameters, 2) Assigning a default value -> printCustomDiscount({String name = '"George", int age = 27}), so if the values are not passed then the named params will assume the default values; 3) Making them nullable -> printCustomDiscount({String? name, int? age}), so in case the values are not passed then those named params will be null without any issue; and 4) Making them required but also nullable -> printCustomDiscount({required String?, required name, int? age}), so either the null or the actual value MUST be passed explicitly.

reiniergarcia
Автор

hey, I just realised that Johan is a fellow South African, the use of Rands and accent. represent Johan, represent

makwelewishbert