-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-1760: Define state for upload manager
- Loading branch information
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import 'package:fluffychat/app_state/failure.dart'; | ||
import 'package:fluffychat/app_state/success.dart'; | ||
import 'package:matrix/matrix.dart'; | ||
|
||
class UploadFileInitial extends Success { | ||
const UploadFileInitial(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class ConvertStreamToBytesState extends Success { | ||
const ConvertStreamToBytesState(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class GeneratingThumbnailState extends Success { | ||
const GeneratingThumbnailState(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class GenerateThumbnailFailed extends Failure { | ||
const GenerateThumbnailFailed(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class EncryptingFileState extends Success { | ||
const EncryptingFileState(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class EncryptedFileState extends Success { | ||
const EncryptedFileState(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class EncryptFailedFileState extends Failure { | ||
const EncryptFailedFileState(); | ||
|
||
@override | ||
List<Object?> get props => []; | ||
} | ||
|
||
class UploadingFileState extends Success { | ||
final int receive; | ||
final int total; | ||
|
||
const UploadingFileState({ | ||
required this.receive, | ||
required this.total, | ||
}); | ||
|
||
@override | ||
List<Object?> get props => [receive, total]; | ||
} | ||
|
||
class UploadMatrixFileSuccessState extends Success { | ||
final MatrixFile file; | ||
|
||
const UploadMatrixFileSuccessState({ | ||
required this.file, | ||
}); | ||
|
||
@override | ||
List<Object?> get props => [file]; | ||
} | ||
|
||
class UploadMatrixFileFailedState extends Failure { | ||
final dynamic exception; | ||
|
||
const UploadMatrixFileFailedState({ | ||
required this.exception, | ||
}); | ||
|
||
@override | ||
List<Object?> get props => [exception]; | ||
} |