From 389f2815795f65decbe8d4ab166cdf68a93d5da8 Mon Sep 17 00:00:00 2001 From: hendrikvanderkaaden Date: Fri, 24 May 2024 12:40:27 +0200 Subject: [PATCH] Fix date format in example --- example/lib/timestamp.dart | 8 ++++++-- example/pubspec.lock | 8 ++++++++ example/pubspec.yaml | 1 + floor_generator/lib/processor/database_processor.dart | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/example/lib/timestamp.dart b/example/lib/timestamp.dart index a60b81b7..8428e419 100644 --- a/example/lib/timestamp.dart +++ b/example/lib/timestamp.dart @@ -1,4 +1,5 @@ import 'package:floor/floor.dart'; +import 'package:intl/intl.dart'; @Embed() class Timestamp { @@ -23,6 +24,9 @@ class Timestamp { @override String toString() { - return 'Timestamp{createdAt: $createdAt, updatedAt: $updatedAt}'; + final DateFormat formatter = DateFormat('yyyy-MM-dd'); + final String formattedCreatedAt = formatter.format(createdAt); + final String formattedUpdatedAt = formatter.format(updatedAt); + return 'Timestamp{createdAt: $formattedCreatedAt, updatedAt: $formattedUpdatedAt}'; } -} \ No newline at end of file +} diff --git a/example/pubspec.lock b/example/pubspec.lock index d6d6de9f..c780dd34 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -311,6 +311,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + url: "https://pub.dev" + source: hosted + version: "0.17.0" io: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 0b074ef2..b25a1d64 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -15,6 +15,7 @@ dependencies: flutter: sdk: flutter sqflite: any # This dependency is needed to solve the problem with warning about transitive dependencies + intl: ^0.17.0 dev_dependencies: analyzer: ^6.4.1 diff --git a/floor_generator/lib/processor/database_processor.dart b/floor_generator/lib/processor/database_processor.dart index 369647cb..4d1f77ba 100644 --- a/floor_generator/lib/processor/database_processor.dart +++ b/floor_generator/lib/processor/database_processor.dart @@ -10,10 +10,10 @@ import 'package:floor_generator/processor/embed_processor.dart'; import 'package:floor_generator/processor/entity_processor.dart'; import 'package:floor_generator/processor/error/database_processor_error.dart'; import 'package:floor_generator/processor/processor.dart'; -import 'package:floor_generator/value_object/embed.dart'; import 'package:floor_generator/processor/view_processor.dart'; import 'package:floor_generator/value_object/dao_getter.dart'; import 'package:floor_generator/value_object/database.dart'; +import 'package:floor_generator/value_object/embed.dart'; import 'package:floor_generator/value_object/entity.dart'; import 'package:floor_generator/value_object/queryable.dart'; import 'package:floor_generator/value_object/type_converter.dart';