use clock.now() instead of DateTime.now() for DTO creation timestamps
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:clock/clock.dart';
|
||||
import 'package:game_tracker/data/dto/group.dart';
|
||||
import 'package:game_tracker/data/dto/player.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
@@ -18,7 +19,7 @@ class Game {
|
||||
this.group,
|
||||
this.winner = '',
|
||||
}) : id = id ?? const Uuid().v4(),
|
||||
createdAt = createdAt ?? DateTime.now();
|
||||
createdAt = createdAt ?? clock.now();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:clock/clock.dart';
|
||||
import 'package:game_tracker/data/dto/player.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
@@ -13,7 +14,7 @@ class Group {
|
||||
required this.name,
|
||||
required this.members,
|
||||
}) : id = id ?? const Uuid().v4(),
|
||||
createdAt = createdAt ?? DateTime.now();
|
||||
createdAt = createdAt ?? clock.now();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:clock/clock.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class Player {
|
||||
@@ -7,7 +8,7 @@ class Player {
|
||||
|
||||
Player({String? id, DateTime? createdAt, required this.name})
|
||||
: id = id ?? const Uuid().v4(),
|
||||
createdAt = createdAt ?? DateTime.now();
|
||||
createdAt = createdAt ?? clock.now();
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
|
||||
Reference in New Issue
Block a user