handleSystemMessage method

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

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();
  }
  return;
}