Endpoint.fromJson constructor

Endpoint.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Endpoint.fromJson(Map<String, dynamic> json) {
  try {
    return serializers.deserializeWith(Endpoint.serializer, json)!;
  } catch (error) {
    // Handle deserialization error gracefully
    print('Error deserializing Endpoint: $error');
    return Endpoint((b) => b
      ..name = ''
      ..code = ''
      ..value = '');
  }
}