Created
July 10, 2020 15:39
-
-
Save ashishrawat2911/93ca122be98b843a80d53c12f30ea731 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'; | |
import 'network_exceptions.dart'; | |
part 'api_result.freezed.dart'; | |
@freezed | |
abstract class ApiResult<T> with _$ApiResult<T> { | |
const factory ApiResult.success({@required T data}) = Success<T>; | |
const factory ApiResult.failure({@required NetworkExceptions error}) = | |
Failure<T>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment