Created
October 23, 2021 11:38
-
-
Save vaygeth89/12bcc3402901ea8ada377c00352f84d0 to your computer and use it in GitHub Desktop.
Serialized model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add this | |
import 'package:json_annotation/json_annotation.dart'; | |
//Add this | |
part 'business_error.g.dart'; | |
//Add this | |
@JsonSerializable() | |
class BusinessError { | |
final String message; | |
final int? businessError; | |
BusinessError({ | |
required this.message, | |
this.businessError, | |
}); | |
//Add this | |
static BusinessError fromJson(Map<String, dynamic> map) => | |
_$BusinessErrorFromJson(map); | |
Map<String, dynamic> toJson() => _$BusinessErrorToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment