custom_notification_platform_interface.dart 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. Future<void> showAnalyseResultNotification(
  27. int notificationId, bool isSuccess, String talkId,
  28. {required String channelId, required String channelName}) {
  29. throw UnimplementedError(
  30. 'showAnalyseResultNotification() has not been implemented.');
  31. }
  32. Stream<String> recordActionStream() {
  33. throw UnimplementedError('recordActionStream() has not been implemented.');
  34. }
  35. }