Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
dynamic variable dumper
// 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