mirror of
https://github.com/Myzel394/quid_faciam_hodie.git
synced 2025-06-19 07:35:26 +02:00
added memories_data page to calendar; fixed localization
This commit is contained in:
parent
71cceb0fdc
commit
e5173f9cf1
@ -7,7 +7,12 @@
|
|||||||
|
|
||||||
"welcomeScreenDescription": "Finde heraus was du den ganzen Tag gemacht hast und erlebe Erinnerungen wieder, die du komplett vergessen hast!",
|
"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?",
|
"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",
|
"serverLoadingScreenDescription": "Wir laden deine Daten",
|
||||||
|
@ -12,6 +12,26 @@
|
|||||||
"welcomeScreenViewMemoriesGuideDescription": "...and relieve your best moments at the end of the day!",
|
"welcomeScreenViewMemoriesGuideDescription": "...and relieve your best moments at the end of the day!",
|
||||||
"welcomeScreenGetStartedLabel": "Get started",
|
"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",
|
"serverLoadingScreenDescription": "We are loading your data",
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import 'package:quid_faciam_hodie/models/memories.dart';
|
|||||||
|
|
||||||
import 'calendar_screen/calendar_month.dart';
|
import 'calendar_screen/calendar_month.dart';
|
||||||
import 'calendar_screen/days_of_week_strip.dart';
|
import 'calendar_screen/days_of_week_strip.dart';
|
||||||
|
import 'calendar_screen/memories_data.dart';
|
||||||
|
|
||||||
class CalendarScreen extends StatelessWidget {
|
class CalendarScreen extends StatelessWidget {
|
||||||
static const ID = '/calendar';
|
static const ID = '/calendar';
|
||||||
@ -27,7 +28,7 @@ class CalendarScreen extends StatelessWidget {
|
|||||||
builder: (context, memories, _) => PlatformScaffold(
|
builder: (context, memories, _) => PlatformScaffold(
|
||||||
appBar: isCupertino(context)
|
appBar: isCupertino(context)
|
||||||
? PlatformAppBar(
|
? PlatformAppBar(
|
||||||
title: Text('Calendar'),
|
title: const Text('Calendar'),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
body: Padding(
|
body: Padding(
|
||||||
@ -50,6 +51,10 @@ class CalendarScreen extends StatelessWidget {
|
|||||||
sliver: SliverList(
|
sliver: SliverList(
|
||||||
delegate: SliverChildBuilderDelegate(
|
delegate: SliverChildBuilderDelegate(
|
||||||
(context, index) {
|
(context, index) {
|
||||||
|
if (index == monthMapping.length) {
|
||||||
|
return MemoriesData();
|
||||||
|
}
|
||||||
|
|
||||||
final date = monthMapping.keys.elementAt(index);
|
final date = monthMapping.keys.elementAt(index);
|
||||||
final dayMapping = monthMapping.values.elementAt(index);
|
final dayMapping = monthMapping.values.elementAt(index);
|
||||||
|
|
||||||
@ -59,7 +64,7 @@ class CalendarScreen extends StatelessWidget {
|
|||||||
dayAmountMap: dayMapping,
|
dayAmountMap: dayMapping,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
childCount: monthMapping.length,
|
childCount: monthMapping.length + 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
41
lib/screens/calendar_screen/memories_data.dart
Normal file
41
lib/screens/calendar_screen/memories_data.dart
Normal file
@ -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<Memories>();
|
||||||
|
final localizations = AppLocalizations.of(context)!;
|
||||||
|
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: MEDIUM_SPACE),
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user