AboutDialog
官方定义:
An about box. This is a dialog box with the application's icon, name, version number, and copyright, plus a button to show licenses for software used by the application.
个人理解:用于显示应用的信息的弹出窗;通常用于传递企业或者app的官方信息,可以显示应用名称、版本号、logo等.
示例:
AboutDialog(
applicationName:'AboutDialog',
applicationVersion:'1.0.0',
applicationIcon:Icon(Icons.airport_shuttle),
applicationLegalese: 'what....',
children: <Widget>[
Text('文本1....'),
Text('文本2....'),
]);
构造方法:
AboutDialog({Key key,
String applicationName,
String applicationVersion,
Widget applicationIcon,
String applicationLegalese,
List<Widget> children })
Key->key
widget唯一标示
applicationName->String
应用名称
applicationVersion->String
应用版本号
applicationIcon->Widget
应用图标,widget
applicationLegalese->String
应用法律约束
children->List<Widget>
子布局
继承关系:
Object-> Diagnosticable ->DiagnosticableTree-> Widget ->StatelessWidget-> AboutDialog
基本方法:
要显示AboutDialog,要用showAboutDialog();
如果应用程序有Drawer,则AboutListTile直接显示AboutDialog更容易;
AboutDialog通过要用showAboutDialog来显示,通过showLicensePage显示按钮调用
showDialog(context: context,
builder(context)=>AboutDialog(
applicationName:'AboutDialog',
applicationVersion:'1.0.0',
applicationIcon:Icon(Icons.airport_shuttle),
applicationLegalese: 'what....',
children: <Widget>[
Text('文本1....'),
Text('文本2....')],)
);
样式:
image.png
网友评论