Commit 052dcd8

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2023-12-22 17:35:19
remove deprecated color RowDataFieldType variant
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent a40f1a3
Changed files (3)
lib
test
model
export_import
lib/model/export_import/import_field_type.dart
@@ -17,9 +17,6 @@ enum RowDataFieldType {
   pul,
   /// Guarantees [String] is returned.
   notes,
-  @Deprecated('use needlePin instead. Can be removed in code as all colors can be expressed as needle pins')
-  /// Guarantees [MeasurementNeedlePin] is returned.
-  color,
   /// Guarantees that the returned type is of type [MeasurementNeedlePin].
   needlePin;
 
@@ -35,8 +32,6 @@ enum RowDataFieldType {
         return localizations.pulLong;
       case RowDataFieldType.notes:
         return localizations.notes;
-      case RowDataFieldType.color:
-        return localizations.color;
       case RowDataFieldType.needlePin:
         return localizations.color;
     }
lib/model/export_import/record_formatter.dart
@@ -54,8 +54,6 @@ class ScriptedFormatter implements Formatter {
         return int.tryParse(text);
       case RowDataFieldType.notes:
         return text;
-      case RowDataFieldType.color:
-        assert(false);
       case RowDataFieldType.needlePin:
         final num = int.tryParse(text);
         if (num != null) return MeasurementNeedlePin(Color(num));
test/model/export_import/column_test.dart
@@ -64,10 +64,6 @@ void main() {
             expect(decoded.$2, isA<String>().having(
                     (p0) => p0, 'pulse', r.notes));
             break;
-          case RowDataFieldType.color:
-            expect(decoded.$2, isA<Color>().having(
-                    (p0) => p0, 'color', r.needlePin?.color));
-            break;
           case RowDataFieldType.needlePin:
             expect(decoded.$2, isA<MeasurementNeedlePin>().having(
                     (p0) => p0.toJson(), 'pin', r.needlePin?.toJson()));
@@ -127,10 +123,6 @@ void main() {
             expect(decoded?.$2, isA<String>().having(
                     (p0) => p0, 'pulse', r.notes));
             break;
-          case RowDataFieldType.color:
-            expect(decoded?.$2, isA<Color>().having(
-                    (p0) => p0, 'color', r.needlePin?.color));
-            break;
           case RowDataFieldType.needlePin:
             expect(decoded?.$2, isA<MeasurementNeedlePin>().having(
                     (p0) => p0.toJson(), 'pin', r.needlePin?.toJson()));