wip: bloc for files
This commit is contained in:
29
lib/state/app/modules/files/bloc/files_state.dart
Normal file
29
lib/state/app/modules/files/bloc/files_state.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'files_state.freezed.dart';
|
||||
part 'files_state.g.dart';
|
||||
|
||||
@freezed
|
||||
class FilesState with _$FilesState {
|
||||
const factory FilesState({
|
||||
required String currentFolder,
|
||||
required Map<String, List<File>> files,
|
||||
}) = _FilesState;
|
||||
|
||||
factory FilesState.fromJson(Map<String, Object?> json) => _$FilesStateFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
class File with _$File {
|
||||
const factory File({
|
||||
required String path,
|
||||
required bool isFolder,
|
||||
required String name,
|
||||
required DateTime? createdAt,
|
||||
required DateTime? updatedAt,
|
||||
required int? size,
|
||||
required String? mimeType,
|
||||
}) = _File;
|
||||
|
||||
factory File.fromJson(Map<String, Object?> json) => _$FileFromJson(json);
|
||||
}
|
Reference in New Issue
Block a user