Created
November 12, 2024 11:16
-
-
Save adityagokula2210/1c6b35c4e99461479982665d7f0876df to your computer and use it in GitHub Desktop.
Call Action Enum
This file contains hidden or 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
| enum CallAction { | |
| initiated("initiated"), | |
| cancelled("cancelled"), | |
| unanswered("unanswered"), | |
| ongoing("ongoing"), | |
| rejected("rejected"), | |
| ended("ended"), | |
| busy("busy"), | |
| none(null); | |
| const CallAction(this.value); | |
| final String? value; | |
| @override | |
| String toString() => value ?? ""; | |
| static CallAction? fromValue(String? value) { | |
| for (final option in CallAction.values) { | |
| if (option.value == value) { | |
| return option; | |
| } | |
| } | |
| return null; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment