import 'package:uuid/uuid.dart'; class Category { Category({ String? uuid, required this.encryptedName, this.serverVersion = 0, this.isDeleted = false, required this.updatedAt, }) : uuid = uuid ?? Uuid().v4(); final String uuid; final String encryptedName; final int serverVersion; final bool isDeleted; final DateTime updatedAt; Category copyWith({ String? uuid, String? encryptedName, int? serverVersion, bool? isDeleted, DateTime? updatedAt, }) { return Category( uuid: uuid ?? this.uuid, encryptedName: encryptedName ?? this.encryptedName, serverVersion: serverVersion ?? this.serverVersion, isDeleted: isDeleted ?? this.isDeleted, updatedAt: updatedAt ?? this.updatedAt, ); } @override bool operator ==(Object other) { if (identical(this, other)) { return true; } return other is Category && uuid == other.uuid; } @override int get hashCode => uuid.hashCode; }