Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] added a new parameter to keep track of position of code

Aman Raj01d182a496f9
diff --git a/auth/lib/models/code_display.dart b/auth/lib/models/code_display.dart
index 50c4767eaf..71b74c68f5 100644
--- a/auth/lib/models/code_display.dart
+++ b/auth/lib/models/code_display.dart
@@ -11,6 +11,7 @@ class CodeDisplay {
final int tapCount;
String note;
final List<String> tags;
+ int position;
CodeDisplay({
this.pinned = false,
@@ -19,6 +20,7 @@ class CodeDisplay {
this.tapCount = 0,
this.tags = const [],
this.note = '',
+ this.position = 0,
});
// copyWith
@@ -29,6 +31,7 @@ class CodeDisplay {
int? tapCount,
List<String>? tags,
String? note,
+ int? position,
}) {
final bool updatedPinned = pinned ?? this.pinned;
final bool updatedTrashed = trashed ?? this.trashed;
@@ -36,6 +39,7 @@ class CodeDisplay {
final int updatedTapCount = tapCount ?? this.tapCount;
final List<String> updatedTags = tags ?? this.tags;
final String updatedNote = note ?? this.note;
+ final int updatedPosition = position ?? this.position;
return CodeDisplay(
pinned: updatedPinned,
@@ -44,6 +48,7 @@ class CodeDisplay {
tapCount: updatedTapCount,
tags: updatedTags,
note: updatedNote,
+ position: updatedPosition,
);
}
@@ -58,6 +63,7 @@ class CodeDisplay {
tapCount: json['tapCount'] ?? 0,
tags: List<String>.from(json['tags'] ?? []),
note: json['note'] ?? '',
+ position: json['position'] ?? 0,
);
}
@@ -99,6 +105,7 @@ class CodeDisplay {
'tapCount': tapCount,
'tags': tags,
'note': note,
+ 'position': position,
};
}