1
votes

flutter app seems to be loading the splash screen from android\app\src\main\res\drawable\launchbackground.xml but i am trying to make it to load the splash screen from the lib\screen\splash.dart

here is what happens :

when the app is loaded the splash screen from the launchbackground.xml is loading right before the splash.dart is loaded ...

my launchbackground.xml code:

<?xml version="1.0" encoding="utf-8"?>
<item android:drawable="@android:color/holo_white" />
<!-- You can insert your own image assets here -->
<item>
    <bitmap
        android:gravity="center"
        android:src="@mipmap/logo1" />
</item>

my splash.dart code:

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';


class Splash extends StatefulWidget {
@override
_SplashState createState() => _SplashState();
}

class _SplashState extends State<Splash> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Container(
         width: double.infinity,
          height: double.infinity,
          decoration: BoxDecoration(
            gradient: LinearGradient(
              colors: [
                Color.fromRGBO(8, 94, 180, 1.0),
                Color.fromRGBO(30, 144, 255, 1.0),
                Color.fromRGBO(0, 191, 255, 1.0)
             ],
              begin: Alignment.bottomLeft,
              end: Alignment.topRight,
            ),
          ),
          child: Container(
              height: 120,
              width: 200,
              child: Image.asset(
                "asset/Logo11.png",
                fit: BoxFit.contain,
              )),
        ));
  }
}
i updated the post - Umer