26 lines
449 B
Dart
26 lines
449 B
Dart
|
import 'package:cookbook/domain/entities/failures/failure.dart';
|
||
|
|
||
|
class FailureModel {
|
||
|
final String message;
|
||
|
|
||
|
FailureModel({required this.message});
|
||
|
|
||
|
factory FailureModel.fromJson(Map<String, dynamic> json) {
|
||
|
return FailureModel(
|
||
|
message: json['message'],
|
||
|
);
|
||
|
}
|
||
|
|
||
|
Map<String, dynamic> toJson() {
|
||
|
return {
|
||
|
'message': message,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
Failure toEntity() {
|
||
|
return Failure(
|
||
|
message: message,
|
||
|
);
|
||
|
}
|
||
|
}
|