From 4a7bc30f1077832fe57b64d82e511c8932f1642c Mon Sep 17 00:00:00 2001 From: TheLastGimbus Date: Sat, 23 Oct 2021 19:38:48 +0200 Subject: [PATCH] Implement toString nicely --- lib/receive_intent.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/receive_intent.dart b/lib/receive_intent.dart index de44d0c..7a74aa6 100644 --- a/lib/receive_intent.dart +++ b/lib/receive_intent.dart @@ -54,6 +54,13 @@ class Intent { "categories": categories, "extra": extra, }; + + @override + String toString() { + if (isNull) return 'Intent(null)'; + var str = 'Intent${toMap()}'; + return str.replaceFirst('{', '(').replaceFirst('}', ')', str.length - 1); + } } class ReceiveIntent {