From 41295c831cf57292ff43ed30e9f90856fc45f897 Mon Sep 17 00:00:00 2001 From: lordmustafa <71147959+lordmustafa@users.noreply.github.com> Date: Sat, 25 Sep 2021 23:31:56 +0300 Subject: [PATCH] Update dart_application_1.dart --- bin/dart_application_1.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/dart_application_1.dart b/bin/dart_application_1.dart index 2404519..ef85af7 100644 --- a/bin/dart_application_1.dart +++ b/bin/dart_application_1.dart @@ -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, @@ -26,9 +33,9 @@ void main() { 2) Create new `Text` object with the following: var helloText = Text(, content: 'Hello' ) */ - + int id = Random().nextInt(10000); - + var helloText = Text(id, content: 'Hello') print('hello: $helloText'); } @@ -39,5 +46,6 @@ void task2() { Separate even numbers from the above `numbers` list. List evenNumbers = ... */ + list evenNumbers = numbers.where((element) => element.isEven).toList(); print('evenNumbers: $evenNumbers'); }