Skip to content

Commit

Permalink
schedules: show current day divider in badge color
Browse files Browse the repository at this point in the history
  • Loading branch information
wfleischer committed Dec 17, 2024
1 parent 05a95f5 commit 835fac0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -460,15 +460,15 @@ void main() async {

expect(find.byType(Badge), findsNothing);
expect(find.byKey(const Key('target-day')), findsOneWidget);
expect(
(tester.firstWidget(find.byKey(const Key('target-day'))) as Divider)
.color,
Colors.green);

await tester.scrollUntilVisible(find.byKey(const Key('current-day')), 50.0);
await tester.pumpAndSettle();

expect(find.byKey(const Key('current-day')), findsOneWidget);
expect(
(tester.firstWidget(find.byKey(const Key('current-day'))) as Divider)
.color,
Colors.green);

await tester.scrollUntilVisible(find.byKey(const Key('day-81')), -50.0);
await tester.pumpAndSettle();
Expand Down Expand Up @@ -498,10 +498,10 @@ void main() async {
expect((tester.firstWidget(find.byType(Badge)) as Badge).backgroundColor,
Colors.red);
expect(find.byType(Divider), findsNWidgets(2));
expect(find.byKey(const Key('current-day')), findsOneWidget);
expect(find.byKey(const Key('target-day')), findsOneWidget);
expect(find.byKey(const Key('current-day')), findsOneWidget);
expect(
(tester.firstWidget(find.byKey(const Key('target-day'))) as Divider)
(tester.firstWidget(find.byKey(const Key('current-day'))) as Divider)
.color,
Colors.red);

Expand All @@ -523,9 +523,11 @@ void main() async {
'1');
expect((tester.firstWidget(find.byType(Badge)) as Badge).backgroundColor,
Colors.green);
Future.delayed(Duration(seconds: 10));
expect(find.byKey(const Key('target-day')), findsOneWidget);
expect(find.byKey(const Key('current-day')), findsOneWidget);
expect(
(tester.firstWidget(find.byKey(const Key('target-day'))) as Divider)
(tester.firstWidget(find.byKey(const Key('current-day'))) as Divider)
.color,
Colors.green);

Expand Down
2 changes: 1 addition & 1 deletion lib/src/schedules/presentations/schedule_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _SchedulePageState extends ConsumerState<SchedulePage> {
final isCurrentDay = plan.bookmark.dayIndex == index;
final isTargetDay = todayTargetIndex == index;
final dividerColor =
isCurrentDay ? Theme.of(context).colorScheme.primary : badgeColor;
isCurrentDay ? badgeColor : Theme.of(context).colorScheme.primary;
final remainingDays = planNotifier
.getRemainingDays(Bookmark(dayIndex: index, sectionIndex: 0));
final date = plan.withTargetDate && remainingDays != null
Expand Down

0 comments on commit 835fac0

Please sign in to comment.