diff --git a/lib/locale/l10n/app_de.arb b/lib/locale/l10n/app_de.arb index 9de2183..b2f23a2 100644 --- a/lib/locale/l10n/app_de.arb +++ b/lib/locale/l10n/app_de.arb @@ -7,7 +7,12 @@ "welcomeScreenDescription": "Finde heraus was du den ganzen Tag gemacht hast und erlebe Erinnerungen wieder, die du komplett vergessen hast!", "welcomeScreenSubtitle": "Was hab ich heute gemacht?", - "welcomeScreenStartButtonTitle": "Loslegen", + "welcomeScreenStartButtonTitle": "Start", + "welcomeScreenCreateMemoriesGuideDescription": "Erstelle Fotos und Videos während des Tages auf...", + "welcomeScreenViewMemoriesGuideDescription": "...und lebe deine Liebelingsmomente des Tages wieder!", + "welcomeScreenGetStartedLabel": "Loslegen", + "welcomeScreenMemoriesDataMemoriesAmount": "Du hast {memoriesAmount} Erinnerungen erstellt", + "welcomeScreenMemoriesDataMemoriesSpanning": "Welche vom {startDateFormatted} bis zum {endDateFormatted} reichen", "serverLoadingScreenDescription": "Wir laden deine Daten", diff --git a/lib/locale/l10n/app_en.arb b/lib/locale/l10n/app_en.arb index 7edae7a..b590ba8 100644 --- a/lib/locale/l10n/app_en.arb +++ b/lib/locale/l10n/app_en.arb @@ -12,6 +12,26 @@ "welcomeScreenViewMemoriesGuideDescription": "...and relieve your best moments at the end of the day!", "welcomeScreenGetStartedLabel": "Get started", + "welcomeScreenMemoriesDataMemoriesAmount": "You have created {memoriesAmount} memories", + "@welcomeScreenMemoriesDataMemoriesAmount": { + "placeholders": { + "memoriesAmount": { + "type": "int" + } + } + }, + "welcomeScreenMemoriesDataMemoriesSpanning": "Spanning from {startDateFormatted} to {endDateFormatted}", + "@welcomeScreenMemoriesDataMemoriesSpanning": { + "placeholders": { + "startDateFormatted": { + "type": "String" + }, + "endDateFormatted": { + "type": "String" + } + } + }, + "serverLoadingScreenDescription": "We are loading your data", diff --git a/lib/screens/calendar_screen.dart b/lib/screens/calendar_screen.dart index 0b675e8..3317e22 100644 --- a/lib/screens/calendar_screen.dart +++ b/lib/screens/calendar_screen.dart @@ -8,6 +8,7 @@ import 'package:quid_faciam_hodie/models/memories.dart'; import 'calendar_screen/calendar_month.dart'; import 'calendar_screen/days_of_week_strip.dart'; +import 'calendar_screen/memories_data.dart'; class CalendarScreen extends StatelessWidget { static const ID = '/calendar'; @@ -27,7 +28,7 @@ class CalendarScreen extends StatelessWidget { builder: (context, memories, _) => PlatformScaffold( appBar: isCupertino(context) ? PlatformAppBar( - title: Text('Calendar'), + title: const Text('Calendar'), ) : null, body: Padding( @@ -50,6 +51,10 @@ class CalendarScreen extends StatelessWidget { sliver: SliverList( delegate: SliverChildBuilderDelegate( (context, index) { + if (index == monthMapping.length) { + return MemoriesData(); + } + final date = monthMapping.keys.elementAt(index); final dayMapping = monthMapping.values.elementAt(index); @@ -59,7 +64,7 @@ class CalendarScreen extends StatelessWidget { dayAmountMap: dayMapping, ); }, - childCount: monthMapping.length, + childCount: monthMapping.length + 1, ), ), ), diff --git a/lib/screens/calendar_screen/memories_data.dart b/lib/screens/calendar_screen/memories_data.dart new file mode 100644 index 0000000..e2086f9 --- /dev/null +++ b/lib/screens/calendar_screen/memories_data.dart @@ -0,0 +1,41 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:quid_faciam_hodie/constants/spacing.dart'; +import 'package:quid_faciam_hodie/models/memories.dart'; +import 'package:quid_faciam_hodie/utils/theme.dart'; + +class MemoriesData extends StatelessWidget { + const MemoriesData({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + final memories = context.watch(); + final localizations = AppLocalizations.of(context)!; + + return Padding( + padding: const EdgeInsets.symmetric(vertical: MEDIUM_SPACE), + child: Center( + child: Column( + children: [ + Text( + localizations.welcomeScreenMemoriesDataMemoriesAmount( + memories.memories.length, + ), + style: getBodyTextTextStyle(context), + ), + const SizedBox(height: SMALL_SPACE), + Text( + localizations.welcomeScreenMemoriesDataMemoriesSpanning( + DateFormat.yMMMd().format(memories.memories.last.creationDate), + DateFormat.yMMMd().format(memories.memories.first.creationDate), + ), + style: getBodyTextTextStyle(context), + ), + ], + ), + ), + ); + } +}