Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0-preview.10,iOS的UITabBarController添加多个flutter页面,最后一个添加的会白屏 #1358

Closed
lazyyou opened this issue Sep 10, 2021 · 9 comments · Fixed by #1360
Labels
Boost3.0 The problem in boost 3.0 bug Something isn't working in lastest version The problem exist in lastest version P1 Priority 1 issue likely blocking a tier-1 customer now.

Comments

@lazyyou
Copy link

lazyyou commented Sep 10, 2021

flutter:2.2.2
flutterBoost:v3.0-preview.10

在iOS的UITabBarController中添加多个flutter页面,比如添加flutter A、flutter B、flutter C三个页面,启动后第一次点击flutter C页面会白屏,等很久也没用,然后切换tab到flutter B再切换到flutter C,会保持显示切换前的flutter B页面。

在官方iOS demo中可以复现,
` UIViewControllerDemo *vc = [[UIViewControllerDemo alloc] initWithNibName:@"UIViewControllerDemo" bundle:[NSBundle mainBundle]];
vc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"hybrid" image:nil tag:0];

FBFlutterViewContainer *fvc = FBFlutterViewContainer.new ;
[fvc setName:@"tab_friend" uniqueId:nil params:@{} opaque:YES];
fvc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"flutter_tab" image:nil tag:1];

FBFlutterViewContainer *fvc1 = FBFlutterViewContainer.new ;
[fvc1 setName:@"tab_friend" uniqueId:nil params:@{} opaque:YES];
fvc1.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"flutter_tab" image:nil tag:1];

FBFlutterViewContainer *fvc2 = FBFlutterViewContainer.new ;
[fvc2 setName:@"tab_friend" uniqueId:nil params:@{} opaque:YES];
fvc2.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"flutter_tab" image:nil tag:1];

UITabBarController *tabVC = [[UITabBarController alloc] init];
tabVC.viewControllers = @[vc,fvc,fvc1,fvc2];`

切换tab是报错:
`The following StateError was thrown during a platform message callback:
Bad state: No element

When the exception was thrown, this was the stack:
#0 ListMixin.singleWhere (dart:collection/list.dart:202:5)
#1 ContainerOverlay.refreshSpecificOverlayEntries (package:flutter_boost/container_overlay.dart:93:44)
#2 FlutterBoostAppState.refreshOnMoveToTop (package:flutter_boost/flutter_boost_app.dart:609:31)
#3 FlutterBoostAppState.pushContainer (package:flutter_boost/flutter_boost_app.dart:273:9)
#4 BoostFlutterRouterApi.pushRoute (package:flutter_boost/boost_flutter_router_api.dart:21:14)
...`

@luckysmg
Copy link
Collaborator

你FBFlutterViewContainer的创建是在引擎初始化之前还是之后

@luckysmg luckysmg added Boost3.0 The problem in boost 3.0 waiting for customer response waiting response in triage Presently being triaged by the triage team labels Sep 10, 2021
@luckysmg
Copy link
Collaborator

这个是一定复现吗?

@lazyyou
Copy link
Author

lazyyou commented Sep 10, 2021

这是一定复现吗?

必现的,在引擎初始化之后。

@luckysmg
Copy link
Collaborator

行,这边查一下

@luckysmg luckysmg removed the waiting for customer response waiting response label Sep 10, 2021
@luckysmg
Copy link
Collaborator

已经复现了,但是奇怪的是,用Xcode跑不会出问题,但是如果用flutter IDE来run的话就能看到这个问题,您用Xcode跑一下试试呢?我想确认一下表现是否一致

@luckysmg luckysmg added the in lastest version The problem exist in lastest version label Sep 10, 2021
@lazyyou
Copy link
Author

lazyyou commented Sep 10, 2021

我这边效果和你一样,flutter IDE会出现,xcode没有问题。

但是我的项目由Xcode启动问题还是存在的。还发现一个现象,就是这个问题只出现在启动app时TabBarController作为rootViewController,如果由另一个vc present出TabBarController就没问题。

@luckysmg
Copy link
Collaborator

已经定位问题,这边修复一下

@luckysmg
Copy link
Collaborator

已经修复,可以先拉master分支试一下

@lazyyou
Copy link
Author

lazyyou commented Sep 10, 2021

已经修复,可以先拉master分支试一下

试过了,可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Boost3.0 The problem in boost 3.0 bug Something isn't working in lastest version The problem exist in lastest version P1 Priority 1 issue likely blocking a tier-1 customer now.
Projects
None yet
2 participants