-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
604b85d
commit e3cb620
Showing
6 changed files
with
173 additions
and
93 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
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,5 @@ | ||
enum DownloadFilePresentationState { | ||
notDownload, | ||
downloading, | ||
downloaded, | ||
} |
49 changes: 49 additions & 0 deletions
49
lib/presentation/model/chat/downloading_state_presentation_model.dart
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,49 @@ | ||
import 'package:equatable/equatable.dart'; | ||
import 'package:fluffychat/presentation/enum/chat/download_file_state_enum.dart'; | ||
|
||
abstract class DownloadStatePresentationModel with EquatableMixin { | ||
const DownloadStatePresentationModel({ | ||
required this.downloadFilePresentationState, | ||
this.receive, | ||
this.total, | ||
}); | ||
|
||
final DownloadFilePresentationState downloadFilePresentationState; | ||
|
||
final int? receive; | ||
|
||
final int? total; | ||
|
||
@override | ||
List<Object?> get props => [downloadFilePresentationState, receive, total]; | ||
} | ||
|
||
class NotDownloadStatePresentationModel extends DownloadStatePresentationModel { | ||
const NotDownloadStatePresentationModel() | ||
: super( | ||
receive: 0, | ||
total: 0, | ||
downloadFilePresentationState: | ||
DownloadFilePresentationState.notDownload, | ||
); | ||
} | ||
|
||
class DownloadedStatePresentationModel extends DownloadStatePresentationModel { | ||
const DownloadedStatePresentationModel() | ||
: super( | ||
downloadFilePresentationState: | ||
DownloadFilePresentationState.downloaded, | ||
); | ||
} | ||
|
||
class DownloadingStatePresentationModel extends DownloadStatePresentationModel { | ||
const DownloadingStatePresentationModel({ | ||
int? receive, | ||
int? total, | ||
}) : super( | ||
downloadFilePresentationState: | ||
DownloadFilePresentationState.downloading, | ||
receive: receive, | ||
total: total, | ||
); | ||
} |
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
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
Oops, something went wrong.