Created
December 26, 2019 06:09
-
-
Save pinkeshdarji/48dce1b48c714f88ed015f58ba6f4aeb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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