Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Created July 10, 2020 15:39
Show Gist options
  • Save ashishrawat2911/93ca122be98b843a80d53c12f30ea731 to your computer and use it in GitHub Desktop.
Save ashishrawat2911/93ca122be98b843a80d53c12f30ea731 to your computer and use it in GitHub Desktop.
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