-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dart/en] updating the dart examples to work against dart 3.0 #4673
base: master
Are you sure you want to change the base?
Conversation
@@ -199,8 +201,8 @@ class GenericExample<T>{ | |||
const example8List = ["Example8 const array"]; | |||
const example8Map = {"someKey": "Example8 const map"}; | |||
/// Declare List or Maps as Objects. | |||
List<String> explicitList = new List<String>(); | |||
Map<String,dynamic> explicitMaps = new Map<String,dynamic>(); | |||
List<String> explicitList = <String>[]; //new List<String>() is now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List<String> explicitList = <String>[]; //new List<String>() is now | |
List<String> explicitList = <String>[]; |
I don't understand this comment.
new Example7Class().sayItFromInstance(); | ||
//the new keyword is optional, so this is the same | ||
Example7Class().sayItFromInstance(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new Example7Class().sayItFromInstance(); | |
//the new keyword is optional, so this is the same | |
Example7Class().sayItFromInstance(); | |
Example7Class().sayItFromInstance(); |
if (a) { | ||
print("true, a is $a"); | ||
} | ||
a = null; | ||
if (a) { | ||
if (a ?? false) { //if null count as false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (a ?? false) { //if null count as false | |
if (a ?? false) { // if null count as false |
But this could be worded more clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, should just delete this example if "Boolean expressions support implicit conversions" is no longer true?
[language/lang-code]
(example[python/fr-fr]
or[java/en]
)