handleSystemMessage method Null safety

  1. @protected
  2. @mustCallSuper
Future<void> handleSystemMessage(
  1. Object systemMessage
)
mustCallSuper">@mustCallSuperprotected">@protected

Handler called for messages received on the SystemChannels.system message channel.

Other bindings may override this to respond to incoming system messages.

Implementation

@protected
@mustCallSuper
Future<void> handleSystemMessage(Object systemMessage) async {
  final Map<String, dynamic> message = systemMessage as Map<String, dynamic>;
  final String type = message['type'] as String;
  switch (type) {
    case 'memoryPressure':
      handleMemoryPressure();
      break;
  }
  return;
}