Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gochev
Copy link

@gochev gochev commented May 24, 2023

  • I solemnly swear that this is all original content of which I am the original author
  • Pull request title is prepended with [language/lang-code] (example [python/fr-fr] or [java/en])
  • Pull request touches only one file (or a set of logically related files with similar changes made)
  • Content changes are aimed at intermediate to experienced programmers (this is a poor format for explaining fundamental programming concepts)
  • If you've changed any part of the YAML Frontmatter, make sure it is formatted according to CONTRIBUTING.md
    • Yes, I have double-checked quotes and field names!

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List<String> explicitList = <String>[]; //new List<String>() is now
List<String> explicitList = <String>[];

I don't understand this comment.

Comment on lines 161 to +163
new Example7Class().sayItFromInstance();
//the new keyword is optional, so this is the same
Example7Class().sayItFromInstance();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (a ?? false) { //if null count as false
if (a ?? false) { // if null count as false

But this could be worded more clearly.

Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants