Flutter 在生产版本中为 GridView/Listview 显示空白屏幕 [英] Flutter shows blank screen for GridView/Listview in production build
问题描述
我创建了一个简单的 flutter 应用程序,它基本上显示了网格项目.在调试模式下,网格项正常显示.但是,在生产模式下,flutter 只会显示空白屏幕.我什至实现了拉动刷新.现在,当我拉动刷新页面时,它仍然没有显示.
I created a simple flutter app which basically shows grid items. In debug mode, the grid items shows normally. However, in production mode, flutter just shows blank screen. I even implemented pull to refresh. Now, when I pull to refresh the page, it still doesn't show.
在调试模式下,模拟器和真实设备都可以正常工作.我使用以下代码为 Android 构建应用程序:
In debug mode, both emulator and real device works fine. I use the following code to build the app for Android:
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
这是我的代码:https://github.com/SanjayBanjade/flutter-ecommerce
推荐答案
在您的 AndroidManifest.xml
文件中添加 Internet 权限:
Add Internet permission in your AndroidManifest.xml
file :
<uses-permission android:name="android.permission.INTERNET"/>
这篇关于Flutter 在生产版本中为 GridView/Listview 显示空白屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!