Created
October 10, 2022 16:00
-
-
Save demirdev/5be633a53b96a5cbc105f9c14f0774a7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import 'dart:convert'; | |
extension PrettyJson on Object? { | |
String get prettyJson => const JsonEncoder.withIndent( | |
' ', | |
).convert(this); | |
} | |
/// Usage | |
/// | |
print() { | |
"any-object".prettyJson; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment