import 'dart:collection'; class NoteData { String body = ""; LinkedHashMap props = LinkedHashMap(); NoteData([this.body, this.props]) { body = body ?? ""; // ignore: prefer_collection_literals props = props ?? LinkedHashMap(); } @override int get hashCode => body.hashCode ^ props.hashCode; @override bool operator ==(Object other) => identical(this, other) || other is NoteData && runtimeType == other.runtimeType && body == other.body && _equalMaps(props, other.props); static bool _equalMaps(Map a, Map b) { if (a.length != b.length) return false; return a.keys .every((dynamic key) => b.containsKey(key) && a[key] == b[key]); } @override String toString() { return 'NoteData{body: $body, props: $props}'; } }