-
Notifications
You must be signed in to change notification settings - Fork 0
/
present_signed_document_state.dart
64 lines (48 loc) · 1.57 KB
/
present_signed_document_state.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'dart:io' show File;
import 'package:flutter/foundation.dart';
import 'present_signed_document_cubit.dart';
/// State for [PresentSignedDocumentCubit].
@immutable
sealed class PresentSignedDocumentState {
const PresentSignedDocumentState();
PresentSignedDocumentLoadingState toLoading() {
return const PresentSignedDocumentLoadingState();
}
PresentSignedDocumentErrorState toError(Object error) {
return PresentSignedDocumentErrorState(error);
}
PresentSignedLocalDocumentSuccessState toSuccess(File file) {
return PresentSignedLocalDocumentSuccessState(file);
}
@override
String toString() {
return "$runtimeType()";
}
}
class PresentSignedDocumentInitialState extends PresentSignedDocumentState {
const PresentSignedDocumentInitialState();
}
class PresentSignedDocumentLoadingState extends PresentSignedDocumentState {
const PresentSignedDocumentLoadingState();
}
class PresentSignedDocumentErrorState extends PresentSignedDocumentState {
final Object error;
const PresentSignedDocumentErrorState(this.error);
@override
String toString() {
return "$runtimeType(error: $error)";
}
}
class PresentSignedLocalDocumentSuccessState
extends PresentSignedDocumentState {
final File file;
const PresentSignedLocalDocumentSuccessState(this.file);
@override
String toString() {
return "$runtimeType(file: $file)";
}
}
class PresentSignedRemoteDocumentSuccessState
extends PresentSignedDocumentState {
const PresentSignedRemoteDocumentSuccessState();
}