About Page
Loading preview
Starting the Flutter app
A showcase of Flutter's about page functionality
import 'package:flutter/material.dart';
class AboutPage extends StatelessWidget {
const AboutPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('About')),
body: SingleChildScrollView(
padding: const EdgeInsets.all(24),
child: Column(
children: [
Container(
width: 120,
height: 120,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(24),
),
child: Icon(
Icons.info_outline,
size: 64,
color: Theme.of(context).colorScheme.primary,
),
),
const SizedBox(height: 24),
Text(
'App Name',
style: Theme.of(context).textTheme.headlineSmall,
),
Text('Version 1.0.0', style: Theme.of(context).textTheme.bodyMedium),
const SizedBox(height: 24),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '
'Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
OutlinedButton(
onPressed: () => _showDemo(context, 'Terms of Service (demo)'),
child: const Text('Terms of Service'),
),
const SizedBox(height: 8),
OutlinedButton(
onPressed: () => _showDemo(context, 'Privacy Policy (demo)'),
child: const Text('Privacy Policy'),
),
],
),
),
);
}
}
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 stateless page: a SingleChildScrollView stacks an icon tile, app name, version line and blurb above two OutlinedButtons. Every value is a literal, including 'Version 1.0.0' and the lorem ipsum paragraph. Both buttons show a demo SnackBar, so neither goes anywhere yet.
Adapting it
- Read the version from
package_info_plusinstead of the hardcodedText, so it tracks your build number. - Swap
Icons.info_outlineinside the 120pxContainerfor your real app icon. - Point each
OutlinedButtonat your terms and privacy routes or URLs.