@@ -95,7 +95,7 @@ - (nullable FlutterViewController*)viewControllerForId:(FlutterViewId)viewId;
95
95
* An internal method that adds the view controller with the given ID.
96
96
*
97
97
* This method assigns the controller with the ID, puts the controller into the
98
- * map, and does assertions related to the default view ID.
98
+ * map, and does assertions related to the implicit view ID.
99
99
*/
100
100
- (void )registerViewController : (FlutterViewController*)controller forId : (FlutterViewId)viewId ;
101
101
@@ -296,7 +296,7 @@ - (instancetype)initWithPlugin:(NSString*)pluginKey flutterEngine:(FlutterEngine
296
296
}
297
297
298
298
- (NSView *)view {
299
- return [self viewForId: kFlutterDefaultViewId ];
299
+ return [self viewForId: kFlutterImplicitViewId ];
300
300
}
301
301
302
302
- (NSView *)viewForId : (FlutterViewId)viewId {
@@ -422,9 +422,9 @@ - (instancetype)initWithName:(NSString*)labelPrefix
422
422
[_isResponseValid addObject: @YES ];
423
423
_terminationHandler = [[FlutterEngineTerminationHandler alloc ] initWithEngine: self
424
424
terminator: nil ];
425
- // kFlutterDefaultViewId is reserved for the default view.
425
+ // kFlutterImplicitViewId is reserved for the implicit view.
426
426
// All IDs above it are for regular views.
427
- _nextViewId = kFlutterDefaultViewId + 1 ;
427
+ _nextViewId = kFlutterImplicitViewId + 1 ;
428
428
429
429
_embedderAPI.struct_size = sizeof (FlutterEngineProcTable);
430
430
FlutterEngineGetProcAddresses (&_embedderAPI);
@@ -506,10 +506,10 @@ - (BOOL)runWithEntrypoint:(NSString*)entrypoint {
506
506
flutterArguments.update_semantics_callback2 = [](const FlutterSemanticsUpdate2* update,
507
507
void * user_data) {
508
508
// TODO(dkwingsmt): This callback only supports single-view, therefore it
509
- // only operates on the default view. To support multi-view, we need a
509
+ // only operates on the implicit view. To support multi-view, we need a
510
510
// way to pass in the ID (probably through FlutterSemanticsUpdate).
511
511
FlutterEngine* engine = (__bridge FlutterEngine*)user_data;
512
- [[engine viewControllerForId: kFlutterDefaultViewId ] updateSemantics: update];
512
+ [[engine viewControllerForId: kFlutterImplicitViewId ] updateSemantics: update];
513
513
};
514
514
flutterArguments.custom_dart_entrypoint = entrypoint.UTF8String ;
515
515
flutterArguments.shutdown_dart_vm_when_done = true ;
@@ -645,7 +645,7 @@ - (FlutterViewController*)viewControllerForId:(FlutterViewId)viewId {
645
645
646
646
- (void )setViewController : (FlutterViewController*)controller {
647
647
FlutterViewController* currentController =
648
- [_viewControllers objectForKey: @(kFlutterDefaultViewId )];
648
+ [_viewControllers objectForKey: @(kFlutterImplicitViewId )];
649
649
if (currentController == controller) {
650
650
// From nil to nil, or from non-nil to the same controller.
651
651
return ;
@@ -658,26 +658,26 @@ - (void)setViewController:(FlutterViewController*)controller {
658
658
@" If you wanted to create an FlutterViewController and set it to an existing engine, "
659
659
@" you should use FlutterViewController#init(engine:, nibName, bundle:) instead." ,
660
660
controller.engine);
661
- [self registerViewController: controller forId: kFlutterDefaultViewId ];
661
+ [self registerViewController: controller forId: kFlutterImplicitViewId ];
662
662
} else if (currentController != nil && controller == nil ) {
663
- NSAssert (currentController.viewId == kFlutterDefaultViewId ,
663
+ NSAssert (currentController.viewId == kFlutterImplicitViewId ,
664
664
@" The default controller has an unexpected ID %llu " , currentController.viewId);
665
665
// From non-nil to nil.
666
- [self deregisterViewControllerForId: kFlutterDefaultViewId ];
666
+ [self deregisterViewControllerForId: kFlutterImplicitViewId ];
667
667
[self shutDownIfNeeded ];
668
668
} else {
669
669
// From non-nil to a different non-nil view controller.
670
670
NSAssert (NO ,
671
671
@" Failed to set view controller to the engine: "
672
- @" The engine already has a default view controller %@ . "
673
- @" If you wanted to make the default view render in a different window, "
672
+ @" The engine already has an implicit view controller %@ . "
673
+ @" If you wanted to make the implicit view render in a different window, "
674
674
@" you should attach the current view controller to the window instead." ,
675
- [_viewControllers objectForKey: @(kFlutterDefaultViewId )]);
675
+ [_viewControllers objectForKey: @(kFlutterImplicitViewId )]);
676
676
}
677
677
}
678
678
679
679
- (FlutterViewController*)viewController {
680
- return [self viewControllerForId: kFlutterDefaultViewId ];
680
+ return [self viewControllerForId: kFlutterImplicitViewId ];
681
681
}
682
682
683
683
- (FlutterCompositor*)createFlutterCompositor {
@@ -705,9 +705,9 @@ - (FlutterCompositor*)createFlutterCompositor {
705
705
void * user_data //
706
706
) {
707
707
// TODO(dkwingsmt): This callback only supports single-view, therefore it
708
- // only operates on the default view. To support multi-view, we need a new
708
+ // only operates on the implicit view. To support multi-view, we need a new
709
709
// callback that also receives a view ID.
710
- return reinterpret_cast <flutter::FlutterCompositor*>(user_data)->Present (kFlutterDefaultViewId ,
710
+ return reinterpret_cast <flutter::FlutterCompositor*>(user_data)->Present (kFlutterImplicitViewId ,
711
711
layers, layers_count);
712
712
};
713
713
@@ -725,7 +725,7 @@ - (FlutterCompositor*)createFlutterCompositor {
725
725
#pragma mark - Framework-internal methods
726
726
727
727
- (void )addViewController : (FlutterViewController*)controller {
728
- [self registerViewController: controller forId: kFlutterDefaultViewId ];
728
+ [self registerViewController: controller forId: kFlutterImplicitViewId ];
729
729
}
730
730
731
731
- (void )removeViewController : (nonnull FlutterViewController*)viewController {
@@ -812,7 +812,7 @@ - (nonnull NSString*)executableName {
812
812
}
813
813
814
814
- (void )updateWindowMetricsForViewController : (FlutterViewController*)viewController {
815
- if (viewController.viewId != kFlutterDefaultViewId ) {
815
+ if (viewController.viewId != kFlutterImplicitViewId ) {
816
816
// TODO(dkwingsmt): The embedder API only supports single-view for now. As
817
817
// embedder APIs are converted to multi-view, this method should support any
818
818
// views.
@@ -1078,7 +1078,7 @@ - (void)handleAccessibilityEvent:(NSDictionary<NSString*, id>*)annotatedEvent {
1078
1078
- (void )announceAccessibilityMessage : (NSString *)message
1079
1079
withPriority : (NSAccessibilityPriorityLevel )priority {
1080
1080
NSAccessibilityPostNotificationWithUserInfo (
1081
- [self viewControllerForId: kFlutterDefaultViewId ].flutterView,
1081
+ [self viewControllerForId: kFlutterImplicitViewId ].flutterView,
1082
1082
NSAccessibilityAnnouncementRequestedNotification ,
1083
1083
@{NSAccessibilityAnnouncementKey : message, NSAccessibilityPriorityKey : @(priority)});
1084
1084
}
0 commit comments