Skip to content

Instantly share code, notes, and snippets.

@ashishrawat2911
Created June 6, 2020 06:38
Show Gist options
  • Save ashishrawat2911/de6237ed6d5eea29e1fbf6c541bcb441 to your computer and use it in GitHub Desktop.
Save ashishrawat2911/de6237ed6d5eea29e1fbf6c541bcb441 to your computer and use it in GitHub Desktop.
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