Skip to content

Commit

Permalink
Fix tests and upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierPaquet-Rapold committed Nov 8, 2024
1 parent 0b1ba17 commit e8579e7
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 103 deletions.
77 changes: 38 additions & 39 deletions lib/features/schedule/schedule_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -551,44 +551,43 @@ class _ScheduleViewState extends State<ScheduleView>
}

List<Widget> _buildActionButtons(ScheduleViewModel model) => [
IconButton(
icon: const Icon(Icons.ios_share),
onPressed: () {
final translations = AppIntl.of(context)!;
showDialog(
context: context,
builder: (_) =>
CalendarSelectionWidget(translations: translations),
);
},
IconButton(
icon: const Icon(Icons.ios_share),
onPressed: () {
final translations = AppIntl.of(context)!;
showDialog(
context: context,
builder: (_) =>
CalendarSelectionWidget(translations: translations),
);
},
),
if ((model.settings[PreferencesFlag.scheduleShowTodayBtn] as bool) ==
true)
IconButton(
icon: const Icon(Icons.today_outlined),
onPressed: () => setState(() {
model.selectToday();
_analyticsService.logEvent(tag, "Select today clicked");
if (model.calendarFormat == CalendarTimeFormat.day && !(model.settings[PreferencesFlag.scheduleListView] as bool)) {
dayViewKey.currentState?.animateToDate(DateTime.now());
} else if (model.calendarFormat == CalendarTimeFormat.week) {
weekViewKey.currentState?.animateToWeek(DateTime.now());
} else if (model.calendarFormat == CalendarTimeFormat.month) {
monthViewKey.currentState?.animateToMonth(DateTime(DateTime.now().year, DateTime.now().month));
}
})),
IconButton(icon: const Icon(Icons.settings_outlined), onPressed: () async {
await showModalBottomSheet(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(10),
),
if ((model.settings[PreferencesFlag.scheduleShowTodayBtn] as bool) ==
true)
IconButton(
icon: const Icon(Icons.today_outlined),
onPressed: () => setState(() {
model.selectToday();
_analyticsService.logEvent(tag, "Select today clicked");
if (model.calendarFormat == CalendarTimeFormat.day && !(model.settings[PreferencesFlag.scheduleListView] as bool)) {
dayViewKey.currentState?.animateToDate(DateTime.now());
} else if (model.calendarFormat == CalendarTimeFormat.week) {
weekViewKey.currentState?.animateToWeek(DateTime.now());
} else if (model.calendarFormat == CalendarTimeFormat.month) {
monthViewKey.currentState?.animateToMonth(DateTime(DateTime.now().year, DateTime.now().month));
}
})),
IconButton(icon: const Icon(Icons.settings_outlined), onPressed: () async {
await showModalBottomSheet(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(
top: Radius.circular(10),
),
),
context: context,
isScrollControlled: true,
builder: (context) => const ScheduleSettings());
model.loadSettings();
}),
];

),
context: context,
isScrollControlled: true,
builder: (context) => const ScheduleSettings());
model.loadSettings();
})
];
}
Loading

0 comments on commit e8579e7

Please sign in to comment.