Skip to content

Instantly share code, notes, and snippets.

@mariopepe
Created January 23, 2022 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariopepe/57443c1bd35caf7765e70288f0bc64cc to your computer and use it in GitHub Desktop.
Save mariopepe/57443c1bd35caf7765e70288f0bc64cc to your computer and use it in GitHub Desktop.
failures.dart
import 'package:freezed_annotation/freezed_annotation.dart';
part 'failures.freezed.dart';
@freezed
class FailureEntity with _$FailureEntity {
const FailureEntity._(); // This constructor is needed to have custom methods in Freezed.
const factory FailureEntity.serverFailure() = ServerFailure;
const factory FailureEntity.dataParsingFailure() = DataParsingFailure;
const factory FailureEntity.noConnectionFailure() = NoConnectionFailure;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment