0 purchases
to string pretty
Prints an object pretty.
Installing #
dependencies:
to_string_pretty:
copied to clipboard
import 'package:to_string_pretty/to_string_pretty.dart';
copied to clipboard
Usage #
Basic
var data = ['google', 'apple', 'thanks'];
print(toStringPretty(data));
copied to clipboard
[
google,
apple,
thanks,
],
copied to clipboard
toString()
Code
class ChatMessage {
// member variables, methods...
@override
String toString() => toStringPretty(this, {
'body': message
'sentBy': sentBy,
'sentAt': sentAt,
'group': group,
});
}
print(ChatMessage());
copied to clipboard
ChatMessage {
body: Thanks,
sentBy: ChatUser {
email: [email protected],
name: Liam,
},
sentAt: ChatDateTime {
datetime: 2021-02-21 19:07:00.000,
},
group: Flutter Community,
},
copied to clipboard
Customizing type name.
final json = {
'url': 'https://pub.dev',
'packages': [
'shared_preferences',
'flutter_slidable',
],
'datetime': DateTime.parse('2021-02-18T19:51:57.4139787-07:00'),
'fieldCount': 4,
};
print(toStringPretty('JsonType', json));
copied to clipboard
JsonType {
url: https://pub.dev,
packages: [
shared_preferences,
flutter_slidable,
],
datetime: 2021-02-19 02:51:57.413978Z,
fieldCount: 4,
},
copied to clipboard
Feature requests and Bug reports #
here
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.