Commit cd89e867 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

About box API (#4677)

This API is the front-end part of the work on showing licenses.

Future patches will:

* Provide an API for registering what licenses should be shown here,
  which will be used by this feature to shown licenses but could also be
  used by custom code for showing licenses (e.g. for people not using
  the Material widgets).

* Actually populate this license API from all the licenses we currently
  use in the engine, in the framework, and from any pub packages that
  are used (directly or indirectly) by the application.
parent ef49e28e
...@@ -52,7 +52,7 @@ class TypographyDemo extends StatelessWidget { ...@@ -52,7 +52,7 @@ class TypographyDemo extends StatelessWidget {
new TextStyleItem(name: 'Title', style: textTheme.title, text: 'Medium 20sp'), new TextStyleItem(name: 'Title', style: textTheme.title, text: 'Medium 20sp'),
new TextStyleItem(name: 'Subheading', style: textTheme.subhead, text: 'Regular 16sp'), new TextStyleItem(name: 'Subheading', style: textTheme.subhead, text: 'Regular 16sp'),
new TextStyleItem(name: 'Body 2', style: textTheme.body2, text: 'Medium 14sp'), new TextStyleItem(name: 'Body 2', style: textTheme.body2, text: 'Medium 14sp'),
new TextStyleItem(name: 'Body 1', style: textTheme.body1, text: 'Reguluar 14sp'), new TextStyleItem(name: 'Body 1', style: textTheme.body1, text: 'Regular 14sp'),
new TextStyleItem(name: 'Caption', style: textTheme.caption, text: 'Regular 12sp'), new TextStyleItem(name: 'Caption', style: textTheme.caption, text: 'Regular 12sp'),
new TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp') new TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp')
]; ];
......
...@@ -94,6 +94,18 @@ class GalleryDrawer extends StatelessWidget { ...@@ -94,6 +94,18 @@ class GalleryDrawer extends StatelessWidget {
] ]
) )
), ),
new AboutDrawerItem(
applicationVersion: '2016 Q2 Preview',
applicationIcon: new AssetImage('packages/flutter_gallery_assets/appbar_background.jpg'),
applicationLegalese: '© 2016 The Chromium Authors',
aboutBoxChildren: <Widget>[
new Padding(
padding: const EdgeInsets.only(top: 24.0, bottom: 8.0),
child: new Center(child: new CircularProgressIndicator())
),
new Text('Awaiting fix for issue 4512.', textAlign: TextAlign.center),
]
),
] ]
) )
); );
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
/// for an introduction to Material Design. /// for an introduction to Material Design.
library material; library material;
export 'src/material/about.dart';
export 'src/material/app.dart'; export 'src/material/app.dart';
export 'src/material/app_bar.dart'; export 'src/material/app_bar.dart';
export 'src/material/bottom_sheet.dart'; export 'src/material/bottom_sheet.dart';
......
This diff is collapsed.
...@@ -18,6 +18,7 @@ import 'theme.dart'; ...@@ -18,6 +18,7 @@ import 'theme.dart';
/// dialog. /// dialog.
/// ///
/// See also: /// See also:
///
/// * [showDialog] /// * [showDialog]
/// * <https://www.google.com/design/spec/components/dialogs.html> /// * <https://www.google.com/design/spec/components/dialogs.html>
class Dialog extends StatelessWidget { class Dialog extends StatelessWidget {
...@@ -35,6 +36,8 @@ class Dialog extends StatelessWidget { ...@@ -35,6 +36,8 @@ class Dialog extends StatelessWidget {
/// The (optional) title of the dialog is displayed in a large font at the top /// The (optional) title of the dialog is displayed in a large font at the top
/// of the dialog. /// of the dialog.
///
/// Typically a [Text] widget.
final Widget title; final Widget title;
/// Padding around the title. /// Padding around the title.
...@@ -45,6 +48,10 @@ class Dialog extends StatelessWidget { ...@@ -45,6 +48,10 @@ class Dialog extends StatelessWidget {
/// The (optional) content of the dialog is displayed in the center of the /// The (optional) content of the dialog is displayed in the center of the
/// dialog in a lighter font. /// dialog in a lighter font.
///
/// Typically, this is a [Block] containing the contents of the dialog. Using
/// a [Block] ensures that the contents can scroll if they are too big to fit
/// on the display.
final Widget content; final Widget content;
/// Padding around the content. /// Padding around the content.
...@@ -54,6 +61,10 @@ class Dialog extends StatelessWidget { ...@@ -54,6 +61,10 @@ class Dialog extends StatelessWidget {
/// The (optional) set of actions that are displayed at the bottom of the /// The (optional) set of actions that are displayed at the bottom of the
/// dialog. /// dialog.
///
/// Typically this is a list of [FlatButton] widgets.
///
/// These widgets will be wrapped in a [ButtonBar].
final List<Widget> actions; final List<Widget> actions;
Color _getColor(BuildContext context) { Color _getColor(BuildContext context) {
......
...@@ -31,7 +31,7 @@ class DrawerItem extends StatelessWidget { ...@@ -31,7 +31,7 @@ class DrawerItem extends StatelessWidget {
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
const DrawerItem({ const DrawerItem({
Key key, Key key,
this.icon, this.icon: const Icon(null),
this.child, this.child,
this.onPressed, this.onPressed,
this.selected: false this.selected: false
......
...@@ -22,6 +22,7 @@ import 'theme.dart'; ...@@ -22,6 +22,7 @@ import 'theme.dart';
/// its body. /// its body.
/// ///
/// See also: /// See also:
///
/// * [AppBar] /// * [AppBar]
/// * [Scaffold] /// * [Scaffold]
/// * <https://www.google.com/design/spec/patterns/scrolling-techniques.html> /// * <https://www.google.com/design/spec/patterns/scrolling-techniques.html>
......
...@@ -87,7 +87,7 @@ class TextTheme { ...@@ -87,7 +87,7 @@ class TextTheme {
/// Used for the default text style for [Material]. /// Used for the default text style for [Material].
final TextStyle body1; final TextStyle body1;
/// Used for auxillary text associted with images. /// Used for auxillary text associated with images.
final TextStyle caption; final TextStyle caption;
/// Used for text on [RaisedButton] and [FlatButton]. /// Used for text on [RaisedButton] and [FlatButton].
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment