-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added message model and moved to enums
- Loading branch information
1 parent
b2990ea
commit 1978209
Showing
7 changed files
with
496 additions
and
78 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
35 changes: 35 additions & 0 deletions
35
apps/health_campaign_field_worker_app/lib/models/entities/peer_to_peer/message_types.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,35 @@ | ||
import 'package:dart_mappable/dart_mappable.dart'; | ||
|
||
part 'message_types.mapper.dart'; | ||
|
||
@MappableEnum(caseStyle: CaseStyle.upperCase) | ||
enum MessageTypes { | ||
@MappableValue("confirmation") | ||
confirmation, | ||
@MappableValue("chunk") | ||
chunk | ||
} | ||
|
||
@MappableEnum(caseStyle: CaseStyle.upperCase) | ||
enum ConfirmationTypes { | ||
@MappableValue("finalTransfer") | ||
finalTransfer, | ||
@MappableValue("chunk") | ||
chunk, | ||
@MappableValue("failed") | ||
failed, | ||
@MappableValue("finalAcknowledgment") | ||
finalAcknowledgment, | ||
} | ||
|
||
@MappableEnum(caseStyle: CaseStyle.upperCase) | ||
enum MessageStatus { | ||
@MappableValue("success") | ||
success, | ||
@MappableValue("fail") | ||
fail, | ||
@MappableValue("received") | ||
received, | ||
@MappableValue("completed") | ||
completed, | ||
} |
Oops, something went wrong.