-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
import '../interface/json_object.dart'; | ||
|
||
part 'create_flag_request.g.dart'; | ||
|
||
@JsonSerializable() | ||
class CreateFlagRequest extends JsonObject { | ||
/// Barcode of the product. | ||
@JsonKey() | ||
String? barcode; | ||
|
||
/// Type of the flag | ||
@JsonKey() | ||
late String type; | ||
|
||
/// Url of the product | ||
@JsonKey() | ||
late String url; | ||
|
||
/// User ID | ||
@JsonKey(name: 'user_id') | ||
late String userId; | ||
|
||
/// Device ID | ||
@JsonKey(name: 'device_id') | ||
late String deviceId; | ||
|
||
/// Source of the flag | ||
@JsonKey() | ||
late String source; | ||
|
||
/// Confidence of the flag | ||
@JsonKey() | ||
double? confidence; | ||
|
||
/// Image ID of the flag | ||
@JsonKey(name: 'image_id') | ||
String? imageId; | ||
|
||
/// Flavor of the flag | ||
@JsonKey() | ||
late String flavor; | ||
|
||
/// Reason for the flag | ||
@JsonKey() | ||
String? reason; | ||
|
||
/// Comment associated with the flag | ||
@JsonKey() | ||
String? comment; | ||
|
||
/// Created date of the flag | ||
@JsonKey(name: 'created_at') | ||
late DateTime createdAt; | ||
|
||
CreateFlagRequest(); | ||
|
||
factory CreateFlagRequest.fromJson(Map<String, dynamic> json) => | ||
_$CreateFlagRequestFromJson(json); | ||
|
||
@override | ||
Map<String, dynamic> toJson() => _$CreateFlagRequestToJson(this); | ||
} | ||
|
||
enum NutripatrolSource { | ||
@JsonValue('mobile') | ||
mobile, | ||
|
||
@JsonValue('web') | ||
web, | ||
|
||
@JsonValue('robotoff') | ||
robotoff, | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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