Flutter macOS Embedder
FlutterRunLoop.h
Go to the documentation of this file.
1 #ifndef FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRUNLOOP_H_
2 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRUNLOOP_H_
3 
4 #import <Foundation/Foundation.h>
5 
6 /**
7  * Interface for scheduling tasks on the run loop.
8  *
9  * Main difference between using `FlutterRunLoop` to schedule tasks compared to
10  * `dispatch_async` or `[NSRunLoop performBlock:]` is that `FlutterRunLoop`
11  * schedules the task in both common run loop mode and a private run loop mode,
12  * which allows it to run in mode where it only processes Flutter messages
13  * (`[FlutterRunLoop pollFlutterMessagesOnce]`).
14  */
15 @interface FlutterRunLoop : NSObject
16 
17 /**
18  * Ensures that the `FlutterRunLoop` for main thread is initialized. Only
19  * needs to be called once and must be called on the main thread.
20  */
22 
23 /**
24  * Returns the `FlutterRunLoop` for the main thread.
25  */
27 
28 /**
29  * Schedules a block to be executed on the main thread.
30  */
31 - (void)performBlock:(void (^)(void))block;
32 
33 /**
34  * Schedules a block to be executed on the main thread after a delay.
35  */
36 - (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay;
37 
38 /**
39  * Executes single iteration of the run loop in the mode where only Flutter
40  * messages are processed.
41  */
43 
44 @end
45 
46 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERRUNLOOP_H_
FlutterRunLoop * mainRunLoop()
void ensureMainLoopInitialized()
void pollFlutterMessagesOnce()