Fix analyzer warnings

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2021-02-01 13:58:45 +05:30
parent b8e9d8efdc
commit e68a512a3b
8 changed files with 9 additions and 73 deletions
@@ -1,8 +1,3 @@
import 'dart:io';
import 'package:example/main.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter_apns/flutter_apns.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'
hide Message;
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -34,42 +29,3 @@ void showLocalNotification(Event event) async {
),
);
}
Future backgroundHandler(Map<String, dynamic> notification) async {
print('new notification ${notification}');
// final messageId = notification['data']['id'];
//
// final notificationData = await NotificationService.getAndStoreMessage(
// messageId: messageId,
// storeMessageHandler: (messageResponse) {
// return chatPersistentClient.updateChannelState(
// ChannelState(
// messages: [messageResponse.message],
// channel: messageResponse.channel,
// ),
// );
// },
// );
//
// showLocalNotification(
// notificationData.message,
// notificationData.channel,
// );
}
void initNotifications(Client client) {
final connector = createPushConnector();
connector.configure(
onBackgroundMessage: backgroundHandler,
);
connector.requestNotificationPermissions();
connector.token.addListener(() {
if (connector.token.value != null) {
client.addDevice(
connector.token.value,
Platform.isAndroid ? PushProvider.firebase : PushProvider.apn,
);
}
});
}