Consolide le lot applicatif watch companion validé : - télémétrie fréquence cardiaque live remontée montre -> téléphone (collecteur watch, adapter Wear Data Layer, persistance Drift, propagation aux écrans historique/programme/profil/exécution) - notifications de séance en arrière-plan côté téléphone (service foreground de statut + passerelle applicative) - finitions montre : chrono d'étape, score d'étape, retrait du bouton "lancer une séance", thème, icônes et polices watch_app Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
927 B
Dart
34 lines
927 B
Dart
import 'package:flutter/services.dart';
|
|
|
|
import '../../application/application.dart';
|
|
|
|
final class MethodChannelSessionNotificationGateway
|
|
implements SessionNotificationGateway {
|
|
const MethodChannelSessionNotificationGateway({
|
|
MethodChannel methodChannel = const MethodChannel(_methodChannelName),
|
|
}) : _methodChannel = methodChannel;
|
|
|
|
static const _methodChannelName = 'gametime.session_notification/methods';
|
|
|
|
final MethodChannel _methodChannel;
|
|
|
|
@override
|
|
Future<void> show(SessionNotificationContent content) {
|
|
return _invokeIgnoringMissingPlugin('show', content.toJson());
|
|
}
|
|
|
|
@override
|
|
Future<void> clear() {
|
|
return _invokeIgnoringMissingPlugin('clear');
|
|
}
|
|
|
|
Future<void> _invokeIgnoringMissingPlugin(
|
|
String method, [
|
|
Object? arguments,
|
|
]) {
|
|
return _methodChannel
|
|
.invokeMethod<void>(method, arguments)
|
|
.onError<MissingPluginException>((_, _) {});
|
|
}
|
|
}
|