File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
tipsandtricks/colorful-logs-in-flutter Expand file tree Collapse file tree 1 file changed +31
-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 () =>
14+ devtools.log (this ? .toString () ?? '\x 1b[101m\x 1b[30mNULL\x 1b[0m' );
15+ }
16+
17+ void testIt ([
18+ String ? firstName,
19+ String lastName = 'Doe' ,
20+ String ? address = 'NULL' ,
21+ int ? age,
22+ List <Object > list1 = const [],
23+ List <Object >? list2,
24+ ]) {
25+ firstName.log (); // NULL (in colors)
26+ lastName.log (); // DOE
27+ address.log (); // NULL
28+ age.log (); // NULL (in colors)
29+ list1.log (); // []
30+ list2.log (); // NULL (in colors)
31+ }
You can’t perform that action at this time.
0 commit comments