Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import 'package:flutter/material.dart';
/// This Widget is the main application widget.
class AboutDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
darkTheme: ThemeData.dark(),
theme: ThemeData(brightness: Brightness.dark),
title: 'Flutter About Widgets',
home: MyStatelessWidget(),
);
}
}
class MyStatelessWidget extends StatelessWidget {
MyStatelessWidget({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
final List<Widget> aboutBoxChildren = <Widget>[
SizedBox(
height: 20,
),
Text('App information'),
Text('App Privacy Policy'),
Text('App Terms of Service'),
RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(
style: TextStyle(color: Theme.of(context).accentColor),
text: 'Site URL'),
],
),
)
];
return Scaffold(
appBar: AppBar(
title: Text('My Cool App'),
),
drawer: Drawer(
child: SingleChildScrollView(
child: SafeArea(
child: Column(
children: <Widget>[
AboutListTile(
child: Text('About app'),
icon: Icon(
Icons.info,
),
applicationIcon: Icon(
Icons.local_play,
size: 65,
color: Theme.of(context).accentColor,
),
applicationName: 'My Cool App',
applicationVersion: '1.0.25',
applicationLegalese: '© 2019 Company',
aboutBoxChildren: aboutBoxChildren,
),
],
),
),
),
),
body: Center(
child: RaisedButton(
child: Text('Show About Dialog'),
color: Theme.of(context).accentColor,
textColor: Colors.black,
onPressed: () {
showAboutDialog(
context: context,
applicationIcon: Icon(
Icons.local_play,
size: 65,
color: Theme.of(context).accentColor,
),
applicationName: 'My Cool App',
applicationVersion: '1.0.25',
applicationLegalese: '© 2019 Company',
children: aboutBoxChildren,
);
},
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.