将device_preview与响应式体系结构设计一起使用时,“未找到MaterialLocalizations”

问题描述

我想在我的应用程序中同时使用 device_preview 和Navigator(这是堆叠体系结构的一部分)。为此,我需要将相应的代码添加到builder的{​​{1}}属性中。但是,由于MaterialApp小部件中只有一个builder属性,如何也实现 device_preview

enter image description here

我收到以下错误消息

MaterialApp

════════ Exception caught by widgets library ═══════════════════════════════════ No MaterialLocalizations found. The ancestors of this widget were DevicePreview state: DevicePreviewState#18003 ... The relevant error-causing widget was DevicePreview lib\main.dart:14 ════════════════════════════════════════════════════════════════════════════════

main

我正在使用此软件包https://pub.dev/packages/device_preview检查响应性

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...