diff --git a/bin/dart_application_1.dart b/bin/dart_application_1.dart index 2404519..e292dc7 100644 --- a/bin/dart_application_1.dart +++ b/bin/dart_application_1.dart @@ -17,27 +17,20 @@ class View { } } -void main() { - /* - 1) Create class named `Text` that extends/inherits `View` class, - and has a `String content` property. - Here is the Text constuctor: - Text(int id, this.content, {Color? color}) : super(id, color: color) - 2) Create new `Text` object with the following: - var helloText = Text(, content: 'Hello' ) - */ +class Text extends View{ + String content; + Text(int id, this.content, {Color? color}) : super(id, color: color); +} +void main() { int id = Random().nextInt(10000); - + Text helloText = Text (id, 'Hello', ); print('hello: $helloText'); + task2(); } void task2() { List numbers = List.generate(75, (index) => Random().nextInt(10000)); - - /* - Separate even numbers from the above `numbers` list. - List evenNumbers = ... - */ - print('evenNumbers: $evenNumbers'); -} + List evennumbers = numbers.where((enumber) => enumber % 2 == 0).toList(); + print('evennumbers: $evennumbers'); + } \ No newline at end of file diff --git a/console result.png b/console result.png new file mode 100644 index 0000000..adf980f Binary files /dev/null and b/console result.png differ