InkWell(
child: Container(
height: 100,
width: 375,
child: NativeView('<simple-text-view>', true),
),
),
InkWell(
child: Container(
padding: const EdgeInsets.all(8.0),
margin: const EdgeInsets.all(8.0),
color: Colors.yellow,
child: const Text(
'flutter rebuild demo',
style: TextStyle(fontSize: 22.0, color: Colors.black),
)),
onTap: () {
BoostNavigator.instance
.push('flutterRebuildDemo', withContainer: withContainer);
},
)
官方Demo在flutter rebuild demo按钮上面加一个NativeView,点击flutter rebuild demo按钮后再返回到该页面,NativeView会变空白,然后再显示。
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.2, on macOS 12.6 21G115 darwin-x64, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
✗ cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[!] Xcode - develop for iOS and macOS (Xcode 14.0.1)
! CocoaPods 1.10.1 out of date (1.11.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] VS Code (version 1.74.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
! Doctor found issues in 2 categories.
4条答案
按热度按时间shyt4zoc1#
在viewWillAppear方法中增加[self surfaceUpdated:YES];就好了
u5i3ibmn2#
在viewWillAppear方法中增加[self surfaceUpdated:YES];这个方案在release环境中会出现卡死的情况
[super bridge_viewWillAppear:animated];没有做任何操作,改成[super viewWillAppear:animated]; 可以解决卡死的问题
ibps3vxo3#
在viewWillAppear方法中增加[self surfaceUpdated:YES];这个方案在release环境中会出现卡死的情况 [super bridge_viewWillAppear:animated];没有做任何操作,改成[super viewWillAppear:animated]; 可以解决卡死的问题
非常感谢,欢迎提PR,参与共建~~
ne5o7dgx4#
在viewWillAppear方法中增加[self surfaceUpdated:YES];这个方案在release环境中会出现卡死的情况 [super bridge_viewWillAppear:animated];没有做任何操作,改成[super viewWillAppear:animated]; 可以解决卡死的问题
PlatformView之间侧滑返回,加上了上面还是会白屏 @zhanfengkuang@0xZOne