Skip to content

Commit 3a45399

Browse files
rajveermalviyagnprice
authored andcommitted
notif [nfc]: Remove unused FlutterLocalNotificationsPlugin bindings
1 parent 0fc0a0f commit 3a45399

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

lib/model/binding.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:file_picker/file_picker.dart' as file_picker;
55
import 'package:firebase_core/firebase_core.dart' as firebase_core;
66
import 'package:firebase_messaging/firebase_messaging.dart' as firebase_messaging;
77
import 'package:flutter/foundation.dart';
8-
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
98
import 'package:image_picker/image_picker.dart' as image_picker;
109
import 'package:package_info_plus/package_info_plus.dart' as package_info_plus;
1110
import 'package:url_launcher/url_launcher.dart' as url_launcher;
@@ -161,9 +160,6 @@ abstract class ZulipBinding {
161160
/// Wraps [firebase_messaging.FirebaseMessaging.onBackgroundMessage].
162161
void firebaseMessagingOnBackgroundMessage(firebase_messaging.BackgroundMessageHandler handler);
163162

164-
/// Wraps the [FlutterLocalNotificationsPlugin] singleton constructor.
165-
FlutterLocalNotificationsPlugin get notifications;
166-
167163
/// Wraps the [AndroidNotificationHostApi] constructor.
168164
AndroidNotificationHostApi get androidNotificationHost;
169165

@@ -435,9 +431,6 @@ class LiveZulipBinding extends ZulipBinding {
435431
firebase_messaging.FirebaseMessaging.onBackgroundMessage(handler);
436432
}
437433

438-
@override
439-
FlutterLocalNotificationsPlugin get notifications => FlutterLocalNotificationsPlugin();
440-
441434
@override
442435
AndroidNotificationHostApi get androidNotificationHost => AndroidNotificationHostApi();
443436

test/model/binding.dart

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dart:async';
33
import 'package:firebase_core/firebase_core.dart';
44
import 'package:firebase_messaging/firebase_messaging.dart';
55
import 'package:flutter/foundation.dart';
6-
import 'package:flutter_local_notifications/flutter_local_notifications.dart' hide Person;
76
import 'package:test/fake.dart';
87
import 'package:url_launcher/url_launcher.dart' as url_launcher;
98
import 'package:zulip/host/android_notifications.dart';
@@ -273,17 +272,9 @@ class TestZulipBinding extends ZulipBinding {
273272
}
274273

275274
void _resetNotifications() {
276-
_notificationsPlugin = null;
277275
_androidNotificationHostApi = null;
278276
}
279277

280-
FakeFlutterLocalNotificationsPlugin? _notificationsPlugin;
281-
282-
@override
283-
FakeFlutterLocalNotificationsPlugin get notifications {
284-
return (_notificationsPlugin ??= FakeFlutterLocalNotificationsPlugin());
285-
}
286-
287278
FakeAndroidNotificationHostApi? _androidNotificationHostApi;
288279

289280
@override
@@ -512,39 +503,6 @@ typedef FirebaseMessagingRequestPermissionCall = ({
512503
bool sound,
513504
});
514505

515-
class FakeFlutterLocalNotificationsPlugin extends Fake implements FlutterLocalNotificationsPlugin {
516-
InitializationSettings? initializationSettings;
517-
DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse;
518-
DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse;
519-
520-
@override
521-
Future<bool?> initialize(
522-
InitializationSettings initializationSettings, {
523-
DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse,
524-
DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse,
525-
}) async {
526-
assert(this.initializationSettings == null);
527-
this.initializationSettings = initializationSettings;
528-
this.onDidReceiveNotificationResponse = onDidReceiveNotificationResponse;
529-
this.onDidReceiveBackgroundNotificationResponse = onDidReceiveBackgroundNotificationResponse;
530-
return true;
531-
}
532-
533-
/// The value to be returned by [getNotificationAppLaunchDetails].
534-
NotificationAppLaunchDetails? appLaunchDetails;
535-
536-
@override
537-
Future<NotificationAppLaunchDetails?> getNotificationAppLaunchDetails() {
538-
return Future.value(appLaunchDetails);
539-
}
540-
541-
void receiveNotificationResponse(NotificationResponse details) {
542-
if (onDidReceiveNotificationResponse != null) {
543-
onDidReceiveNotificationResponse!(details);
544-
}
545-
}
546-
}
547-
548506
class FakeAndroidNotificationHostApi implements AndroidNotificationHostApi {
549507
/// Lists currently active channels, result is aggregated from calls made to
550508
/// [createNotificationChannel] and [deleteNotificationChannel],

0 commit comments

Comments
 (0)