SafePrint constructor
SafePrint(})
Implementation
SafePrint(Object? object, {String? prefix = "", String? suffix = "", bool? highlight = false, bool enableRelease = false}) {
if (kDebugMode || enableRelease) {
if(highlight ?? false) {print("#####################################");}
String printableValue = "--SafePrint: $prefix--\n$object\n--$suffix--";
if(printableValue.length <= 800) {
print(printableValue);
} else {
print("#### BIG PRINT ####");
final pattern = RegExp('.{1,800}');
pattern.allMatches(printableValue).forEach((match) => print(match.group(0)));
print("#### BIG PRINT END ####");
}
if(highlight ?? false) {print("#####################################");}
} else {
print("Private Print");
}
}