Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 1.0.0

- Initial version.
## 1.0.0
- Initial version.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Guide

Fork this repo, and add/fix the missing code in [/bin/dart_application_1.dart](/bin/dart_application_1.dart)

<img src="errors_in_dart_application_1.dart.png" width="400" alt="To be fixed errors"/>

### Guide
Fork this repo, and add/fix the missing code in [/bin/dart_application_1.dart](/bin/dart_application_1.dart)
<img src="errors_in_dart_application_1.dart.png" width="400" alt="To be fixed errors"/>
60 changes: 30 additions & 30 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.
include: package:lints/recommended.yaml
# Uncomment the following section to specify additional rules.
# linter:
# rules:
# - camel_case_types
# analyzer:
# exclude:
# - path/to/excluded/files/**
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints
# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
94 changes: 51 additions & 43 deletions bin/dart_application_1.dart
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
import 'dart:math';

class Color {
Color(this.value);
final int value;
}

class View {
int id;
Color? color;

View(this.id, {this.color});

@override
String toString() {
return '$id';
}
}

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(<random id>, content: 'Hello' )
*/

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

print('hello: $helloText');
}

void task2() {
List<int> numbers = List.generate(75, (index) => Random().nextInt(10000));

/*
Separate even numbers from the above `numbers` list.
List<int> evenNumbers = ...
*/
print('evenNumbers: $evenNumbers');
}
import 'dart:math';

class Color {
Color(this.value);
final int value;
}

class View {
int id;
Color? color;

View(this.id, {this.color});

@override
String toString() {
return '$id';
}
}

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,
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(<random id>, content: 'Hello' )
*/

int id = Random().nextInt(10000);
var helloText = Text(id, 'Hello');
print('hello: $helloText');
task2();
}

void task2() {
List<int> numbers = List.generate(75, (index) => Random().nextInt(10000));

/*
Separate even numbers from the above `numbers` list.
List<int> evenNumbers = ...
*/
List<int> evenNumbers = numbers.where((element) => element % 2 == 0).toList();
print('evenNumbers: $evenNumbers');
}

8 changes: 5 additions & 3 deletions lib/dart_application_1.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
int calculate() {
return 6 * 7;
}
int calculate() {
return 6 * 7;
}


Loading