| Flutter macOS Embedder |

Instance Methods | Properties | List of all members
FlutterEngineTerminationHandler Class Reference

`#import <FlutterEngine_Internal.h>`

Inheritance diagram for FlutterEngineTerminationHandler:

## Instance Methods
(instancetype) | - initWithEngine:terminator:
(void) | - handleRequestAppExitMethodCall:result:
(void) | - requestApplicationTermination:exitType:result:

## Properties
BOOL | shouldTerminate
BOOL | acceptingRequests

## Detailed Description

A handler interface for handling application termination that the FlutterAppDelegate can use to coordinate an application exit by sending messages through the platform channel managed by the engine.

Definition at line 183 of file FlutterEngine.mm.

## Method Documentation

## ◆ handleRequestAppExitMethodCall:result:

- (void) handleRequestAppExitMethodCall: |  | (NSDictionary<NSString*, id>*) | data
result: |  | (FlutterResult) | result

Definition at line 208 of file FlutterEngine.mm.

208 :(NSDictionary<NSString*, id>*)arguments
209 result:(FlutterResult)result {
210 NSString* type = arguments[@"type"];
211 // Ignore the "exitCode" value in the arguments because AppKit doesn't have
212 // any good way to set the process exit code other than calling exit(), and
213 // that bypasses all of the native applicationShouldExit shutdown events,
214 // etc., which we don't want to skip.
215
216 FlutterAppExitType exitType =
217 [type isEqualTo:@"cancelable"] ? kFlutterAppExitTypeCancelable : kFlutterAppExitTypeRequired;
218
219 [self requestApplicationTermination:[NSApplication sharedApplication]
220 exitType:exitType
221 result:result];
222 }

References requestApplicationTermination:exitType:result:.

## ◆ initWithEngine:terminator:

- (instancetype) initWithEngine: |  | (FlutterEngine *) | engine
terminator: |  | (nullable FlutterTerminationCallback) | terminator

## ◆ requestApplicationTermination:exitType:result:

- (void) requestApplicationTermination: |  | (NSApplication *) | sender
exitType: |  | (FlutterAppExitType) | type
result: |  | (nullable FlutterResult) | result

Referenced by handleRequestAppExitMethodCall:result:.

## Property Documentation

## ◆ acceptingRequests

- (BOOL) acceptingRequests
| readwritenonatomicassign

Definition at line 61 of file FlutterEngine_Internal.h.

## ◆ shouldTerminate

- (BOOL) shouldTerminate
| readnonatomicassign

Definition at line 60 of file FlutterEngine_Internal.h.

The documentation for this class was generated from the following files:

- shell/platform/darwin/macos/framework/Source/FlutterEngine.mm
- shell/platform/darwin/macos/framework/Source/FlutterEngine_Internal.h

FlutterResult
void(^ FlutterResult)(id _Nullable result)
Definition: FlutterChannels.h:194