annotation property

Annotation? get annotation

The typed annotation that was tapped, or null if the tap missed an annotation (or the payload couldn't be parsed).

Implementation

Annotation? get annotation {
  final j = annotationJson;
  if (j == null || j.isEmpty) return null;
  try {
    final decoded = jsonDecode(j);
    return decoded is Map
        ? Annotation.tryFromJson(Map<String, dynamic>.from(decoded))
        : null;
  } catch (_) {
    return null;
  }
}