handleSystemMessage method

  1. @override
Future<void> handleSystemMessage (
  1. Object systemMessage
)
override

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

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

Implementation

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