Bucket.fromMap constructor

Bucket.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory Bucket.fromMap(
  Map<String, dynamic> map,
) {
  map = {
    '\$id': "",
    '\$createdAt': "",
    '\$updatedAt': "",
    '\$permissions': [],
    'fileSecurity': false,
    'name': "",
    'description': "",
    'enabled': true,
    'maximumFileSize': 0,
    'allowedFileExtensions': [],
    'compression': "",
    'encryption': true,
    'antivirus': true,
    'transformations': true,
    'stripMetadata': false,
    'totalSize': 0,
    ...map,
  };

  return Bucket(
    $id: map['\$id'].toString(),
    $createdAt: map['\$createdAt'].toString(),
    $updatedAt: map['\$updatedAt'].toString(),
    $permissions: List.from(map['\$permissions'] ?? []),
    fileSecurity: map['fileSecurity'],
    name: map['name'].toString(),
    description: map['description'].toString(),
    enabled: map['enabled'],
    maximumFileSize: map['maximumFileSize'],
    allowedFileExtensions: List.from(map['allowedFileExtensions'] ?? []),
    compression: map['compression'].toString(),
    encryption: map['encryption'],
    antivirus: map['antivirus'],
    transformations: map['transformations'],
    stripMetadata: map['stripMetadata'],
    totalSize: map['totalSize'],
  );
}