Created
June 9, 2022 09:31
-
-
Save anovsiradj/8bd4355eb1171b8ef36ade8e6d2fb899 to your computer and use it in GitHub Desktop.
dynamic variable dumper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/a/53765893 | |
class _DumpV1 { | |
@override | |
noSuchMethod(Invocation invocation) { | |
print(invocation.memberName); | |
int index = invocation.memberName.toString().length; | |
for (final e in invocation.positionalArguments) { | |
print(e); | |
if (index < e.toString().length) index = e.toString().length; | |
if (index > 1024) index = 1024; | |
} | |
// https://stackoverflow.com/a/56757506 | |
print('―' * index); | |
} | |
} | |
dynamic dumpV1() { | |
final dynamic dump = _DumpV1(); | |
return dump; | |
} | |
void main() { | |
dumpV1().title_of_this_dump(0, 0.1, [], {}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment