Add feedback service, reminder diagnostics and smooth week transitions
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../domain/app_snapshot.dart';
|
||||
import '../domain/app_settings.dart';
|
||||
@@ -24,6 +25,7 @@ class AppController extends ChangeNotifier {
|
||||
AppSettings? _demoSettings;
|
||||
Future<void> _queue = Future.value();
|
||||
String? lastError, calendarSyncError;
|
||||
String? reminderErrorCode;
|
||||
ReminderResult reminderResult = const ReminderResult(ReminderStatus.off);
|
||||
List<Course> get visibleCourses => isDemo ? _demo : snapshot.courses;
|
||||
AppSettings get visibleSettings =>
|
||||
@@ -331,10 +333,18 @@ class AppController extends ChangeNotifier {
|
||||
settings,
|
||||
clock(),
|
||||
);
|
||||
} catch (_) {
|
||||
reminderResult = const ReminderResult(
|
||||
reminderErrorCode = null;
|
||||
} catch (error) {
|
||||
reminderErrorCode = error is ReminderSetupException
|
||||
? error.code
|
||||
: error is PlatformException
|
||||
? error.code
|
||||
: error.runtimeType.toString();
|
||||
reminderResult = ReminderResult(
|
||||
ReminderStatus.error,
|
||||
message: '提醒设置未完成,可重试',
|
||||
message: error is ReminderSetupException
|
||||
? error.message
|
||||
: '提醒设置未完成,请点击“检查提醒”后重试。',
|
||||
);
|
||||
}
|
||||
if (snapshot.calendarCleanupPending) {
|
||||
|
||||
Reference in New Issue
Block a user