ProtoGoogleDuration.fromDynamic constructor

ProtoGoogleDuration.fromDynamic(
  1. Object? json
)

Parses either the field map or the canonical "3.000001s" string form.

Implementation

factory ProtoGoogleDuration.fromDynamic(Object? json) {
  if (json is String) return ProtoGoogleDuration.fromString(json);
  return ProtoGoogleDuration.fromJson((json as Map).cast<String, dynamic>());
}