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

Modified dart_application_1.dart #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions bin/dart_application_1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class View {
}
}


class Text extends View {
string content;
Text(int id, this.content, {Color? color}) : super(id, color: color);
};


void main() {
/*
1) Create class named `Text` that extends/inherits `View` class,
Expand All @@ -26,9 +33,9 @@ void main() {
2) Create new `Text` object with the following:
var helloText = Text(<random id>, content: 'Hello' )
*/

int id = Random().nextInt(10000);

var helloText = Text(id, content: 'Hello')
print('hello: $helloText');
}

Expand All @@ -39,5 +46,6 @@ void task2() {
Separate even numbers from the above `numbers` list.
List<int> evenNumbers = ...
*/
list <int> evenNumbers = numbers.where((element) => element.isEven).toList();
print('evenNumbers: $evenNumbers');
}