custom_notification_platform_interface.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:plugin_platform_interface/plugin_platform_interface.dart';
  2. import 'custom_notification_method_channel.dart';
  3. abstract class CustomNotificationPlatform extends PlatformInterface {
  4. /// Constructs a CustomNotificationPlatform.
  5. CustomNotificationPlatform() : super(token: _token);
  6. static final Object _token = Object();
  7. static CustomNotificationPlatform _instance =
  8. MethodChannelCustomNotification();
  9. /// The default instance of [CustomNotificationPlatform] to use.
  10. ///
  11. /// Defaults to [MethodChannelCustomNotification].
  12. static CustomNotificationPlatform get instance => _instance;
  13. /// Platform-specific implementations should set this with their own
  14. /// platform-specific class that extends [CustomNotificationPlatform] when
  15. /// they register themselves.
  16. static set instance(CustomNotificationPlatform instance) {
  17. PlatformInterface.verifyToken(instance, _token);
  18. _instance = instance;
  19. }
  20. Future<void> showRecordNotification(
  21. int notificationId, bool isRecording, String timeDesc,
  22. {required String channelId, required String channelName}) {
  23. throw UnimplementedError(
  24. 'showRecordNotification() has not been implemented.');
  25. }
  26. Stream<String> recordActionStream() {
  27. throw UnimplementedError('recordActionStream() has not been implemented.');
  28. }
  29. }