Created
June 6, 2020 06:38
-
-
Save ashishrawat2911/de6237ed6d5eea29e1fbf6c541bcb441 to your computer and use it in GitHub Desktop.
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
import 'package:flutter/foundation.dart'; | |
import 'package:freezed_annotation/freezed_annotation.dart'; | |
part 'result.freezed.dart'; | |
@freezed | |
abstract class Result<T> with _$Result<T> { | |
const factory Result.idle() = Idle<T>; | |
const factory Result.loading() = Loading<T>; | |
const factory Result.success({@required T data}) = Success<T>; | |
const factory Result.failure({@required String reason}) = Failure<T>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment