Maintenance Page
Loading preview
Starting the Flutter app
Construction icon, estimated return time
import 'package:flutter/material.dart';
class MaintenancePage extends StatelessWidget {
const MaintenancePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Padding(
padding: const EdgeInsets.all(32),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.construction,
size: 80,
color: Theme.of(context).colorScheme.primary,
),
const SizedBox(height: 24),
Text(
'Under Maintenance',
style: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(height: 8),
Text(
'We\'re currently performing scheduled maintenance. Expected return: 2:00 PM today.',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyLarge,
),
const SizedBox(height: 32),
OutlinedButton.icon(
onPressed: () => _showDemo(context, 'Check back later (demo)'),
icon: const Icon(Icons.refresh),
label: const Text('Check back later'),
),
],
),
),
),
);
}
}
void _showDemo(BuildContext context, String message) {
ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(SnackBar(content: Text(message)));
}
Add it to your project
Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.
First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.
How it works
A static notice with Icons.construction, a heading, and a return time written into the sentence as 2:00 PM today. The stateless page has no timer or status check. Its OutlinedButton.icon shows a refresh icon alongside Check back later, and tapping it shows a demo SnackBar.
Adapting it
- Read the end time from remote config instead of the
2:00 PM todayliteral, so it can change without a release. - Use the
OutlinedButton.iconto re-check status, and route back into the app once maintenance ends. - Give
MaintenancePagea time parameter, formatted in the user’s locale.