-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Flutter
版本信息:
flutter --version
Flutter 3.16.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7f20e5d18c (14 hours ago) • 2023-11-27 09:47:30 -0800
Engine • revision 22b600f240
Tools • Dart 3.2.1 • DevTools 2.28.3
主要的代码:
void main() async {
// WidgetsFlutterBinding.ensureInitialized();
MockBinding.ensureInitialized();
// 运行会出现错误,一直停留在启动界面,无法进入APP
return runMockApp(
KeyboardRootWidget(
child: App(),
));
// 没有仍和问题
// return runApp(App());
}
使用KeyboardRootWidget
包裹的情况下:
flutter run
════════ Exception caught by Flutter framework ═════════════════════════════════ The following assertion was thrown: The render object for Stack cannot find ancestor render object to attach to. The ownership chain for the RenderObject in question was: Stack ← Directionality ← Builder ← MediaQuery ← KeyboardMediaQuery ← KeyboardRootWidget ← [root] Try wrapping your widget in a View widget or any other widget that is backed by a RenderTreeRootElement to serve as the root of the render tree. ════════════════════════════════════════════════════════════════════════════════不使用KeyboardRootWidget
包裹的情况下:
flutter run
════════ Exception caught by Flutter framework ═════════════════════════════════ The following assertion was thrown: The render object for Semantics cannot find ancestor render object to attach to. The ownership chain for the RenderObject in question was: Semantics ← _FocusInheritedScope ← Focus ← HeroControllerScope ← ScrollConfiguration ← MaterialApp ← WillPopScope ← NotificationListener ← _GlobalOverlaySupport-[LabeledGlobalKey>#a3d3e overlay_support] ← OverlaySupportTheme ← ⋯ Try wrapping your widget in a View widget or any other widget that is backed by a RenderTreeRootElement to serve as the root of the render tree. ════════════════════════════════════════════════════════════════════════════════Metadata
Metadata
Assignees
Labels
No labels