## Summary - Upgrades 9 direct dependencies and their transitive peers to resolve the CI warning: *"38 packages have newer versions incompatible with dependency constraints"* - Reduces incompatible-version count from **38 → 21** (the remaining 21 are either deliberately pinned, constrained by transitive dep ceilings, or require a separate riverpod 2→3 migration) - Adapts two source files to breaking API changes in the upgraded packages: - `notification_service.dart`: `flutter_local_notifications` 21.x changed positional args to named params (`initialize(settings:…)`, `show(id:…, title:…, body:…, notificationDetails:…)`) - `compose_screen.dart`: `file_picker` 12.x removed `FilePicker.platform` static getter; calls are now `FilePicker.pickFiles()` ## Packages changed | Package | Before | After | |---|---|---| | `go_router` | ^14.8.1 | ^17.2.3 | | `flutter_local_notifications` | ^18.0.1 | ^21.0.0 | | `file_picker` | ^8.0.0 | ^12.0.0-beta.4 | | `mobile_scanner` | ^5.0.0 | ^7.2.0 | | `package_info_plus` | ^8.0.0 | ^10.1.0 | | `share_plus` | ^12.0.2 | ^13.1.0 | | `sqlite3_flutter_libs` | ^0.5.28 | ^0.6.0+eol | | `flutter_lints` | ^4.0.0 | ^6.0.0 | | `flutter_secure_storage` | 10.2.0 | 10.3.0 (patch) | ## Test plan - [x] `flutter analyze` — no issues - [x] Unit tests (324 passed) - [x] Widget tests (116 passed) - [ ] CI full check suite 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Thomas SharedInbox <sharedinbox@thomas-guettler.de> Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/165
48 lines
1.4 KiB
Dart
48 lines
1.4 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
|
|
|
const _kChannelId = 'new_mail';
|
|
const _kChannelName = 'New mail';
|
|
|
|
final _plugin = FlutterLocalNotificationsPlugin();
|
|
bool _initialized = false;
|
|
|
|
Future<void> initNotifications() async {
|
|
try {
|
|
const android = AndroidInitializationSettings('@mipmap/ic_launcher');
|
|
await _plugin.initialize(
|
|
settings: const InitializationSettings(android: android),
|
|
onDidReceiveNotificationResponse: (_) {},
|
|
);
|
|
await _plugin
|
|
.resolvePlatformSpecificImplementation<
|
|
AndroidFlutterLocalNotificationsPlugin>()
|
|
?.requestNotificationsPermission();
|
|
_initialized = true;
|
|
} on MissingPluginException {
|
|
// Plugin not registered on this device; notifications silently disabled.
|
|
} catch (_) {
|
|
// Unexpected initialization failure; notifications silently disabled.
|
|
}
|
|
}
|
|
|
|
Future<void> showNewMailNotification(String accountEmail) async {
|
|
if (!Platform.isAndroid || !_initialized) return;
|
|
await _plugin.show(
|
|
id: accountEmail.hashCode & 0x7FFFFFFF,
|
|
title: 'New mail',
|
|
body: accountEmail,
|
|
notificationDetails: const NotificationDetails(
|
|
android: AndroidNotificationDetails(
|
|
_kChannelId,
|
|
_kChannelName,
|
|
channelDescription: 'Notifications for new incoming mail',
|
|
importance: Importance.high,
|
|
priority: Priority.high,
|
|
),
|
|
),
|
|
);
|
|
}
|