Sub topic 13
Perceived Startup: Native Splash and First Screen Design
This chapter assumes you can run a Flutter app, use async and await, and recognize the difference between work done by the operating system and work done by Flutter. The goal is to improve the time users perceive, not only the measured time to the first Flutter frame.
Use the native splash for the handoff
A native splash screen is drawn by Android or iOS before Flutter has created its first frame. It should be simple and static:
- Show the app icon or wordmark.
- Use the same background color as the first Flutter screen.
- Avoid network content, animations, and changing data.
- Keep it visible only while the platform starts Flutter.
Android 12 and later control much of the splash layout. The system limits the icon treatment and animation, so design within those rules instead of trying to reproduce a full marketing screen. On iOS, the launch screen also has strict limits and should represent the app shell rather than advertise a long initialization process.
A native splash hides the platform-to-Flutter transition. It does not make Dart initialization faster. If Flutter takes too long to render, users see a frozen-looking launch screen for longer.
Make the first Flutter frame useful
The first Flutter frame should contain a stable shell that can render without waiting for every service. For example, show the app bar, navigation structure, and a loading placeholder while secondary data loads.
Keep only critical work before runApp. Schedule analytics, remote configuration, cache refreshes, and prefetching after the first frame when they do not affect the initial layout.
import 'dart:async';
import 'package:flutter/material.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize only services required to build the first screen.
runApp(const MyApp());
WidgetsBinding.instance.addPostFrameCallback((_) {
unawaited(loadNonCriticalData());
});
}
Future<void> loadNonCriticalData() async {
// Replace this with analytics, remote config, or cache refresh work.
await Future<void>.delayed(const Duration(milliseconds: 500));
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('Home')),
body: const Center(
child: CircularProgressIndicator(),
),
),
);
}
}A placeholder should communicate the structure of the final content. A generic spinner gives less information and can make a short wait feel longer. Do not show a skeleton for content that will immediately be replaced by a completely different layout.
Choose what users see during startup
| Startup choice | Advantage | Risk |
|---|---|---|
| Native splash | Covers platform startup | Cannot show live Flutter data |
| Static first screen | Renders quickly and predictably | May need a loading state |
| Full data-dependent screen | Avoids a later visual change | Delays the first useful frame |
The best choice depends on the screen. A dashboard can show stable cards with loading values. A payment screen may need required configuration before it is safe to display controls. In that case, initialize the minimum secure state first, then render.
Find and fix perceived delays
Common problems include:
- A blank first Flutter frame because the root widget waits for a future.
- A splash color that differs from the first screen background.
- A large animation or image decoded before any useful content appears.
- A loading indicator that does not match the final layout.
- A splash that promises content the app cannot show offline.
Measure the actual first-frame time with profile builds, then test on slower physical devices. Also ask whether the first frame gives the user a reason to wait. A technically fast frame that contains only a spinner can still feel slow.
Exercise
Your app waits for analytics initialization before calling runApp. What change should you make if analytics is not required to construct the first screen?
Show answer
Call runApp first, then start analytics from a post-frame callback or another non-blocking startup path.