Flutter Engine
The Flutter Engine
Instance Methods | Properties | List of all members
FlutterEngine(Test) Category Reference

#import <FlutterEngine_Test.h>

Inheritance diagram for FlutterEngine(Test):
<FlutterBinaryMessenger>

Instance Methods

(flutter::Shell &) - shell
 
(void) - setBinaryMessenger:
 
(flutter::IOSRenderingAPI- platformViewsRenderingAPI
 
(void) - waitForFirstFrame:callback:
 
(FlutterEngine *) - spawnWithEntrypoint:libraryURI:initialRoute:entrypointArgs:
 
(const flutter::ThreadHost &) - threadHost
 
(void) - updateDisplays
 
(void) - flutterTextInputView:performAction:withClient:
 
(void) - sceneWillEnterForeground:
 
(void) - sceneDidEnterBackground:
 
(void) - applicationWillEnterForeground:
 
(void) - applicationDidEnterBackground:
 
- Instance Methods inherited from <FlutterBinaryMessenger>
(NSObject< FlutterTaskQueue > *) - makeBackgroundTaskQueue
 TODO(gaaclarke): Remove optional when macos supports Background Platform Channels. More...
 
(FlutterBinaryMessengerConnection- setMessageHandlerOnChannel:binaryMessageHandler:taskQueue:
 
(void) - sendOnChannel:message:
 
(void) - sendOnChannel:message:binaryReply:
 
(FlutterBinaryMessengerConnection- setMessageHandlerOnChannel:binaryMessageHandler:
 
(void) - cleanUpConnection:
 

Properties

FlutterEngineProcTableembedderAPI
 
BOOL enableEmbedderAPI
 
flutter::FlutterCompositormacOSCompositor
 

Detailed Description

Definition at line 23 of file FlutterEngine_Test.h.

Method Documentation

◆ applicationDidEnterBackground:

- (void) applicationDidEnterBackground: (NSNotification *)  notification

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

1369 :(NSNotification*)notification {
1370 [self flutterDidEnterBackground:notification];
1371}

◆ applicationWillEnterForeground:

- (void) applicationWillEnterForeground: (NSNotification *)  notification

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

1365 :(NSNotification*)notification {
1366 [self flutterWillEnterForeground:notification];
1367}

◆ flutterTextInputView:performAction:withClient:

- (void) flutterTextInputView: (FlutterTextInputView *)  textInputView
performAction: (FlutterTextInputAction)  action
withClient: (int client 

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

1028 :(FlutterTextInputView*)textInputView
1029 performAction:(FlutterTextInputAction)action
1030 withClient:(int)client {
1031 NSString* actionString;
1032 switch (action) {
1033 case FlutterTextInputActionUnspecified:
1034 // Where did the term "unspecified" come from? iOS has a "default" and Android
1035 // has "unspecified." These 2 terms seem to mean the same thing but we need
1036 // to pick just one. "unspecified" was chosen because "default" is often a
1037 // reserved word in languages with switch statements (dart, java, etc).
1038 actionString = @"TextInputAction.unspecified";
1039 break;
1040 case FlutterTextInputActionDone:
1041 actionString = @"TextInputAction.done";
1042 break;
1043 case FlutterTextInputActionGo:
1044 actionString = @"TextInputAction.go";
1045 break;
1046 case FlutterTextInputActionSend:
1047 actionString = @"TextInputAction.send";
1048 break;
1049 case FlutterTextInputActionSearch:
1050 actionString = @"TextInputAction.search";
1051 break;
1052 case FlutterTextInputActionNext:
1053 actionString = @"TextInputAction.next";
1054 break;
1055 case FlutterTextInputActionContinue:
1056 actionString = @"TextInputAction.continueAction";
1057 break;
1058 case FlutterTextInputActionJoin:
1059 actionString = @"TextInputAction.join";
1060 break;
1061 case FlutterTextInputActionRoute:
1062 actionString = @"TextInputAction.route";
1063 break;
1064 case FlutterTextInputActionEmergencyCall:
1065 actionString = @"TextInputAction.emergencyCall";
1066 break;
1067 case FlutterTextInputActionNewline:
1068 actionString = @"TextInputAction.newline";
1069 break;
1070 }
1071 [_textInputChannel.get() invokeMethod:@"TextInputClient.performAction"
1072 arguments:@[ @(client), actionString ]];
1073}

◆ platformViewsRenderingAPI

- (IOSRenderingAPI FlutterEngine(Test)):

Extends class FlutterEngine.

Definition at line 157 of file FlutterEngine.mm.

277 {
278 return _renderingApi;
279}
flutter::IOSRenderingAPI _renderingApi

◆ sceneDidEnterBackground:

- (void) sceneDidEnterBackground: (ios(13.0))  API_AVAILABLE

Extends class FlutterEngine.

◆ sceneWillEnterForeground:

- (void) sceneWillEnterForeground: (ios(13.0))  API_AVAILABLE

Extends class FlutterEngine.

◆ setBinaryMessenger:

- (void) setBinaryMessenger: (FlutterBinaryMessengerRelay *)  binaryMessenger

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

1233 :(FlutterBinaryMessengerRelay*)binaryMessenger {
1234 // Discard the previous messenger and keep the new one.
1235 if (binaryMessenger != _binaryMessenger) {
1237 [_binaryMessenger release];
1238 _binaryMessenger = [binaryMessenger retain];
1239 }
1240}
NSObject< FlutterBinaryMessenger > * parent
FlutterBinaryMessengerRelay * _binaryMessenger

◆ shell

- (Shell & FlutterEngine(Test)):

Extends class FlutterEngine.

Definition at line 157 of file FlutterEngine.mm.

326 {
328 return *_shell;
329}
#define FML_DCHECK(condition)
Definition: logging.h:103
std::unique_ptr< flutter::Shell > _shell

◆ spawnWithEntrypoint:libraryURI:initialRoute:entrypointArgs:

- (FlutterEngine *) spawnWithEntrypoint: (/*nullable */NSString *)  entrypoint
libraryURI: (/*nullable */NSString *)  libraryURI
initialRoute: (/*nullable */NSString *)  initialRoute
entrypointArgs: (/*nullable */NSArray< NSString * > *)  entrypointArgs 

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

1434 :(/*nullable*/ NSString*)entrypoint
1435 libraryURI:(/*nullable*/ NSString*)libraryURI
1436 initialRoute:(/*nullable*/ NSString*)initialRoute
1437 entrypointArgs:(/*nullable*/ NSArray<NSString*>*)entrypointArgs {
1438 NSAssert(_shell, @"Spawning from an engine without a shell (possibly not run).");
1439 FlutterEngine* result = [[FlutterEngine alloc] initWithName:_labelPrefix
1440 project:_dartProject.get()
1441 allowHeadlessExecution:_allowHeadlessExecution];
1442 flutter::RunConfiguration configuration =
1443 [_dartProject.get() runConfigurationForEntrypoint:entrypoint
1444 libraryOrNil:libraryURI
1445 entrypointArgs:entrypointArgs];
1446
1449 // Static-cast safe since this class always creates PlatformViewIOS instances.
1450 flutter::PlatformViewIOS* ios_platform_view =
1451 static_cast<flutter::PlatformViewIOS*>(platform_view.get());
1452 std::shared_ptr<flutter::IOSContext> context = ios_platform_view->GetIosContext();
1453 FML_DCHECK(context);
1454
1455 // Lambda captures by pointers to ObjC objects are fine here because the
1456 // create call is synchronous.
1458 [result, context](flutter::Shell& shell) {
1460 return std::make_unique<flutter::PlatformViewIOS>(
1461 shell, context, result->_platformViewsController, shell.GetTaskRunners());
1462 };
1463
1465 [](flutter::Shell& shell) { return std::make_unique<flutter::Rasterizer>(shell); };
1466
1467 std::string cppInitialRoute;
1468 if (initialRoute) {
1469 cppInitialRoute = [initialRoute UTF8String];
1470 }
1471
1472 std::unique_ptr<flutter::Shell> shell = _shell->Spawn(
1473 std::move(configuration), cppInitialRoute, on_create_platform_view, on_create_rasterizer);
1474
1475 result->_threadHost = _threadHost;
1476 result->_profiler = _profiler;
1477 result->_profiler_metrics = _profiler_metrics;
1478 result->_isGpuDisabled = _isGpuDisabled;
1479 [result setUpShell:std::move(shell) withVMServicePublication:NO];
1480 return [result autorelease];
1481}
std::unique_ptr< flutter::PlatformViewIOS > platform_view
const std::shared_ptr< IOSContext > & GetIosContext()
Specifies all the configuration required by the runtime library to launch the root isolate....
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
Definition: shell.h:120
GAsyncResult * result
void recreatePlatformViewController()
std::shared_ptr< flutter::ProfilerMetricsIOS > _profiler_metrics
std::shared_ptr< flutter::SamplingProfiler > _profiler
std::shared_ptr< flutter::ThreadHost > _threadHost

◆ threadHost

- (const ThreadHost & FlutterEngine(Test)):

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

1483 {
1484 return *_threadHost;
1485}

◆ updateDisplays

- (void) updateDisplays

Extends class FlutterEngine.

Definition at line 822 of file FlutterEngine.mm.

922 {
923 if (!_shell) {
924 // Tests may do this.
925 return;
926 }
927 auto vsync_waiter = _shell->GetVsyncWaiter().lock();
928 auto vsync_waiter_ios = std::static_pointer_cast<flutter::VsyncWaiterIOS>(vsync_waiter);
929 std::vector<std::unique_ptr<flutter::Display>> displays;
930 auto screen_size = UIScreen.mainScreen.nativeBounds.size;
931 auto scale = UIScreen.mainScreen.scale;
932 displays.push_back(std::make_unique<flutter::VariableRefreshRateDisplay>(
933 0, vsync_waiter_ios, screen_size.width, screen_size.height, scale));
934 _shell->OnDisplayUpdates(std::move(displays));
935}
const Scalar scale

◆ waitForFirstFrame:callback:

- (void) waitForFirstFrame: (NSTimeInterval)  timeout
callback: (void(^)(BOOL didTimeout))  callback 

Extends class FlutterEngine.

Property Documentation

◆ embedderAPI

- (FlutterEngineProcTable&) embedderAPI
readwritenonatomicassign

Function pointers for interacting with the embedder.h API.

Extends class FlutterEngine.

Definition at line 25 of file FlutterEngine_Test.h.

◆ enableEmbedderAPI

- (BOOL) enableEmbedderAPI
readnonatomicassign

Extends class FlutterEngine.

Definition at line 26 of file FlutterEngine_Test.h.

◆ macOSCompositor

- (FlutterCompositor* FlutterEngine(Test)):
readnonatomicassign

The FlutterCompositor object currently in use by the FlutterEngine.

May be nil if the compositor has not been initialized yet.

Extends class FlutterEngine.

Definition at line 44 of file FlutterEngineTest.mm.


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