Skip to content

Instantly share code, notes, and snippets.

@pinkeshdarji
Created December 26, 2019 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pinkeshdarji/48dce1b48c714f88ed015f58ba6f4aeb to your computer and use it in GitHub Desktop.
Save pinkeshdarji/48dce1b48c714f88ed015f58ba6f4aeb to your computer and use it in GitHub Desktop.
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