feat: Introduce category selection functionality in NoteEditorScreen and related components
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
const Object _unsetCategoryId = Object();
|
||||
|
||||
// Model: Note
|
||||
// - Representa una nota guardada en la app.
|
||||
class Note {
|
||||
@@ -36,12 +38,16 @@ class Note {
|
||||
DateTime? createdAt,
|
||||
DateTime? updatedAt,
|
||||
double? position,
|
||||
String? categoryId,
|
||||
Object? categoryId = _unsetCategoryId,
|
||||
int? serverVersion,
|
||||
bool? isDeleted,
|
||||
bool? isPermanentlyDeleted,
|
||||
bool? isDirty,
|
||||
}) {
|
||||
final String? resolvedCategoryId = identical(categoryId, _unsetCategoryId)
|
||||
? this.categoryId
|
||||
: categoryId as String?;
|
||||
|
||||
return Note(
|
||||
id: id ?? this.id,
|
||||
title: title ?? this.title,
|
||||
@@ -49,7 +55,7 @@ class Note {
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
updatedAt: updatedAt ?? this.updatedAt,
|
||||
position: position ?? this.position,
|
||||
categoryId: categoryId ?? this.categoryId,
|
||||
categoryId: resolvedCategoryId,
|
||||
serverVersion: serverVersion ?? this.serverVersion,
|
||||
isDeleted: isDeleted ?? this.isDeleted,
|
||||
isPermanentlyDeleted: isPermanentlyDeleted ?? this.isPermanentlyDeleted,
|
||||
|
||||
Reference in New Issue
Block a user