title: Is there a way to skip await if it's too long? (Flutter)
body: <p>I use async await in main so the user has to wait in the splash screen before entering the app.</p>
  <pre><code>void main() async {
  
    await Firebase.initializeApp();
  
    String? x;
    await FirebaseDatabase.instance.ref().child(&quot;data&quot;).once().then((snapshot) {
       Map data = snapshot.snapshot.value as Map;
       x = jsonEncode(data);
    });
  
    return ChangeNotifierProvider&lt;DataModel&gt;.value(
       value: DataModel(data: x),
       child: MaterialApp()
    );
  }
  </code></pre>
  <p>If there are users entering the app without an internet connection, they will be stuck on the splash screen forever. If there are also users with slow internet connection, they will be stuck on the splash screen longer.</p>
  <p>So no matter what the internet connection problem is, I want to set a maximum of 5 seconds only to be in the await, if it exceeds, skip that part and go straight into the app.</p>