aves/plugins/aves_model/lib/src/storage/volume.dart
Thibault Deckers 0584e8ffa7 refactor
2023-03-29 16:03:10 +02:00

31 lines
798 B
Dart

import 'package:equatable/equatable.dart';
import 'package:meta/meta.dart';
@immutable
class StorageVolume extends Equatable {
final String? description;
final String path, state;
final bool isPrimary, isRemovable;
@override
List<Object?> get props => [description, path, state, isPrimary, isRemovable];
const StorageVolume({
required this.description,
required this.isPrimary,
required this.isRemovable,
required this.path,
required this.state,
});
factory StorageVolume.fromMap(Map map) {
final isPrimary = map['isPrimary'] ?? false;
return StorageVolume(
description: map['description'],
isPrimary: isPrimary,
isRemovable: map['isRemovable'] ?? false,
path: map['path'] ?? '',
state: map['state'] ?? '',
);
}
}