diff --git a/assets/localization/app_cs.arb b/assets/localization/app_cs.arb index 5d0837e..2168dc5 100644 --- a/assets/localization/app_cs.arb +++ b/assets/localization/app_cs.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Zatím žádný plán čtení Bible. Přidej jeden.", "plansPageAddPlanTooltip": "Přidat", "plansPageCardRemainingDays": "{remainingDays}d", + "schedulePageContinueNotice": "Úspěšně jsi vytvořil nový plán čtení Bible! Chceš-li pokračovat v rozvrhu, který jsi již začal, jednoduše vyber poslední část, kterou jsi četl.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Přejít na záložku", "schedulePageEventPrefixTerm": "{prefix, select, a{po} b{př.} other{asi}}", diff --git a/assets/localization/app_de.arb b/assets/localization/app_de.arb index 32eaf1a..b14e35c 100644 --- a/assets/localization/app_de.arb +++ b/assets/localization/app_de.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Noch kein Bibel-Leseplan. Füge einen hinzu.", "plansPageAddPlanTooltip": "Hinzufügen", "plansPageCardRemainingDays": "{remainingDays}T", + "schedulePageContinueNotice": "Du hast erfolgreich einen neuen Bibelleseplan erstellt! Um mit einem bereits begonnenen Leseprogramm fortzufahren, wähle einfach den letzten Abschnitt aus, den du gelesen hast.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Springe zum Lesezeichen", "schedulePageEventPrefixTerm": "{prefix, select, a{n.} b{v.} other{um}}", diff --git a/assets/localization/app_en.arb b/assets/localization/app_en.arb index 0dc19c1..c79890f 100644 --- a/assets/localization/app_en.arb +++ b/assets/localization/app_en.arb @@ -42,6 +42,10 @@ } } }, + "schedulePageContinueNotice": "You have successfully created a new Bible reading plan! To continue with a schedule you have already started, simply select the last section you read.", + "@schedulePageContinueNotice": { + "description": "The notice displayed at the top of the schedule page for a new plan." + }, "schedulePageCardWeekday": "{date}", "@schedulePageCardWeekday": { "description": "Displaying the weekday on the day card on the schedule page.", diff --git a/assets/localization/app_es.arb b/assets/localization/app_es.arb index 5382af7..1ea703c 100644 --- a/assets/localization/app_es.arb +++ b/assets/localization/app_es.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Aún no hay un plan de lectura de la Biblia. Añade uno.", "plansPageAddPlanTooltip": "Añadir", "plansPageCardRemainingDays": "{remainingDays}d", + "schedulePageContinueNotice": "Has creado con éxito un nuevo plan de lectura de la Biblia. Para continuar con un plan que ya has comenzado, simplemente selecciona la última sección que has leído.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Saltar al marcador", "schedulePageEventPrefixTerm": "{prefix, select, a{a.} b{d.} other{c.}}", diff --git a/assets/localization/app_fr.arb b/assets/localization/app_fr.arb index 4c5ae39..3be0937 100644 --- a/assets/localization/app_fr.arb +++ b/assets/localization/app_fr.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Pas encore de plan de lecture de la Bible. Ajoute-en un.", "plansPageAddPlanTooltip": "Ajouter", "plansPageCardRemainingDays": "{remainingDays}j", + "schedulePageContinueNotice": "Tu as créé avec succès un nouveau plan de lecture de la Bible ! Pour continuer avec un plan que tu as déjà commencé, sélectionne simplement la dernière section que tu as lue.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Aller au marque-page", "schedulePageEventPrefixTerm": "{prefix, select, a{apr.} b{av.} other{env.}}", diff --git a/assets/localization/app_hu.arb b/assets/localization/app_hu.arb index d6a6ab9..9db06f4 100644 --- a/assets/localization/app_hu.arb +++ b/assets/localization/app_hu.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Még nincs bibliaolvasási terv. Adj hozzá egyet.", "plansPageAddPlanTooltip": "Hozzáadás", "plansPageCardRemainingDays": "{remainingDays}n", + "schedulePageContinueNotice": "Sikeresen létrehoztál egy új Bibliaolvasási tervet! Ha folytatni szeretnéd a már megkezdett ütemtervet, egyszerűen válaszd ki az utolsó részt, amit olvastál.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Ugrás a könyvjelzőhöz", "schedulePageEventPrefixTerm": "{prefix, select, a{a.} b{b.} other{c.}}", diff --git a/assets/localization/app_it.arb b/assets/localization/app_it.arb index 0a20d32..4fbefe0 100644 --- a/assets/localization/app_it.arb +++ b/assets/localization/app_it.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Ancora nessun piano di lettura della Bibbia. Aggiungine uno.", "plansPageAddPlanTooltip": "Aggiungi", "plansPageCardRemainingDays": "{remainingDays}g", + "schedulePageContinueNotice": "Hai creato con successo un nuovo piano di lettura della Bibbia! Per continuare con un piano che hai già iniziato, seleziona semplicemente l''ultima sezione che hai letto.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Vai al segnalibro", "schedulePageEventPrefixTerm": "{prefix, select, a{a.} b{d.} other{ca.}}", diff --git a/assets/localization/app_pl.arb b/assets/localization/app_pl.arb index 6ae6e73..240cddf 100644 --- a/assets/localization/app_pl.arb +++ b/assets/localization/app_pl.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Brak planu czytania Biblii. Dodaj jeden.", "plansPageAddPlanTooltip": "Dodaj", "plansPageCardRemainingDays": "{remainingDays}d", + "schedulePageContinueNotice": "Udało ci się stworzyć nowy plan czytania Biblii! Aby kontynuować plan, który już rozpocząłeś, po prostu wybierz ostatnią przeczytaną sekcję.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Przejdź do zakładki", "schedulePageEventPrefixTerm": "{prefix, select, a{po.} b{przed.} other{ok.}}", diff --git a/assets/localization/app_pt.arb b/assets/localization/app_pt.arb index 4aab70a..3cc9cbd 100644 --- a/assets/localization/app_pt.arb +++ b/assets/localization/app_pt.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Ainda não há um plano de leitura da Bíblia. Adicione um.", "plansPageAddPlanTooltip": "Adicionar", "plansPageCardRemainingDays": "{remainingDays}d", + "schedulePageContinueNotice": "Você criou com sucesso um novo plano de leitura da Bíblia! Para continuar com um plano que você já começou, basta selecionar a última seção que você leu.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Ir para o marcador", "schedulePageEventPrefixTerm": "{prefix, select, a{a.} b{d.} other{c.}}", diff --git a/assets/localization/app_ro.arb b/assets/localization/app_ro.arb index e80e30d..896e43e 100644 --- a/assets/localization/app_ro.arb +++ b/assets/localization/app_ro.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "Încă nu există un plan de citire a Bibliei. Adaugă unul.", "plansPageAddPlanTooltip": "Adaugă", "plansPageCardRemainingDays": "{remainingDays}z", + "schedulePageContinueNotice": "Ai creat cu succes un nou plan de citire a Bibliei! Pentru a continua cu un plan pe care l-ai început deja, selectează pur și simplu ultima secțiune pe care ai citit-o.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Sari la marcaj", "schedulePageEventPrefixTerm": "{prefix, select, a{d.} b{î.} other{a.}}", diff --git a/assets/localization/app_ru.arb b/assets/localization/app_ru.arb index 964e3d7..e93184c 100644 --- a/assets/localization/app_ru.arb +++ b/assets/localization/app_ru.arb @@ -10,6 +10,7 @@ "plansPageNoPlanYet": "План чтения Библии пока не добавлен. Добавь один.", "plansPageAddPlanTooltip": "Добавить", "plansPageCardRemainingDays": "{remainingDays}д", + "schedulePageContinueNotice": "Ты успешно создал новый план чтения Библии! Чтобы продолжить с планом, который ты уже начал, просто выбери последний прочитанный раздел.", "schedulePageCardWeekday": "{date}", "schedulePageJumpToBookmarkTooltip": "Перейти к закладке", "schedulePageEventPrefixTerm": "{prefix, select, a{a.} b{b.} other{c.}}", diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index a2aa743..f868043 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -254,6 +254,27 @@ void main() async { expect(find.byType(DayCard), findsWidgets); }); + testWidgets('Show continue notice on new plan', (tester) async { + final providerContainer = await getDefaultProviderContainer(tester); + final secondPlanCardFinder = find.byKey( + Key('plan-${providerContainer.read(plansProvider).plans[1].id}')); + await tester.scrollUntilVisible(secondPlanCardFinder, 500.0); + await tester.pumpAndSettle(); + await tester.tap(secondPlanCardFinder); + await tester.pumpAndSettle(); + + expect(find.byKey(const Key('continue-notice')), findsWidgets); + + await tester.tap(find + .descendant( + of: find.byKey(const Key('day-2')), + matching: find.byType(IconButton)) + .first); + await tester.pumpAndSettle(); + + expect(find.byKey(const Key('continue-notice')), findsNothing); + }); + testWidgets('Return to plans page', (tester) async { final providerContainer = await getDefaultProviderContainer(tester); await tester.tap(find.byType(Card).first); diff --git a/lib/src/schedules/presentations/day_card.dart b/lib/src/schedules/presentations/day_card.dart index 504e50e..da890f6 100644 --- a/lib/src/schedules/presentations/day_card.dart +++ b/lib/src/schedules/presentations/day_card.dart @@ -17,48 +17,47 @@ class DayCard extends ConsumerWidget { final int dayIndex; @override - Widget build(BuildContext context, WidgetRef ref) { - return Card( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - children: [ - ...day.sections.asMap().entries.map((section) => SectionWidget( - key: Key('section-${section.key}'), - planId: planId, - section: section.value, - dayIndex: dayIndex, - sectionIndex: section.key)), - ], - )), - Container( - padding: const EdgeInsets.fromLTRB(0, 0, 4, 0), - width: 40, - child: date == null - ? Text((dayIndex + 1).toString(), - key: const Key('day-index'), - style: Theme.of(context).textTheme.bodySmall) - : Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - date!.day.toString(), - key: const Key('date'), - style: Theme.of(context).textTheme.bodySmall, - ), - Text( - context.loc.schedulePageCardWeekday(date!), - style: Theme.of(context).textTheme.bodySmall, - ) - ], - )), - ], + Widget build(BuildContext context, WidgetRef ref) => Card( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + children: [ + ...day.sections.asMap().entries.map((section) => + SectionWidget( + key: Key('section-${section.key}'), + planId: planId, + section: section.value, + dayIndex: dayIndex, + sectionIndex: section.key)), + ], + )), + Container( + padding: const EdgeInsets.fromLTRB(0, 0, 4, 0), + width: 40, + child: date == null + ? Text((dayIndex + 1).toString(), + key: const Key('day-index'), + style: Theme.of(context).textTheme.bodySmall) + : Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + date!.day.toString(), + key: const Key('date'), + style: Theme.of(context).textTheme.bodySmall, + ), + Text( + context.loc.schedulePageCardWeekday(date!), + style: Theme.of(context).textTheme.bodySmall, + ) + ], + )), + ], + ), ), - ), - ); - } + ); } diff --git a/lib/src/schedules/presentations/schedule_page.dart b/lib/src/schedules/presentations/schedule_page.dart index 7fb644c..56914f2 100644 --- a/lib/src/schedules/presentations/schedule_page.dart +++ b/lib/src/schedules/presentations/schedule_page.dart @@ -129,6 +129,15 @@ class _SchedulePageState extends ConsumerState { AsyncValue(:final valueOrNull?) => Column( children: [ LinearProgressIndicator(value: progress), + if (plan.lastDate == null) + Padding( + padding: const EdgeInsets.all(20.0), + child: Text( + context.loc.schedulePageContinueNotice, + key: const Key('continue-notice'), + style: TextStyle(color: Theme.of(context).primaryColor), + ), + ), Flexible( child: CustomScrollView( controller: controller,