-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
While users can define these on their own, but doing so here will really help the docs, examples, and even source code to be more readable.
// 1. Remove "Flutter" and "Plugin" from all the plugin classes
typedef LocalNotifications = FlutterLocalNotificationsPlugin;
typedef AndroidLocalNotifications = AndroidFlutterLocalNotificationsPlugin;
// ...
// 2. Rename FlutterLocalNotificationsPlugin methods:
cancelAllPending() => cancelAllPendingNotifications();
getActive() => getActiveNotifications();
getLaunchDetails() => getNotificationAppLaunchDetails();
getPending() => pendingNotificationRequests();
forPlatform() => resolvePlatformSpecificImplementation();
repeat() => periodicallyShowWithDuration()
// 3. Remove "Notification" from all platform details classes
typedef AndroidDetails = AndroidNotificationDetails;
// ...
// 4. Remove "Initialization" from all platform initialization settings
typedef AndroidSettings = AndroidInitializationSettings;
// ...This could lead to some nice savings like
final androidPlugin = FlutterLocalNotificationsPlugin()
.resolvePlatformSpecificImplementation
<AndroidFlutterLocalNotificationsPlugin>();
// vs
final androidPlugin = LocalNotifications().forPlatform<AndroidLocalNotifications>();I think 1 and 2 are pretty harmless, while 3 and 4 have a higher chance of conflicting with an application's own classes. But I think this is pretty unlikely if developers are containing most / all of their notification logic in a dedicated file (and InitializationSettings doesn't have the word "notification" in it anyway)
Wanted to clear these with you before making a PR. This would be entirely non-breaking and can be done alongside #2614.
Metadata
Metadata
Assignees
Labels
No labels