Skip to content

Commit bdcc2a3

Browse files
authored
Create breaking-strings-in-dart.dart
1 parent fc57171 commit bdcc2a3

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// 🐦 Twitter https://twitter.com/vandadnp
2+
// 🔵 LinkedIn https://linkedin.com/in/vandadnp
3+
// 🎥 YouTube https://youtube.com/c/vandadnp
4+
// 💙 Free Flutter Course https://linktr.ee/vandadnp
5+
// 📦 11+ Hours Bloc Course https://youtu.be/Mn254cnduOY
6+
// 🔶 7+ Hours MobX Course https://youtu.be/7Od55PBxYkI
7+
// 🦄 8+ Hours RxSwift Coursde https://youtu.be/xBFWMYmm9ro
8+
// 🤝 Want to support my work? https://buymeacoffee.com/vandad
9+
10+
import 'dart:developer' as devtools show log;
11+
12+
extension Log on Object {
13+
void log() => devtools.log(toString());
14+
}
15+
16+
@immutable
17+
class Person {
18+
final String name;
19+
final int age;
20+
final String address;
21+
22+
const Person(
23+
this.name,
24+
this.age,
25+
this.address,
26+
);
27+
28+
@override
29+
String toString() => 'Name: $name, '
30+
'Age: $age, '
31+
'Address: $address';
32+
}
33+
34+
void testIt() {
35+
const person = Person(
36+
'Vandad',
37+
42,
38+
'123 Main St',
39+
);
40+
// Name: Vandad, Age: 42, Address: 123 Main St
41+
person.log();
42+
}

0 commit comments

Comments
 (0)