FlutterLocalNotificationsPlugin.private constructor
Used internally for creating the appropriate platform-specific implementation of the plugin.
This can be used for tests as well. For example, the following code
FlutterLocalNotificationsPlugin.private(FakePlatform(operatingSystem:
'android'))
could be used in a test needs the plugin to use Android implementation
Implementation
@visibleForTesting
FlutterLocalNotificationsPlugin.private(Platform platform)
: _platform = platform {
if (kIsWeb) {
return;
}
if (platform.isAndroid) {
FlutterLocalNotificationsPlatform.instance =
AndroidFlutterLocalNotificationsPlugin();
} else if (platform.isIOS) {
FlutterLocalNotificationsPlatform.instance =
IOSFlutterLocalNotificationsPlugin();
} else if (platform.isMacOS) {
FlutterLocalNotificationsPlatform.instance =
MacOSFlutterLocalNotificationsPlugin();
}
}