-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path005_metadata.dart
More file actions
69 lines (55 loc) · 1.26 KB
/
005_metadata.dart
File metadata and controls
69 lines (55 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class Television {
bool _isOn = false; // Televizyonun açık/kapalı durumu
/// Use [turnOn] to turn the power on instead.
@Deprecated('Use turnOn instead')
void activate() {
turnOn();
}
/// Turns the TV's power on.
void turnOn() {
_isOn = true;
print('Television is turned on.');
}
/// Turns the TV's power off.
void turnOff() {
_isOn = false;
print('Television is turned off.');
}
/// Checks if the TV is currently on.
bool isOn() {
return _isOn;
}
}
void main() {
Television tv = Television();
// Televizyonu açıyoruz.
tv.activate();
tv.turnOn();
// Televizyonun açık olduğunu kontrol ediyoruz.
if (tv.isOn()) {
print('Television is currently on.');
} else {
print('Television is currently off.');
}
// Televizyonu kapatıyoruz.
tv.turnOff();
// Televizyonun açık olduğunu tekrar kontrol ediyoruz.
if (tv.isOn()) {
print('Television is currently on.');
} else {
print('Television is currently off.');
}
}
class Todo {
final String who;
final String what;
const Todo(this.who, this.what);
}
@Todo('Dash', 'Implement this function')
void doSomething() {
print('Do something');
}
// create new function
void doSomethingElse() {
print('Do something else');
}