Container.fromJson constructor

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

Implementation

factory Container.fromJson(Map<String, dynamic> json) {
  return Container(
    command: (json['command'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    environment: (json['environment'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    image: json['image'] as String?,
    ports: (json['ports'] as Map<String, dynamic>?)?.map(
        (k, e) => MapEntry(k, (e as String).toContainerServiceProtocol())),
  );
}