他大家,
我有以下代码的问题:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Expanded(
child: PageView(
children: <Widget>[
Container(
color: Colors.red,
),
Container(
color: Colors.yellow,
),
Container(
color: Colors.green,
),
Container(
color: Colors.blue,
), …Run Code Online (Sandbox Code Playgroud) 我的颤振应用程序有问题。在 iOS 上,每次启动它时,我都会看到黑屏 1-2 秒,然后才能加载我的第一个屏幕。行为就像这个视频中显示的那样
我已经设置了一个启动画面编辑 LaunchScreen.storyboard。即使我尝试在模拟器和真实设备中启动默认的 Flutter 应用程序(计数器),也会发生这种情况。
我该如何解决这个问题,或者至少将其从黑屏更改为白屏?
我试过跑步flutter clean。我试过在beta和stable频道之间切换。编译器似乎正在尝试为浏览器支持添加内容,但我正在编译 APK。Flutter Web 支持已禁用。我以前编译这个没有问题。看起来问题的根源可能是sentry我正在使用的包。
我怎样才能让应用程序再次编译?
这是输出 build apk
$ flutter build apk
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, …Run Code Online (Sandbox Code Playgroud)