feat: 增强日历功能并集成 AgentScope 代理服务
This commit is contained in:
@@ -4,14 +4,19 @@ import 'core/config/env.dart';
|
||||
import 'core/di/injection.dart';
|
||||
import 'core/router/app_router.dart';
|
||||
import 'core/theme/app_theme.dart';
|
||||
import 'core/notifications/local_notification_service.dart';
|
||||
import 'features/auth/data/models/auth_response.dart';
|
||||
import 'features/auth/presentation/bloc/auth_bloc.dart';
|
||||
import 'features/auth/presentation/bloc/auth_event.dart';
|
||||
import 'features/calendar/data/services/mock_calendar_service.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await configureDependencies();
|
||||
|
||||
final notificationService = sl<LocalNotificationService>();
|
||||
await notificationService.initialize();
|
||||
|
||||
final authBloc = sl<AuthBloc>();
|
||||
|
||||
if (Env.isMockApi) {
|
||||
@@ -24,6 +29,15 @@ void main() async {
|
||||
authBloc.add(AuthStarted());
|
||||
}
|
||||
|
||||
try {
|
||||
final now = DateTime.now();
|
||||
final end = now.add(const Duration(days: 90));
|
||||
final events = await sl<CalendarService>().getEventsForRange(now, end);
|
||||
await notificationService.rebuildUpcomingReminders(events);
|
||||
} catch (_) {
|
||||
// ignore startup sync failures
|
||||
}
|
||||
|
||||
runApp(LinksyApp(authBloc: authBloc));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user