美文网首页
flutter启动页面黑屏问题

flutter启动页面黑屏问题

作者: 桃之_夭夭_ | 来源:发表于2020-03-31 15:44 被阅读0次

解决方案:

修改MainActivity.dart文件

package com.example.credit_card

import android.os.Bundle

import io.flutter.app.FlutterActivity

import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {

        super.onCreate(savedInstanceState)

        GeneratedPluginRegistrant.registerWith(this)

    }

}

同时修改android/app/src/main/AndroidManifest.xml

在activity标签内添加

<!-- This keeps the window background of the activity showing

                until Flutter renders its first frame. It can be removed if

                there is no splash screen (such as the default splash screen

                defined in @style/LaunchTheme). -->

            <meta-data

                android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"

                android:value="true" />

相关文章

网友评论

      本文标题:flutter启动页面黑屏问题

      本文链接:https://www.haomeiwen.com/subject/vswwuhtx.html