Created
July 21, 2019 12:34
-
-
Save SAGARSURI/e13cea201a5857c3255d550dfa5fff2f to your computer and use it in GitHub Desktop.
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
| class State<T>{ | |
| State._(); | |
| factory State.success(T value) = SuccessState<T>; | |
| factory State.error(T msg) = ErrorState<T>; | |
| } | |
| class ErrorState<T> extends State<T> { | |
| ErrorState(this.msg) : super._(); | |
| final T msg; | |
| } | |
| class SuccessState<T> extends State<T> { | |
| SuccessState(this.value) : super._(); | |
| final T value; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment