import 'package:cookbook/domain/entities/failures/failure.dart'; class FailureModel { final String message; FailureModel({required this.message}); factory FailureModel.fromJson(Map json) { return FailureModel( message: json['message'], ); } Map toJson() { return { 'message': message, }; } Failure toEntity() { return Failure( message: message, ); } }