title: Flutter app won't runs on iOS device after closing
body: <p>Application runs well when I start it from VC, but when I close it(remove from memory) and try start from phone it blinks with white bg for a second and disappear. On Android devices and iOS simulator it works well. What problem it can be?</p>
  <p>Here my code:</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:flutter/services.dart';
  import 'package:prometey_app/models/auth_model.dart';
  import 'package:prometey_app/screens/auth/auth_screen.dart';
  import 'package:prometey_app/screens/main/main_screen.dart';
  import 'package:prometey_app/theme.dart';
  import 'package:provider/provider.dart';
  import 'controllers/data_manager.dart';
  
  bool isLoggedIn = false;
  
  void main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await DB.init();
    SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
        .then((_) {
      DB.getUser().then((user) {
        print(&quot;Get user data from sqlite&quot;);
        if (user != null) {
          print(&quot;Try to login with local data&quot;);
          bitrixAuth(user.email, user.password).then((userResponse) {
            if (userResponse.success) {
              isLoggedIn = true;
              print(&quot;Login success&quot;);
              runApp(MyApp());
            } else {
              print(&quot;Auth data changed&quot;);
              isLoggedIn = false;
              runApp(MyApp());
            }
          });
        } else {
          print(&quot;No user records in sqlite&quot;);
          isLoggedIn = false;
          runApp(MyApp());
        }
      });
    });
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return ChangeNotifierProvider(
        create: (context) =&gt; AuthModel(),
        child: MaterialApp(
            debugShowCheckedModeBanner: false,
            title: 'Прометей',
            theme: _theme(),
            home: isLoggedIn ? MainScreen() : AuthScreen()),
      );
    }
  
    ThemeData _theme() {
      return ThemeData(
        visualDensity: VisualDensity.adaptivePlatformDensity,
        scaffoldBackgroundColor: Global.bgColor,
        buttonTheme: ButtonThemeData(
          disabledColor: Global.bgAccent,
          buttonColor: Global.bgAccent,
          shape: RoundedRectangleBorder(),
          textTheme: ButtonTextTheme.normal,
        ),
      );
    }
  }
  </code></pre>
  <p>Any help would be appreciated!</p>