File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
tipsandtricks/breaking-strings-in-dart Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments