Files
base_flutter/lib/features/todos/domain/entities/todo.dart
Phuoc Nguyen 38a33743e6 fix todo
2025-10-03 17:54:39 +07:00

45 lines
1.0 KiB
Dart

import 'package:equatable/equatable.dart';
class Todo extends Equatable {
final int id;
final String title;
final String? description;
final bool completed;
final String userId;
final DateTime? createdAt;
final DateTime? updatedAt;
const Todo({
required this.id,
required this.title,
this.description,
required this.completed,
required this.userId,
this.createdAt,
this.updatedAt,
});
Todo copyWith({
int? id,
String? title,
String? description,
bool? completed,
String? userId,
DateTime? createdAt,
DateTime? updatedAt,
}) {
return Todo(
id: id ?? this.id,
title: title ?? this.title,
description: description ?? this.description,
completed: completed ?? this.completed,
userId: userId ?? this.userId,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
);
}
@override
List<Object?> get props => [id, title, description, completed, userId, createdAt, updatedAt];
}