title: Flutter Application Stuck at Splashscreen
body: <blockquote>
  <p>Hi People... I'm having Difficulties with SplashScreen on Flutter... My app installs and opens, but it gets stuck with the splash screen logo... It doesn't go further... I provide you my codes, need help...</p>
  <p>AndroidManifest.xml</p>
  </blockquote>
  <pre><code>&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  package=&quot;com.manish.hotel&quot;&gt;
  
  &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot;/&gt;
  &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot;/&gt;
  
     &lt;application
      android:name=&quot;.Application&quot;
      android:label=&quot;Hotel App&quot;
      android:icon=&quot;@mipmap/ic_launcher&quot;&gt;
  
      
      &lt;meta-data
              android:name=&quot;com.google.firebase.messaging.default_notification_icon&quot;
              android:resource=&quot;@mipmap/ic_notification&quot; /&gt;
      &lt;activity
          android:name=&quot;.MainActivity&quot;
          android:launchMode=&quot;singleTop&quot;
          android:theme=&quot;@style/LaunchTheme&quot;
          android:configChanges=&quot;orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode&quot;
          android:hardwareAccelerated=&quot;true&quot;
          android:windowSoftInputMode=&quot;adjustResize&quot;&gt;
          &lt;!-- 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). --&gt;
          &lt;meta-data
              android:name=&quot;io.flutter.app.android.SplashScreenUntilFirstFrame&quot;
              android:value=&quot;true&quot; /&gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
              &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
          &lt;/intent-filter&gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;FLUTTER_NOTIFICATION_CLICK&quot; /&gt;
              &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>SplashScreen.dart</p>
  <pre><code>        import 'dart:async';
  import 'package:flutter/material.dart';
  import 'package:flutter/scheduler.dart';
  import 'package:mvc_pattern/mvc_pattern.dart';
  import 'package:manish_hotel_ui/generated/i18n.dart';
  import 'package:manish_hotel_ui/src/controllers/controller.dart';
  import 'package:manish_hotel_ui/src/repository/user_repository.dart';
  
  class SplashScreen extends StatefulWidget {
    @override
    State&lt;StatefulWidget&gt; createState() {
      return SplashScreenState();
    }
  }
  
  class SplashScreenState extends StateMVC&lt;SplashScreen&gt; {
    Controller _con;
  
    SplashScreenState() : super(Controller()) {
      _con = controller;
    }
  
    @override
    void initState() {
      super.initState();
      loadData();
    }
  
    Future&lt;Timer&gt; loadData() async {
      return new Timer(Duration(seconds: 5), onDoneLoading);
    }
  
    onDoneLoading() async {
      SchedulerBinding.instance.addPostFrameCallback((_) {
        if (currentUser.apiToken == null) {
          Navigator.of(context).pushReplacementNamed('/login');
        } else {
          Navigator.of(context).pushReplacementNamed('/pages', arguments: 2);
        }
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        key: _con.scaffoldKey,
        body: Container(
          decoration: BoxDecoration(
            color: Theme.of(context).accentColor,
          ),
          child: Center(
            child: Column(
              mainAxisSize: MainAxisSize.max,
              crossAxisAlignment: CrossAxisAlignment.center,
              mainAxisAlignment: MainAxisAlignment.center,
              children: &lt;Widget&gt;[
                Icon(
                  Icons.hotel_menu,
                  size: 90,
                  color: Theme.of(context).scaffoldBackgroundColor,
                ),
                Text(
                  S.of(context).hotel,
                  style: Theme.of(context)
                      .textTheme
                      .display1
                      .merge(TextStyle(color: Theme.of(context).scaffoldBackgroundColor)),
                ),
                SizedBox(height: 50),
                CircularProgressIndicator(
                  valueColor: AlwaysStoppedAnimation&lt;Color&gt;(Theme.of(context).scaffoldBackgroundColor),
                ),
              ],
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>Styles.xml</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;resources&gt;
      &lt;style name=&quot;LaunchTheme&quot; parent=&quot;@android:style/Theme.Black.NoTitleBar&quot;&gt;
          &lt;item name=&quot;android:windowBackground&quot;&gt;@drawable/launch_background&lt;/item&gt;
      &lt;/style&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>launch_background</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;layer-list xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;item android:drawable=&quot;@android:color/white&quot; /&gt;
       &lt;item&gt;
          &lt;bitmap
              android:gravity=&quot;center&quot;
              android:src=&quot;@mipmap/ic_launcher&quot; /&gt;
      &lt;/item&gt; 
  &lt;/layer-list&gt;
  </code></pre>
  <p>Need help guys, its been 2 months trying to figure it out, still cant solve...</p>