From ff9f3263aefdd63f1a67e4ebd21929c9a22b71c7 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 13 Apr 2023 17:32:11 +1200 Subject: [PATCH] Format set dates as yyyy-mm-dd --- lib/home_page.dart | 5 +++++ pubspec.lock | 8 ++++++++ pubspec.yaml | 1 + 3 files changed, 14 insertions(+) diff --git a/lib/home_page.dart b/lib/home_page.dart index 5344e56..b1b2745 100644 --- a/lib/home_page.dart +++ b/lib/home_page.dart @@ -7,6 +7,7 @@ import 'package:fmassive/plans_page.dart'; import 'package:fmassive/settings_page.dart'; import 'package:fmassive/timer_page.dart'; import 'package:fmassive/workouts_page.dart'; +import 'package:intl/intl.dart'; import 'package:moor_flutter/moor_flutter.dart'; class HomePage extends StatefulWidget { @@ -160,6 +161,10 @@ class _HomePage extends State<_HomePageWidget> { itemBuilder: (context, index) { return ListTile( title: Text(gymSets[index].name), + subtitle: Text( + "${gymSets[index].reps} x ${gymSets[index].weight}kg"), + trailing: Text(DateFormat("yyyy-MM-dd") + .format(DateTime.parse(gymSets[index].created))), onTap: () async { await Navigator.push( context, diff --git a/pubspec.lock b/pubspec.lock index f5cc1fd..1a73f5f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -392,6 +392,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + url: "https://pub.dev" + source: hosted + version: "0.18.0" io: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b8e0ffc..09a2d83 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -44,6 +44,7 @@ dependencies: moor: ^4.6.1+1 file_picker: ^5.2.9 audioplayers: ^4.0.1 + intl: ^0.18.0 dev_dependencies: flutter_test: