Skip to content

Commit

Permalink
fix: refactor source enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Valimp committed Jan 22, 2025
1 parent 290d3fa commit 7525254
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 33 deletions.
11 changes: 0 additions & 11 deletions lib/src/nutripatrol/create_flag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,3 @@ class CreateFlag extends JsonObject {
@override
Map<String, dynamic> toJson() => _$CreateFlagToJson(this);
}

enum NutripatrolSource {
@JsonValue('mobile')
mobile,

@JsonValue('web')
web,

@JsonValue('robotoff')
robotoff,
}
11 changes: 0 additions & 11 deletions lib/src/nutripatrol/create_flag_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,3 @@ class CreateFlagRequest extends JsonObject {
@override
Map<String, dynamic> toJson() => _$CreateFlagRequestToJson(this);
}

enum NutripatrolSource {
@JsonValue('mobile')
mobile,

@JsonValue('web')
web,

@JsonValue('robotoff')
robotoff,
}
12 changes: 1 addition & 11 deletions lib/src/nutripatrol/get_flag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:openfoodfacts/src/nutripatrol/get_ticket.dart';
import 'package:openfoodfacts/src/prices/flavor.dart';

import '../interface/json_object.dart';
import '../utils/nutripatrol_source.dart';

part 'get_flag.g.dart';

Expand Down Expand Up @@ -71,14 +72,3 @@ class Flag extends JsonObject {
@override
Map<String, dynamic> toJson() => _$FlagToJson(this);
}

enum NutripatrolSource {
@JsonValue('mobile')
mobile,

@JsonValue('web')
web,

@JsonValue('robotoff')
robotoff,
}
12 changes: 12 additions & 0 deletions lib/src/utils/nutripatrol_source.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:json_annotation/json_annotation.dart';

enum NutripatrolSource {
@JsonValue('mobile')
mobile,

@JsonValue('web')
web,

@JsonValue('robotoff')
robotoff,
}

0 comments on commit 7525254

Please sign in to comment.