FilesPage.fromJson constructor

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

Implementation

factory FilesPage.fromJson(Map<String, dynamic> json) => FilesPage(
  entries: (json['entries'] as List)
      .map((value) {
        final entry = (value as Map).cast<String, dynamic>();
        return StorageEntry(
          name: entry['name'] as String,
          isFolder: entry['is_folder'] as bool,
          size: entry['size'] as int?,
          createdAt: entry['created_at'] == null ? null : DateTime.parse(entry['created_at'] as String),
          updatedAt: entry['updated_at'] == null ? null : DateTime.parse(entry['updated_at'] as String),
        );
      })
      .toList(growable: false),
  continuationToken: json['continuation_token'] as String?,
);