Merge pull request #2359 from krisgiesing/scaling_quality
Use bilinear interpolation when scaling images
diff --git a/bin/cache/dart-sdk.version b/bin/cache/dart-sdk.version
index 63e799c..e32424f 100644
--- a/bin/cache/dart-sdk.version
+++ b/bin/cache/dart-sdk.version
@@ -1 +1 @@
-1.14.1
+1.15.0-dev.4.0
diff --git a/bin/cache/engine.version b/bin/cache/engine.version
index 862161c..81e7dc7 100644
--- a/bin/cache/engine.version
+++ b/bin/cache/engine.version
@@ -1 +1 @@
-006a702b30182b7622f54c30f538f70df4398614
+d474e9d2b60a9cb111c09844c10081b68bde9252
diff --git a/bin/cache/material_fonts.version b/bin/cache/material_fonts.version
new file mode 100644
index 0000000..13fbdec
--- /dev/null
+++ b/bin/cache/material_fonts.version
@@ -0,0 +1 @@
+https://storage.googleapis.com/flutter_infra/flutter/fonts/b1e27075635f686ce12784a90125de693b4c360c/fonts.zip
diff --git a/bin/cache/update_dart_sdk.sh b/bin/cache/update_dart_sdk.sh
index 2e29944..a2a40f6 100755
--- a/bin/cache/update_dart_sdk.sh
+++ b/bin/cache/update_dart_sdk.sh
@@ -27,7 +27,14 @@
;;
esac
- DART_SDK_URL="http://storage.googleapis.com/dart-archive/channels/stable/raw/$DART_SDK_VERSION/sdk/$DART_ZIP_NAME"
+ DART_CHANNEL="stable"
+
+ if [[ $DART_SDK_VERSION == *"-dev."* ]]
+ then
+ DART_CHANNEL="dev"
+ fi
+
+ DART_SDK_URL="http://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/raw/$DART_SDK_VERSION/sdk/$DART_ZIP_NAME"
rm -rf -- "$DART_SDK_PATH"
mkdir -p -- "$DART_SDK_PATH"
diff --git a/bin/cache/update_material_fonts.sh b/bin/cache/update_material_fonts.sh
new file mode 100755
index 0000000..a1c8874
--- /dev/null
+++ b/bin/cache/update_material_fonts.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+set -e
+
+FLUTTER_ROOT=$(dirname $(dirname $(dirname "${BASH_SOURCE[0]}")))
+
+MATERIAL_FONTS_STAMP_PATH="$FLUTTER_ROOT/bin/cache/material_fonts.stamp"
+MATERIAL_FONTS_VERSION=`cat "$FLUTTER_ROOT/bin/cache/material_fonts.version"`
+
+if [ ! -f "$MATERIAL_FONTS_STAMP_PATH" ] || [ "$MATERIAL_FONTS_VERSION" != `cat "$MATERIAL_FONTS_STAMP_PATH"` ]; then
+ echo "Downloading Material Design fonts..."
+
+ MATERIAL_FONTS_URL="$MATERIAL_FONTS_VERSION"
+ MATERIAL_FONTS_PATH="$FLUTTER_ROOT/bin/cache/artifacts/material_fonts"
+ MATERIAL_FONTS_ZIP="$FLUTTER_ROOT/bin/cache/material_fonts.zip"
+
+ mkdir -p -- "$MATERIAL_FONTS_PATH"
+
+ curl --progress-bar -continue-at=- --location --output "$MATERIAL_FONTS_ZIP" "$MATERIAL_FONTS_URL"
+ rm -rf -- "$MATERIAL_FONTS_PATH"
+ unzip -o -q "$MATERIAL_FONTS_ZIP" -d "$MATERIAL_FONTS_PATH"
+ rm -f -- "$MATERIAL_FONTS_ZIP"
+
+ echo "$MATERIAL_FONTS_VERSION" > "$MATERIAL_FONTS_STAMP_PATH"
+fi
diff --git a/bin/flutter b/bin/flutter
index e457b4e..d711ca0 100755
--- a/bin/flutter
+++ b/bin/flutter
@@ -18,6 +18,7 @@
if [ ! -f "$SNAPSHOT_PATH" ] || [ ! -f "$STAMP_PATH" ] || [ `cat "$STAMP_PATH"` != "$REVISION" ] || [ "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]; then
"$FLUTTER_ROOT/bin/cache/update_dart_sdk.sh"
"$FLUTTER_ROOT/bin/cache/update_engine.sh"
+ "$FLUTTER_ROOT/bin/cache/update_material_fonts.sh"
echo Building flutter tool...
FLUTTER_DIR="$FLUTTER_ROOT/packages/flutter"
diff --git a/doc/index.html b/doc/index.html
index 861218c..1db959f 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -51,7 +51,7 @@
<header class="post-header">
</header>
<article class="post-content">
- <p><a href="http://flutter.io">Flutter</a> is a new project to help developers
+ <p>Flutter is a new project to help developers
build high-performance, high-fidelity,
mobile apps for iOS and Android
from a single codebase.
@@ -104,7 +104,7 @@
</svg>
</div>
<ul class="contact-list">
- <li>Flutter</li>
+ <li><a href="https://flutter.io">Flutter</a></li>
</ul>
<p class="terms">
<a href="https://twitter.com/flutterio">@flutterio</a> •
diff --git a/examples/layers/widgets/gestures.dart b/examples/layers/widgets/gestures.dart
index 6534567..0b456d8 100644
--- a/examples/layers/widgets/gestures.dart
+++ b/examples/layers/widgets/gestures.dart
@@ -29,12 +29,16 @@
Point center = (size.center(Point.origin).toOffset() * zoom + offset).toPoint();
double radius = size.width / 2.0 * zoom;
Gradient gradient = new RadialGradient(
- center: center, radius: radius,
colors: forward ? <Color>[swatch[50], swatch[900]]
: <Color>[swatch[900], swatch[50]]
);
Paint paint = new Paint()
- ..shader = gradient.createShader();
+ ..shader = gradient.createShader(new Rect.fromLTWH(
+ center.x - radius,
+ center.y - radius,
+ radius * 2.0,
+ radius * 2.0
+ ));
canvas.drawCircle(center, radius, paint);
}
diff --git a/examples/layers/widgets/media_query.dart b/examples/layers/widgets/media_query.dart
index d68c816..80caa8d 100644
--- a/examples/layers/widgets/media_query.dart
+++ b/examples/layers/widgets/media_query.dart
@@ -50,7 +50,7 @@
child: new Text(name)
),
new IconButton(
- icon: 'navigation/more_vert'
+ icon: Icons.more_vert
)
]
)
diff --git a/examples/material_gallery/flutter.yaml b/examples/material_gallery/flutter.yaml
index ac53153..c7e9081 100644
--- a/examples/material_gallery/flutter.yaml
+++ b/examples/material_gallery/flutter.yaml
@@ -1,4 +1,5 @@
name: material_gallery
+uses-material-design: true
assets:
- assets/flutter_logo.png
- assets/section_animation.png
@@ -22,42 +23,3 @@
- packages/flutter_gallery_assets/top_10_australian_beaches.png
- packages/flutter_gallery_assets/jumpingjack.json
- packages/flutter_gallery_assets/jumpingjack.png
-material-design-icons:
- - name: action/accessibility
- - name: action/account_circle
- - name: action/alarm
- - name: action/android
- - name: action/delete
- - name: action/done
- - name: action/event
- - name: action/face
- - name: action/home
- - name: action/hourglass_empty
- - name: action/info
- - name: action/language
- - name: action/list
- - name: av/play_arrow
- - name: av/sort_by_alpha
- - name: av/stop
- - name: communication/call
- - name: communication/email
- - name: communication/location_on
- - name: communication/message
- - name: content/add
- - name: content/add_circle
- - name: content/clear
- - name: content/create
- - name: image/brightness_5
- - name: image/brightness_7
- - name: image/flash_on
- - name: image/timer
- - name: navigation/arrow_back
- - name: navigation/arrow_drop_down
- - name: navigation/arrow_forward
- - name: navigation/cancel
- - name: navigation/expand_less
- - name: navigation/expand_more
- - name: navigation/menu
- - name: navigation/more_horiz
- - name: navigation/more_vert
- - name: social/person_add
diff --git a/examples/material_gallery/lib/demo/buttons_demo.dart b/examples/material_gallery/lib/demo/buttons_demo.dart
index 1cceda7..1aeb29e 100644
--- a/examples/material_gallery/lib/demo/buttons_demo.dart
+++ b/examples/material_gallery/lib/demo/buttons_demo.dart
@@ -78,7 +78,7 @@
child: new Center(
child: new FloatingActionButton(
tooltip: 'Open FAB demos',
- child: new Icon(icon: 'content/add'),
+ child: new Icon(icon: Icons.add),
onPressed: () {
Navigator.push(context, new MaterialPageRoute(
builder: (BuildContext context) => new TabsFabDemo()
diff --git a/examples/material_gallery/lib/demo/dialog_demo.dart b/examples/material_gallery/lib/demo/dialog_demo.dart
index f21f099..79fec7c 100644
--- a/examples/material_gallery/lib/demo/dialog_demo.dart
+++ b/examples/material_gallery/lib/demo/dialog_demo.dart
@@ -28,7 +28,7 @@
class DialogDemoItem extends StatelessComponent {
DialogDemoItem({ Key key, this.icon, this.color, this.text, this.onPressed }) : super(key: key);
- final String icon;
+ final IconData icon;
final Color color;
final String text;
final VoidCallback onPressed;
@@ -43,7 +43,7 @@
alignItems: FlexAlignItems.center,
children: <Widget>[
new Icon(
- size: IconSize.s36,
+ size: 36.0,
icon: icon,
color: color
),
@@ -166,19 +166,19 @@
content: new Column(
children: <Widget>[
new DialogDemoItem(
- icon: 'action/account_circle',
+ icon: Icons.account_circle,
color: theme.primaryColor,
text: 'username@gmail.com',
onPressed: () { Navigator.pop(context, 'username@gmail.com'); }
),
new DialogDemoItem(
- icon: 'action/account_circle',
+ icon: Icons.account_circle,
color: theme.primaryColor,
text: 'user02@gmail.com',
onPressed: () { Navigator.pop(context, 'user02@gmail.com'); }
),
new DialogDemoItem(
- icon: 'content/add_circle',
+ icon: Icons.add_circle,
text: 'add account',
color: theme.disabledColor
)
diff --git a/examples/material_gallery/lib/demo/fitness_demo.dart b/examples/material_gallery/lib/demo/fitness_demo.dart
index d34f4c3..b64c588 100644
--- a/examples/material_gallery/lib/demo/fitness_demo.dart
+++ b/examples/material_gallery/lib/demo/fitness_demo.dart
@@ -110,9 +110,9 @@
child: new Row(
justifyContent: FlexJustifyContent.center,
children: <Widget>[
- _createInfoPanelCell("action/accessibility", "$count", "COUNT"),
- _createInfoPanelCell("image/timer", _formatSeconds(time), "TIME"),
- _createInfoPanelCell("image/flash_on", "$kcal", "KCAL")
+ _createInfoPanelCell(Icons.accessibility, '$count', 'COUNT'),
+ _createInfoPanelCell(Icons.timer, _formatSeconds(time), 'TIME'),
+ _createInfoPanelCell(Icons.flash_on, '$kcal', 'KCAL')
]
)
),
@@ -136,7 +136,7 @@
);
}
- Widget _createInfoPanelCell(String icon, String value, String description) {
+ Widget _createInfoPanelCell(IconData icon, String value, String description) {
Color color;
if (workoutAnimation.workingOut)
color = Colors.black87;
@@ -148,7 +148,7 @@
child: new Center(
child: new Column(
children: <Widget>[
- new Icon(icon: icon, size: IconSize.s48, color: color),
+ new Icon(icon: icon, size: 48.0, color: color),
new Text(value, style: new TextStyle(fontSize: 24.0, color: color)),
new Text(description, style: new TextStyle(color: color))
]
diff --git a/examples/material_gallery/lib/demo/flexible_space_demo.dart b/examples/material_gallery/lib/demo/flexible_space_demo.dart
index 9c87e3c..f8d24c4 100644
--- a/examples/material_gallery/lib/demo/flexible_space_demo.dart
+++ b/examples/material_gallery/lib/demo/flexible_space_demo.dart
@@ -8,7 +8,7 @@
class _ContactCategory extends StatelessComponent {
_ContactCategory({ Key key, this.icon, this.children }) : super(key: key);
- final String icon;
+ final IconData icon;
final List<Widget> children;
Widget build(BuildContext context) {
@@ -38,7 +38,7 @@
assert(lines.length > 1);
}
- final String icon;
+ final IconData icon;
final List<String> lines;
Widget build(BuildContext context) {
@@ -88,11 +88,11 @@
toolBar: new ToolBar(
right: <Widget>[
new IconButton(
- icon: 'content/create',
+ icon: Icons.create,
tooltip: 'Search'
),
new IconButton(
- icon: 'navigation/more_vert',
+ icon: Icons.more_vert,
tooltip: 'Show menu'
)
],
@@ -112,17 +112,17 @@
padding: new EdgeDims.only(top: appBarHeight),
children: <Widget>[
new _ContactCategory(
- icon: 'communication/call',
+ icon: Icons.call,
children: <Widget>[
new _ContactItem(
- icon: 'communication/message',
+ icon: Icons.message,
lines: <String>[
'(650) 555-1234',
'Mobile'
]
),
new _ContactItem(
- icon: 'communication/message',
+ icon: Icons.message,
lines: <String>[
'(323) 555-6789',
'Work'
@@ -131,7 +131,7 @@
]
),
new _ContactCategory(
- icon: 'communication/email',
+ icon: Icons.email,
children: <Widget>[
new _ContactItem(
lines: <String>[
@@ -148,7 +148,7 @@
]
),
new _ContactCategory(
- icon: 'communication/location_on',
+ icon: Icons.location_on,
children: <Widget>[
new _ContactItem(
lines: <String>[
diff --git a/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart b/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
index 8814e09..3bd48c1 100644
--- a/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
+++ b/examples/material_gallery/lib/demo/full_screen_dialog_demo.dart
@@ -56,7 +56,7 @@
justifyContent: FlexJustifyContent.spaceBetween,
children: <Widget>[
new Text(new DateFormat('EEE, MMM d yyyy').format(date)),
- new Icon(icon: 'navigation/arrow_drop_down', size: IconSize.s24, color: Colors.black54),
+ new Icon(icon: Icons.arrow_drop_down, color: Colors.black54),
]
)
)
@@ -81,7 +81,7 @@
child: new Row(
children: <Widget>[
new Text('$time'),
- new Icon(icon: 'navigation/arrow_drop_down', size: IconSize.s24, color: Colors.black54),
+ new Icon(icon: Icons.arrow_drop_down, color: Colors.black54),
]
)
)
@@ -143,7 +143,7 @@
return new Scaffold(
toolBar: new ToolBar(
left: new IconButton(
- icon: 'content/clear',
+ icon: Icons.clear,
onPressed: () { handleDismissButton(context); }
),
center: new Text('New Event'),
diff --git a/examples/material_gallery/lib/demo/grid_list_demo.dart b/examples/material_gallery/lib/demo/grid_list_demo.dart
index 8068368..9f3ff81 100644
--- a/examples/material_gallery/lib/demo/grid_list_demo.dart
+++ b/examples/material_gallery/lib/demo/grid_list_demo.dart
@@ -72,7 +72,7 @@
return new GridTile(
header: new GridTileBar(
backgroundColor: Colors.black.withAlpha(0x08),
- left: new Icon(icon: 'action/info', color: Colors.white70),
+ left: new Icon(icon: Icons.info, color: Colors.white70),
title: new Text(photo.title)
),
child: image
@@ -84,7 +84,7 @@
backgroundColor: Colors.black.withAlpha(0x08),
title: new Text(photo.title),
caption: new Text(photo.caption),
- right: new Icon(icon: 'action/info', color: Colors.white70)
+ right: new Icon(icon: Icons.info, color: Colors.white70)
),
child: image
);
@@ -176,7 +176,7 @@
center: new Text('Grid List'),
right: <Widget>[
new IconButton(
- icon: "navigation/more_vert",
+ icon: Icons.more_vert,
onPressed: () { showTileStyleMenu(context); },
tooltip: 'Show menu'
)
diff --git a/examples/material_gallery/lib/demo/icons_demo.dart b/examples/material_gallery/lib/demo/icons_demo.dart
index 321c092..3146fda 100644
--- a/examples/material_gallery/lib/demo/icons_demo.dart
+++ b/examples/material_gallery/lib/demo/icons_demo.dart
@@ -42,12 +42,12 @@
});
}
- Widget buildIconButton(IconSize size, String name, bool enabled) {
+ Widget buildIconButton(double size, IconData icon, bool enabled) {
return new IconButton(
size: size,
- icon: name,
+ icon: icon,
color: iconColor,
- tooltip: "${enabled ? 'enabled' : 'disabled'} $name icon button",
+ tooltip: "${enabled ? 'enabled' : 'disabled'} icon button",
onPressed: enabled ? handleIconButtonPress : null
);
}
@@ -97,10 +97,10 @@
alignItems: FlexAlignItems.center,
children: <Widget>[
new Text('Enabled', style: textStyle),
- buildIconButton(IconSize.s18, 'action/face', true),
- buildIconButton(IconSize.s24, 'action/alarm', true),
- buildIconButton(IconSize.s36, 'action/home', true),
- buildIconButton(IconSize.s48, 'action/android', true)
+ buildIconButton(18.0, Icons.face, true),
+ buildIconButton(24.0, Icons.alarm, true),
+ buildIconButton(36.0, Icons.home, true),
+ buildIconButton(48.0, Icons.android, true)
]
)
),
@@ -109,10 +109,10 @@
alignItems: FlexAlignItems.center,
children: <Widget>[
new Text('Disabled', style: textStyle),
- buildIconButton(IconSize.s18, 'action/face', false),
- buildIconButton(IconSize.s24, 'action/alarm', false),
- buildIconButton(IconSize.s36, 'action/home', false),
- buildIconButton(IconSize.s48, 'action/android', false)
+ buildIconButton(18.0, Icons.face, false),
+ buildIconButton(24.0, Icons.alarm, false),
+ buildIconButton(36.0, Icons.home, false),
+ buildIconButton(48.0, Icons.android, false)
]
)
)
@@ -126,7 +126,7 @@
justifyContent: FlexJustifyContent.center,
children: <Widget>[
new Icon(
- icon: 'image/brightness_7',
+ icon: Icons.brightness_7,
color: iconColor.withAlpha(0x33) // 0.2 * 255 = 0x33
),
new Slider(
@@ -141,7 +141,7 @@
}
),
new Icon(
- icon: 'image/brightness_7',
+ icon: Icons.brightness_7,
color: iconColor.withAlpha(0xFF)
),
]
diff --git a/examples/material_gallery/lib/demo/list_demo.dart b/examples/material_gallery/lib/demo/list_demo.dart
index 466bf51..053cb93 100644
--- a/examples/material_gallery/lib/demo/list_demo.dart
+++ b/examples/material_gallery/lib/demo/list_demo.dart
@@ -149,7 +149,7 @@
left: _showAvatars ? new CircleAvatar(child: new Text(item)) : null,
primary: new Text('This item represents $item'),
secondary: secondary,
- right: _showIcons ? new Icon(icon: 'action/info', color: Theme.of(context).disabledColor) : null
+ right: _showIcons ? new Icon(icon: Icons.info, color: Theme.of(context).disabledColor) : null
);
}
@@ -178,7 +178,7 @@
center: new Text('Scrolling List\n$itemSizeText$layoutText'),
right: <Widget>[
new IconButton(
- icon: "av/sort_by_alpha",
+ icon: Icons.sort_by_alpha,
tooltip: 'Sort',
onPressed: () {
setState(() {
@@ -188,7 +188,7 @@
}
),
new IconButton(
- icon: "navigation/more_vert",
+ icon: Icons.more_vert,
tooltip: 'Show menu',
onPressed: () { showConfigurationSheet(context); }
)
diff --git a/examples/material_gallery/lib/demo/menu_demo.dart b/examples/material_gallery/lib/demo/menu_demo.dart
index b8e76fe..75b51d0 100644
--- a/examples/material_gallery/lib/demo/menu_demo.dart
+++ b/examples/material_gallery/lib/demo/menu_demo.dart
@@ -111,33 +111,33 @@
primary: new Text('An item with a sectioned menu'),
right: new PopupMenuButton<String>(
onSelected: showMenuSelection,
- items: <PopupMenuItem>[
+ items: <PopupMenuEntry<String>>[
new PopupMenuItem(
value: 'Preview',
child: new ListItem(
- left: new Icon(icon: 'action/visibility'),
+ left: new Icon(icon: Icons.visibility),
primary: new Text('Preview')
)
),
new PopupMenuItem(
value: 'Share',
child: new ListItem(
- left: new Icon(icon: 'social/person_add'),
+ left: new Icon(icon: Icons.person_add),
primary: new Text('Share')
)
),
new PopupMenuItem(
value: 'Get Link',
- hasDivider: true,
child: new ListItem(
- left: new Icon(icon: 'content/link'),
+ left: new Icon(icon: Icons.link),
primary: new Text('Get Link')
)
),
+ new PopupMenuDivider(),
new PopupMenuItem(
value: 'Remove',
child: new ListItem(
- left: new Icon(icon: 'action/delete'),
+ left: new Icon(icon: Icons.delete),
primary: new Text('Remove')
)
)
diff --git a/examples/material_gallery/lib/demo/page_selector_demo.dart b/examples/material_gallery/lib/demo/page_selector_demo.dart
index 959ca00..160d138 100644
--- a/examples/material_gallery/lib/demo/page_selector_demo.dart
+++ b/examples/material_gallery/lib/demo/page_selector_demo.dart
@@ -5,13 +5,13 @@
import 'package:flutter/material.dart';
class PageSelectorDemo extends StatelessComponent {
- Widget _buildTabView(String iconName) {
+ Widget _buildTabView(IconData icon) {
return new Container(
- key: new ValueKey<String>(iconName),
+ key: new ObjectKey(icon),
padding: const EdgeDims.all(12.0),
child: new Card(
child: new Center(
- child: new Icon(icon: 'action/$iconName', size:IconSize.s48)
+ child: new Icon(icon: icon, size: 48.0)
)
)
);
@@ -24,12 +24,19 @@
}
Widget build(BuildContext notUsed) { // Can't find the TabBarSelection from this context.
- final List<String> iconNames = <String>['event', 'home', 'android', 'alarm', 'face', 'language'];
+ final List<IconData> icons = <IconData>[
+ Icons.event,
+ Icons.home,
+ Icons.android,
+ Icons.alarm,
+ Icons.face,
+ Icons.language,
+ ];
return new Scaffold(
toolBar: new ToolBar(center: new Text('Page Selector')),
body: new TabBarSelection(
- values: iconNames,
+ values: icons,
child: new Builder(
builder: (BuildContext context) {
return new Column(
@@ -39,13 +46,13 @@
child: new Row(
children: <Widget>[
new IconButton(
- icon: 'navigation/arrow_back',
+ icon: Icons.arrow_back,
onPressed: () { _handleArrowButtonPress(context, -1); },
tooltip: 'Back'
),
new TabPageSelector<String>(),
new IconButton(
- icon: 'navigation/arrow_forward',
+ icon: Icons.arrow_forward,
onPressed: () { _handleArrowButtonPress(context, 1); },
tooltip: 'Forward'
)
@@ -55,7 +62,7 @@
),
new Flexible(
child: new TabBarView(
- children: iconNames.map(_buildTabView).toList()
+ children: icons.map(_buildTabView).toList()
)
)
]
diff --git a/examples/material_gallery/lib/demo/persistent_bottom_sheet_demo.dart b/examples/material_gallery/lib/demo/persistent_bottom_sheet_demo.dart
index eb2ab47..1b279f6 100644
--- a/examples/material_gallery/lib/demo/persistent_bottom_sheet_demo.dart
+++ b/examples/material_gallery/lib/demo/persistent_bottom_sheet_demo.dart
@@ -30,7 +30,7 @@
return new Scaffold(
toolBar: new ToolBar(center: new Text("Persistent Bottom Sheet")),
floatingActionButton: new FloatingActionButton(
- child: new Icon(icon: 'content/add'),
+ child: new Icon(icon: Icons.add),
backgroundColor: Colors.redAccent[200]
),
body: new Builder(
diff --git a/examples/material_gallery/lib/demo/tabs_demo.dart b/examples/material_gallery/lib/demo/tabs_demo.dart
index c26c5d5..efcd921 100644
--- a/examples/material_gallery/lib/demo/tabs_demo.dart
+++ b/examples/material_gallery/lib/demo/tabs_demo.dart
@@ -5,29 +5,45 @@
import 'package:flutter/material.dart';
class TabsDemo extends StatelessComponent {
- final List<String> iconNames = <String>["event", "home", "android", "alarm", "face", "language"];
+ final List<IconData> icons = <IconData>[
+ Icons.event,
+ Icons.home,
+ Icons.android,
+ Icons.alarm,
+ Icons.face,
+ Icons.language,
+ ];
+
+ final Map<IconData, String> labels = <IconData, String>{
+ Icons.event: 'EVENT',
+ Icons.home: 'HOME',
+ Icons.android: 'ANDROID',
+ Icons.alarm: 'ALARM',
+ Icons.face: 'FACE',
+ Icons.language: 'LANGUAGE',
+ };
Widget build(_) {
return new TabBarSelection(
- values: iconNames,
+ values: icons,
child: new Scaffold(
toolBar: new ToolBar(
center: new Text("Scrollable Tabs"),
tabBar: new TabBar<String>(
isScrollable: true,
labels: new Map.fromIterable(
- iconNames,
- value: (String iconName) => new TabLabel(text: iconName.toUpperCase(), icon: "action/$iconName")
+ icons,
+ value: (IconData icon) => new TabLabel(text: labels[icon], icon: icon)
)
)
),
body: new TabBarView(
- children: iconNames.map((String iconName) {
+ children: icons.map((IconData icon) {
return new Container(
- key: new ValueKey<String>(iconName),
+ key: new ObjectKey(icon),
padding: const EdgeDims.all(12.0),
child: new Card(
- child: new Center(child: new Icon(icon: "action/$iconName", size:IconSize.s48))
+ child: new Center(child: new Icon(icon: icon, size: 48.0))
)
);
}).toList()
diff --git a/examples/material_gallery/lib/demo/tabs_fab_demo.dart b/examples/material_gallery/lib/demo/tabs_fab_demo.dart
index 9c4f0a3..136bd8c 100644
--- a/examples/material_gallery/lib/demo/tabs_fab_demo.dart
+++ b/examples/material_gallery/lib/demo/tabs_fab_demo.dart
@@ -9,7 +9,7 @@
final String label;
final Map<int, Color> colors;
- final String icon;
+ final IconData icon;
TabLabel get tabLabel => new TabLabel(text: label.toUpperCase());
Color get labelColor => colors != null ? colors[300] : Colors.grey[300];
@@ -32,12 +32,12 @@
class _TabsFabDemoState extends State<TabsFabDemo> {
final GlobalKey scaffoldKey = new GlobalKey();
final List<_Page> pages = <_Page>[
- new _Page(label: 'Blue', colors: Colors.indigo, icon: 'content/add'),
- new _Page(label: 'Too', colors: Colors.indigo, icon: 'content/add'),
- new _Page(label: 'Eco', colors: Colors.green, icon: 'content/create'),
+ new _Page(label: 'Blue', colors: Colors.indigo, icon: Icons.add),
+ new _Page(label: 'Too', colors: Colors.indigo, icon: Icons.add),
+ new _Page(label: 'Eco', colors: Colors.green, icon: Icons.create),
new _Page(label: 'No'),
- new _Page(label: 'Teal', colors: Colors.teal, icon: 'content/add'),
- new _Page(label: 'Red', colors: Colors.red, icon: 'content/create')
+ new _Page(label: 'Teal', colors: Colors.teal, icon: Icons.add),
+ new _Page(label: 'Red', colors: Colors.red, icon: Icons.create),
];
_Page selectedPage;
diff --git a/examples/material_gallery/lib/demo/tooltip_demo.dart b/examples/material_gallery/lib/demo/tooltip_demo.dart
index 2f97994..b79fa9e 100644
--- a/examples/material_gallery/lib/demo/tooltip_demo.dart
+++ b/examples/material_gallery/lib/demo/tooltip_demo.dart
@@ -28,8 +28,8 @@
new Tooltip(
message: 'call icon',
child: new Icon(
- size: IconSize.s18,
- icon: 'communication/call',
+ size: 18.0,
+ icon: Icons.call,
color: theme.primaryColor
)
),
@@ -38,8 +38,8 @@
),
new Center(
child: new IconButton(
- size: IconSize.s48,
- icon: 'communication/call',
+ size: 48.0,
+ icon: Icons.call,
color: theme.primaryColor,
tooltip: 'place a phone call',
onPressed: () {
diff --git a/examples/material_gallery/lib/demo/weathers_demo.dart b/examples/material_gallery/lib/demo/weathers_demo.dart
index 2613678..942255e 100644
--- a/examples/material_gallery/lib/demo/weathers_demo.dart
+++ b/examples/material_gallery/lib/demo/weathers_demo.dart
@@ -276,14 +276,15 @@
void paint(Canvas canvas) {
applyTransformForPivot(canvas);
+ Rect rect = Point.origin & size;
Paint gradientPaint = new Paint()..shader = new LinearGradient(
- begin: Point.origin,
- end: new Point(0.0, size.height),
+ begin: const Offset(0.0, 0.0),
+ end: const Offset(0.0, 1.0),
colors: <Color>[colorTop, colorBottom],
stops: <double>[0.0, 1.0]
- ).createShader();
+ ).createShader(rect);
- canvas.drawRect(new Rect.fromLTWH(0.0, 0.0, size.width, size.height), gradientPaint);
+ canvas.drawRect(rect, gradientPaint);
}
}
diff --git a/examples/material_gallery/lib/gallery/drawer.dart b/examples/material_gallery/lib/gallery/drawer.dart
index 6836cfc..db3cf8f 100644
--- a/examples/material_gallery/lib/gallery/drawer.dart
+++ b/examples/material_gallery/lib/gallery/drawer.dart
@@ -27,7 +27,7 @@
children: <Widget>[
new DrawerHeader(child: new Text('Flutter Gallery')),
new DrawerItem(
- icon: 'image/brightness_5',
+ icon: Icons.brightness_5,
onPressed: () { _changeTheme(context, true); },
selected: GalleryApp.of(context).lightTheme,
child: new Row(
@@ -42,7 +42,7 @@
)
),
new DrawerItem(
- icon: 'image/brightness_7',
+ icon: Icons.brightness_7,
onPressed: () { _changeTheme(context, false); },
selected: !GalleryApp.of(context).lightTheme,
child: new Row(
@@ -56,9 +56,9 @@
]
)
),
- new DrawerDivider(),
+ new Divider(),
new DrawerItem(
- icon: 'action/hourglass_empty',
+ icon: Icons.hourglass_empty,
selected: timeDilation != 1.0,
onPressed: () { _toggleAnimationSpeed(context); },
child: new Row(
diff --git a/examples/stocks/flutter.yaml b/examples/stocks/flutter.yaml
index 3b90bcb..ee90ca7 100644
--- a/examples/stocks/flutter.yaml
+++ b/examples/stocks/flutter.yaml
@@ -1,26 +1,4 @@
name: stocks
version: 0.0.2
update-url: http://localhost:9888/
-material-design-icons:
- - name: action/accessibility
- - name: action/account_balance
- - name: action/assessment
- - name: action/backup
- - name: action/done
- - name: action/help
- - name: action/picture_in_picture
- - name: action/search
- - name: action/settings
- - name: action/thumb_down
- - name: action/thumb_up
- - name: content/add
- - name: device/dvr
- - name: editor/border_all
- - name: editor/border_clear
- - name: navigation/arrow_back
- - name: navigation/menu
- - name: navigation/more_vert
- - name: editor/format_color_text
- - name: image/filter_none
- - name: hardware/mouse
- - name: image/gradient
+uses-material-design: true
diff --git a/examples/stocks/lib/stock_home.dart b/examples/stocks/lib/stock_home.dart
index ef04f85..f3b1f96 100644
--- a/examples/stocks/lib/stock_home.dart
+++ b/examples/stocks/lib/stock_home.dart
@@ -28,8 +28,8 @@
child: new Row(
children: <Widget>[
new Icon(
- icon: 'device/dvr',
- size: IconSize.s18
+ icon: Icons.dvr,
+ size: 18.0
),
new Container(
width: 8.0
@@ -124,12 +124,12 @@
child: new Block(children: <Widget>[
new DrawerHeader(child: new Text('Stocks')),
new DrawerItem(
- icon: 'action/assessment',
+ icon: Icons.assessment,
selected: true,
child: new Text('Stock List')
),
new DrawerItem(
- icon: 'action/account_balance',
+ icon: Icons.account_balance,
onPressed: () {
showDialog(
context: context,
@@ -156,7 +156,7 @@
child: new Text('Account Balance')
),
new DrawerItem(
- icon: 'device/dvr',
+ icon: Icons.dvr,
onPressed: () {
try {
debugDumpApp();
@@ -169,9 +169,9 @@
},
child: new Text('Dump App to Console')
),
- new DrawerDivider(),
+ new Divider(),
new DrawerItem(
- icon: 'action/thumb_up',
+ icon: Icons.thumb_up,
onPressed: () => _handleStockModeChange(StockMode.optimistic),
child: new Row(
children: <Widget>[
@@ -181,7 +181,7 @@
)
),
new DrawerItem(
- icon: 'action/thumb_down',
+ icon: Icons.thumb_down,
onPressed: () => _handleStockModeChange(StockMode.pessimistic),
child: new Row(
children: <Widget>[
@@ -190,13 +190,13 @@
]
)
),
- new DrawerDivider(),
+ new Divider(),
new DrawerItem(
- icon: 'action/settings',
+ icon: Icons.settings,
onPressed: _handleShowSettings,
child: new Text('Settings')),
new DrawerItem(
- icon: 'action/help',
+ icon: Icons.help,
child: new Text('Help & Feedback'))
])
);
@@ -212,7 +212,7 @@
center: new Text(StockStrings.of(context).title()),
right: <Widget>[
new IconButton(
- icon: "action/search",
+ icon: Icons.search,
onPressed: _handleSearchBegin,
tooltip: 'Search'
),
@@ -305,7 +305,7 @@
Widget buildSearchBar() {
return new ToolBar(
left: new IconButton(
- icon: 'navigation/arrow_back',
+ icon: Icons.arrow_back,
color: Theme.of(context).accentColor,
onPressed: _handleSearchEnd,
tooltip: 'Back'
@@ -330,7 +330,7 @@
Widget buildFloatingActionButton() {
return new FloatingActionButton(
tooltip: 'Create company',
- child: new Icon(icon: 'content/add'),
+ child: new Icon(icon: Icons.add),
backgroundColor: Colors.redAccent[200],
onPressed: _handleCreateCompany
);
diff --git a/examples/stocks/lib/stock_settings.dart b/examples/stocks/lib/stock_settings.dart
index a2f9442..215c66b 100644
--- a/examples/stocks/lib/stock_settings.dart
+++ b/examples/stocks/lib/stock_settings.dart
@@ -103,7 +103,7 @@
Widget buildSettingsPane(BuildContext context) {
List<Widget> rows = <Widget>[
new DrawerItem(
- icon: 'action/thumb_up',
+ icon: Icons.thumb_up,
onPressed: () => _confirmOptimismChange(),
child: new Row(
children: <Widget>[
@@ -116,7 +116,7 @@
)
),
new DrawerItem(
- icon: 'action/backup',
+ icon: Icons.backup,
onPressed: () { _handleBackupChanged(!(config.configuration.backupMode == BackupMode.enabled)); },
child: new Row(
children: <Widget>[
@@ -129,7 +129,7 @@
)
),
new DrawerItem(
- icon: 'action/picture_in_picture',
+ icon: Icons.picture_in_picture,
onPressed: () { _handleShowPerformanceOverlayChanged(!config.configuration.showPerformanceOverlay); },
child: new Row(
children: <Widget>[
@@ -142,7 +142,7 @@
)
),
new DrawerItem(
- icon: 'action/accessibility',
+ icon: Icons.accessibility,
onPressed: () { _handleShowSemanticsDebuggerChanged(!config.configuration.showSemanticsDebugger); },
child: new Row(
children: <Widget>[
@@ -159,7 +159,7 @@
// material grid and size construction lines are only available in checked mode
rows.addAll([
new DrawerItem(
- icon: 'editor/border_clear',
+ icon: Icons.border_clear,
onPressed: () { _handleShowGridChanged(!config.configuration.debugShowGrid); },
child: new Row(
children: <Widget>[
@@ -172,7 +172,7 @@
)
),
new DrawerItem(
- icon: 'editor/border_all',
+ icon: Icons.border_all,
onPressed: () { _handleShowSizesChanged(!config.configuration.debugShowSizes); },
child: new Row(
children: <Widget>[
@@ -185,7 +185,7 @@
)
),
new DrawerItem(
- icon: 'editor/format_color_text',
+ icon: Icons.format_color_text,
onPressed: () { _handleShowBaselinesChanged(!config.configuration.debugShowBaselines); },
child: new Row(
children: <Widget>[
@@ -198,7 +198,7 @@
)
),
new DrawerItem(
- icon: 'image/filter_none',
+ icon: Icons.filter_none,
onPressed: () { _handleShowLayersChanged(!config.configuration.debugShowLayers); },
child: new Row(
children: <Widget>[
@@ -211,7 +211,7 @@
)
),
new DrawerItem(
- icon: 'hardware/mouse',
+ icon: Icons.mouse,
onPressed: () { _handleShowPointersChanged(!config.configuration.debugShowPointers); },
child: new Row(
children: <Widget>[
@@ -224,7 +224,7 @@
)
),
new DrawerItem(
- icon: 'image/gradient',
+ icon: Icons.gradient,
onPressed: () { _handleShowRainbowChanged(!config.configuration.debugShowRainbow); },
child: new Row(
children: <Widget>[
diff --git a/examples/stocks/test/icon_color_test.dart b/examples/stocks/test/icon_color_test.dart
index b3aed5c..84a6a7b 100644
--- a/examples/stocks/test/icon_color_test.dart
+++ b/examples/stocks/test/icon_color_test.dart
@@ -44,19 +44,9 @@
// way to find the menu item. I hope.
Element semantics = findElementOfExactWidgetTypeGoingUp(tester.findText(label), MergeSemantics);
expect(semantics, isNotNull);
- Element asset = findElementOfExactWidgetTypeGoingDown(semantics, AssetImage);
- RenderImage imageBox = asset.findRenderObject();
- Match match = materialIconAssetNameColorExtractor.firstMatch(asset.widget.name);
- expect(match, isNotNull);
- if (color == const Color(0xFFFFFFFF)) {
- expect(match[1], equals('white'));
- expect(imageBox.color, isNull);
- } else if (color == const Color(0xFF000000)) {
- expect(match[1], equals('black'));
- expect(imageBox.color, isNull);
- } else {
- expect(imageBox.color, equals(color));
- }
+ Element asset = findElementOfExactWidgetTypeGoingDown(semantics, Text);
+ Text text = asset.widget;
+ expect(text.style.color, equals(color));
}
void main() {
diff --git a/examples/widgets/card_collection.dart b/examples/widgets/card_collection.dart
index 512619d..5d2ffe7 100644
--- a/examples/widgets/card_collection.dart
+++ b/examples/widgets/card_collection.dart
@@ -120,7 +120,7 @@
Widget _buildDrawer() {
return new Drawer(
child: new IconTheme(
- data: const IconThemeData(color: IconThemeColor.black),
+ data: const IconThemeData(color: Colors.black),
child: new Block(children: <Widget>[
new DrawerHeader(child: new Text('Options')),
buildDrawerCheckbox("Make card labels editable", _editable, _toggleEditable),
@@ -128,22 +128,22 @@
buildDrawerCheckbox("Fixed size cards", _fixedSizeCards, _toggleFixedSizeCards),
buildDrawerCheckbox("Let the sun shine", _sunshine, _toggleSunshine),
buildDrawerCheckbox("Vary font sizes", _varyFontSizes, _toggleVaryFontSizes, enabled: !_editable),
- new DrawerDivider(),
+ new Divider(),
buildDrawerColorRadioItem("Deep Purple", Colors.deepPurple, _primaryColor, _selectColor),
buildDrawerColorRadioItem("Green", Colors.green, _primaryColor, _selectColor),
buildDrawerColorRadioItem("Amber", Colors.amber, _primaryColor, _selectColor),
buildDrawerColorRadioItem("Teal", Colors.teal, _primaryColor, _selectColor),
- new DrawerDivider(),
- buildDrawerDirectionRadioItem("Dismiss horizontally", DismissDirection.horizontal, _dismissDirection, _changeDismissDirection, icon: 'action/code'),
- buildDrawerDirectionRadioItem("Dismiss left", DismissDirection.left, _dismissDirection, _changeDismissDirection, icon: 'navigation/arrow_back'),
- buildDrawerDirectionRadioItem("Dismiss right", DismissDirection.right, _dismissDirection, _changeDismissDirection, icon: 'navigation/arrow_forward'),
- new DrawerDivider(),
- buildFontRadioItem("Left-align text", new TextStyle(textAlign: TextAlign.left), _textStyle, _changeTextStyle, icon: 'editor/format_align_left', enabled: !_editable),
- buildFontRadioItem("Center-align text", new TextStyle(textAlign: TextAlign.center), _textStyle, _changeTextStyle, icon: 'editor/format_align_center', enabled: !_editable),
- buildFontRadioItem("Right-align text", new TextStyle(textAlign: TextAlign.right), _textStyle, _changeTextStyle, icon: 'editor/format_align_right', enabled: !_editable),
- new DrawerDivider(),
+ new Divider(),
+ buildDrawerDirectionRadioItem("Dismiss horizontally", DismissDirection.horizontal, _dismissDirection, _changeDismissDirection, icon: Icons.code),
+ buildDrawerDirectionRadioItem("Dismiss left", DismissDirection.left, _dismissDirection, _changeDismissDirection, icon: Icons.arrow_back),
+ buildDrawerDirectionRadioItem("Dismiss right", DismissDirection.right, _dismissDirection, _changeDismissDirection, icon: Icons.arrow_forward),
+ new Divider(),
+ buildFontRadioItem("Left-align text", new TextStyle(textAlign: TextAlign.left), _textStyle, _changeTextStyle, icon: Icons.format_align_left, enabled: !_editable),
+ buildFontRadioItem("Center-align text", new TextStyle(textAlign: TextAlign.center), _textStyle, _changeTextStyle, icon: Icons.format_align_center, enabled: !_editable),
+ buildFontRadioItem("Right-align text", new TextStyle(textAlign: TextAlign.right), _textStyle, _changeTextStyle, icon: Icons.format_align_right, enabled: !_editable),
+ new Divider(),
new DrawerItem(
- icon: 'device/dvr',
+ icon: Icons.dvr,
onPressed: () { debugDumpApp(); debugDumpRenderTree(); },
child: new Text('Dump App to Console')
),
@@ -221,7 +221,7 @@
);
}
- Widget buildDrawerColorRadioItem(String label, Map<int, Color> itemValue, Map<int, Color> currentValue, ValueChanged<Map<int, Color>> onChanged, { String icon, bool enabled: true }) {
+ Widget buildDrawerColorRadioItem(String label, Map<int, Color> itemValue, Map<int, Color> currentValue, ValueChanged<Map<int, Color>> onChanged, { IconData icon, bool enabled: true }) {
return new DrawerItem(
icon: icon,
onPressed: enabled ? () { onChanged(itemValue); } : null,
@@ -238,7 +238,7 @@
);
}
- Widget buildDrawerDirectionRadioItem(String label, DismissDirection itemValue, DismissDirection currentValue, ValueChanged<DismissDirection> onChanged, { String icon, bool enabled: true }) {
+ Widget buildDrawerDirectionRadioItem(String label, DismissDirection itemValue, DismissDirection currentValue, ValueChanged<DismissDirection> onChanged, { IconData icon, bool enabled: true }) {
return new DrawerItem(
icon: icon,
onPressed: enabled ? () { onChanged(itemValue); } : null,
@@ -255,7 +255,7 @@
);
}
- Widget buildFontRadioItem(String label, TextStyle itemValue, TextStyle currentValue, ValueChanged<TextStyle> onChanged, { String icon, bool enabled: true }) {
+ Widget buildFontRadioItem(String label, TextStyle itemValue, TextStyle currentValue, ValueChanged<TextStyle> onChanged, { IconData icon, bool enabled: true }) {
return new DrawerItem(
icon: icon,
onPressed: enabled ? () { onChanged(itemValue); } : null,
@@ -347,11 +347,11 @@
backgroundMessage = "Unsupported dismissDirection";
}
- Widget leftArrowIcon = new Icon(icon: 'navigation/arrow_back', size: IconSize.s36);
+ Widget leftArrowIcon = new Icon(icon: Icons.arrow_back, size: 36.0);
if (_dismissDirection == DismissDirection.right)
leftArrowIcon = new Opacity(opacity: 0.1, child: leftArrowIcon);
- Widget rightArrowIcon = new Icon(icon: 'navigation/arrow_forward', size: IconSize.s36);
+ Widget rightArrowIcon = new Icon(icon: Icons.arrow_forward, size: 36.0);
if (_dismissDirection == DismissDirection.left)
rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon);
@@ -385,19 +385,19 @@
return new IconTheme(
key: cardModel.key,
- data: const IconThemeData(color: IconThemeColor.white),
+ data: const IconThemeData(color: Colors.white),
child: new Stack(children: <Widget>[background, card])
);
}
Shader _createShader(Rect bounds) {
return new LinearGradient(
- begin: bounds.topLeft,
- end: bounds.bottomLeft,
+ begin: const Offset(0.0, 0.0),
+ end: const Offset(0.0, 1.0),
colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
stops: <double>[0.1, 0.35]
)
- .createShader();
+ .createShader(bounds);
}
Widget build(BuildContext context) {
diff --git a/examples/widgets/flutter.yaml b/examples/widgets/flutter.yaml
index 773cebd..b393464 100644
--- a/examples/widgets/flutter.yaml
+++ b/examples/widgets/flutter.yaml
@@ -1,26 +1,4 @@
name: widgets
+uses-material-design: true
assets:
- assets/starcircle.png
-material-design-icons:
- - name: action/account_circle
- - name: action/alarm
- - name: action/android
- - name: action/assessment
- - name: action/code
- - name: action/event
- - name: action/face
- - name: action/home
- - name: action/language
- - name: action/list
- - name: content/add
- - name: content/create
- - name: device/dvr
- - name: editor/format_align_center
- - name: editor/format_align_left
- - name: editor/format_align_right
- - name: navigation/arrow_back
- - name: navigation/arrow_forward
- - name: navigation/menu
- - name: navigation/more_horiz
- - name: navigation/more_vert
- - name: navigation/refresh
diff --git a/examples/widgets/hero_under.dart b/examples/widgets/hero_under.dart
index 1c1b5bc..ed5a397 100644
--- a/examples/widgets/hero_under.dart
+++ b/examples/widgets/hero_under.dart
@@ -52,8 +52,8 @@
Widget build(BuildContext context) {
return new Scaffold(
toolBar: new ToolBar(
- left: new IconButton(icon: "navigation/menu"),
- center: new Text("Diets")
+ left: new IconButton(icon: Icons.menu),
+ center: new Text('Diets')
),
body: new Center(
child: new GestureDetector(
@@ -105,11 +105,11 @@
padding: new EdgeDims.only(top: ui.window.padding.top),
backgroundColor: const Color(0x00000000),
left: new IconButton(
- icon: "navigation/arrow_back",
+ icon: Icons.arrow_back,
onPressed: () => Navigator.pop(context)
),
right: <Widget>[
- new IconButton(icon: "navigation/more_vert")
+ new IconButton(icon: Icons.more_vert)
]
),
new Positioned(
diff --git a/examples/widgets/http_post.dart b/examples/widgets/http_post.dart
index a6b5f21..db50016 100644
--- a/examples/widgets/http_post.dart
+++ b/examples/widgets/http_post.dart
@@ -64,7 +64,7 @@
floatingActionButton: new FloatingActionButton(
tooltip: 'Refresh',
child: new Icon(
- icon: 'navigation/refresh'
+ icon: Icons.refresh
),
onPressed: _refresh
)
diff --git a/examples/widgets/pageable_list.dart b/examples/widgets/pageable_list.dart
index 142c9c6..6f0eca1 100644
--- a/examples/widgets/pageable_list.dart
+++ b/examples/widgets/pageable_list.dart
@@ -81,13 +81,13 @@
child: new Block(children: <Widget>[
new DrawerHeader(child: new Text('Options')),
new DrawerItem(
- icon: 'navigation/more_horiz',
+ icon: Icons.more_horiz,
selected: scrollDirection == Axis.horizontal,
child: new Text('Horizontal Layout'),
onPressed: switchScrollDirection
),
new DrawerItem(
- icon: 'navigation/more_vert',
+ icon: Icons.more_vert,
selected: scrollDirection == Axis.vertical,
child: new Text('Vertical Layout'),
onPressed: switchScrollDirection
@@ -124,7 +124,7 @@
Widget build(BuildContext context) {
return new IconTheme(
- data: const IconThemeData(color: IconThemeColor.white),
+ data: const IconThemeData(color: Colors.white),
child: new Scaffold(
toolBar: _buildToolBar(),
drawer: _buildDrawer(),
diff --git a/packages/flutter/lib/material.dart b/packages/flutter/lib/material.dart
index 2fcfa45..f529776 100644
--- a/packages/flutter/lib/material.dart
+++ b/packages/flutter/lib/material.dart
@@ -20,9 +20,9 @@
export 'src/material/date_picker_dialog.dart';
export 'src/material/dialog.dart';
export 'src/material/drawer.dart';
-export 'src/material/drawer_divider.dart';
export 'src/material/drawer_header.dart';
export 'src/material/drawer_item.dart';
+export 'src/material/divider.dart';
export 'src/material/dropdown.dart';
export 'src/material/flat_button.dart';
export 'src/material/flexible_space_bar.dart';
@@ -30,6 +30,7 @@
export 'src/material/grid_tile.dart';
export 'src/material/grid_tile_bar.dart';
export 'src/material/icon.dart';
+export 'src/material/icons.dart';
export 'src/material/icon_button.dart';
export 'src/material/icon_theme.dart';
export 'src/material/icon_theme_data.dart';
diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart
index e4c0b20..205ecd4 100644
--- a/packages/flutter/lib/src/animation/animation_controller.dart
+++ b/packages/flutter/lib/src/animation/animation_controller.dart
@@ -125,13 +125,17 @@
}
/// Starts running this animation forwards (towards the end).
- Future forward() {
+ Future forward({ double from }) {
+ if (from != null)
+ value = from;
_direction = _AnimationDirection.forward;
return animateTo(upperBound);
}
/// Starts running this animation in reverse (towards the beginning).
- Future reverse() {
+ Future reverse({ double from }) {
+ if (from != null)
+ value = from;
_direction = _AnimationDirection.reverse;
return animateTo(lowerBound);
}
diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart
index 31af536..3e64a8c 100644
--- a/packages/flutter/lib/src/material/chip.dart
+++ b/packages/flutter/lib/src/material/chip.dart
@@ -7,6 +7,7 @@
import 'colors.dart';
import 'debug.dart';
import 'icon.dart';
+import 'icons.dart';
import 'tooltip.dart';
const double _kChipHeight = 32.0;
@@ -66,8 +67,8 @@
child: new Container(
padding: const EdgeDims.symmetric(horizontal: 4.0),
child: new Icon(
- icon: 'navigation/cancel',
- size: IconSize.s18,
+ icon: Icons.cancel,
+ size: 18.0,
color: Colors.black54
)
)
diff --git a/packages/flutter/lib/src/material/divider.dart b/packages/flutter/lib/src/material/divider.dart
new file mode 100644
index 0000000..0781e97
--- /dev/null
+++ b/packages/flutter/lib/src/material/divider.dart
@@ -0,0 +1,34 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import 'package:flutter/widgets.dart';
+
+import 'theme.dart';
+
+class Divider extends StatelessComponent {
+ Divider({ Key key, this.height: 16.0, this.indent: 0.0, this.color }) : super(key: key) {
+ assert(height >= 1.0);
+ }
+
+ final double height;
+ final double indent;
+ final Color color;
+
+ Widget build(BuildContext context) {
+ final double bottom = (height ~/ 2.0).toDouble();
+ return new Container(
+ height: 0.0,
+ margin: new EdgeDims.only(
+ top: height - bottom - 1.0,
+ left: indent,
+ bottom: bottom
+ ),
+ decoration: new BoxDecoration(
+ border: new Border(
+ bottom: new BorderSide(color: color ?? Theme.of(context).dividerColor)
+ )
+ )
+ );
+ }
+}
diff --git a/packages/flutter/lib/src/material/drawer_divider.dart b/packages/flutter/lib/src/material/drawer_divider.dart
deleted file mode 100644
index 4816892..0000000
--- a/packages/flutter/lib/src/material/drawer_divider.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-import 'package:flutter/widgets.dart';
-
-import 'theme.dart';
-
-class DrawerDivider extends StatelessComponent {
- const DrawerDivider({ Key key }) : super(key: key);
-
- Widget build(BuildContext context) {
- return new Container(
- height: 0.0,
- decoration: new BoxDecoration(
- border: new Border(
- bottom: new BorderSide(
- color: Theme.of(context).dividerColor
- )
- )
- ),
- margin: const EdgeDims.symmetric(vertical: 8.0)
- );
- }
-}
diff --git a/packages/flutter/lib/src/material/drawer_item.dart b/packages/flutter/lib/src/material/drawer_item.dart
index 035fc6d..60b63e7 100644
--- a/packages/flutter/lib/src/material/drawer_item.dart
+++ b/packages/flutter/lib/src/material/drawer_item.dart
@@ -6,6 +6,7 @@
import 'colors.dart';
import 'icon.dart';
+import 'icons.dart';
import 'ink_well.dart';
import 'theme.dart';
@@ -18,7 +19,7 @@
this.selected: false
}) : super(key: key);
- final String icon;
+ final IconData icon;
final Widget child;
final VoidCallback onPressed;
final bool selected;
diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart
index db0c8ac..84c976e 100644
--- a/packages/flutter/lib/src/material/dropdown.dart
+++ b/packages/flutter/lib/src/material/dropdown.dart
@@ -8,6 +8,7 @@
import 'debug.dart';
import 'icon.dart';
+import 'icons.dart';
import 'ink_well.dart';
import 'shadows.dart';
import 'theme.dart';
@@ -298,7 +299,7 @@
alignment: const FractionalOffset(0.5, 0.0)
),
new Container(
- child: new Icon(icon: 'navigation/arrow_drop_down', size: IconSize.s36),
+ child: new Icon(icon: Icons.arrow_drop_down, size: 36.0),
padding: const EdgeDims.only(top: 6.0)
)
],
diff --git a/packages/flutter/lib/src/material/floating_action_button.dart b/packages/flutter/lib/src/material/floating_action_button.dart
index 7abd7f3..682f2b5 100644
--- a/packages/flutter/lib/src/material/floating_action_button.dart
+++ b/packages/flutter/lib/src/material/floating_action_button.dart
@@ -4,8 +4,9 @@
import 'package:flutter/widgets.dart';
-import 'icon_theme.dart';
+import 'colors.dart';
import 'icon_theme_data.dart';
+import 'icon_theme.dart';
import 'ink_well.dart';
import 'material.dart';
import 'theme.dart';
@@ -94,17 +95,17 @@
}
Widget build(BuildContext context) {
- IconThemeColor iconThemeColor = IconThemeColor.white;
+ Color iconColor = Colors.white;
Color materialColor = config.backgroundColor;
if (materialColor == null) {
ThemeData themeData = Theme.of(context);
materialColor = themeData.accentColor;
- iconThemeColor = themeData.accentColorBrightness == ThemeBrightness.dark ? IconThemeColor.white : IconThemeColor.black;
+ iconColor = themeData.accentColorBrightness == ThemeBrightness.dark ? Colors.white : Colors.black;
}
Widget result = new Center(
child: new IconTheme(
- data: new IconThemeData(color: iconThemeColor),
+ data: new IconThemeData(color: iconColor),
child: new RotationTransition(
turns: _childSegue,
child: config.child
diff --git a/packages/flutter/lib/src/material/grid_tile_bar.dart b/packages/flutter/lib/src/material/grid_tile_bar.dart
index 8ed4de4..bd3cede 100644
--- a/packages/flutter/lib/src/material/grid_tile_bar.dart
+++ b/packages/flutter/lib/src/material/grid_tile_bar.dart
@@ -4,6 +4,7 @@
import 'package:flutter/widgets.dart';
+import 'colors.dart';
import 'icon_theme.dart';
import 'icon_theme_data.dart';
import 'typography.dart';
@@ -77,7 +78,7 @@
padding: padding,
decoration: decoration,
child: new IconTheme(
- data: new IconThemeData(color: IconThemeColor.white),
+ data: new IconThemeData(color: Colors.white),
child: new Row(
alignItems: FlexAlignItems.center,
children: children
diff --git a/packages/flutter/lib/src/material/icon.dart b/packages/flutter/lib/src/material/icon.dart
index 9548ebd..d27572d 100644
--- a/packages/flutter/lib/src/material/icon.dart
+++ b/packages/flutter/lib/src/material/icon.dart
@@ -5,103 +5,82 @@
import 'package:flutter/widgets.dart';
import 'colors.dart';
+import 'icons.dart';
import 'icon_theme.dart';
-import 'icon_theme_data.dart';
import 'theme.dart';
-enum IconSize {
- s18,
- s24,
- s36,
- s48,
-}
-
-const Map<IconSize, int> _kIconSize = const <IconSize, int>{
- IconSize.s18: 18,
- IconSize.s24: 24,
- IconSize.s36: 36,
- IconSize.s48: 48,
-};
-
+/// A material design icon.
+///
+/// Available icons are shown on this page:
+/// <https://design.google.com/icons/>
+///
+/// Icons are identified by their name (as given on that page), with
+/// spaces converted to underscores, from the [Icons] class. For
+/// example, the "alarm add" icon is [Icons.alarm_add].
+///
+/// To use this class, make sure you set `uses-material-design: true`
+/// in your project's `flutter.yaml` file. This ensures that the
+/// MaterialIcons font is included in your application. This font is
+/// used to display the icons.
class Icon extends StatelessComponent {
Icon({
Key key,
- this.size: IconSize.s24,
this.icon,
- this.colorTheme,
+ this.size: 24.0,
this.color
}) : super(key: key) {
assert(size != null);
}
- final IconSize size;
- final String icon;
- final IconThemeColor colorTheme;
+ /// The size of the icon in logical pixels.
+ ///
+ /// Icons occupy a square with width and height equal to size.
+ final double size;
+
+ /// The icon to display.
+ final IconData icon;
+
+ /// The color to use when drawing the icon.
final Color color;
- IconThemeColor _getIconThemeColor(BuildContext context) {
- IconThemeColor iconThemeColor = colorTheme;
- if (iconThemeColor == null) {
- IconThemeData iconThemeData = IconTheme.of(context);
- iconThemeColor = iconThemeData == null ? null : iconThemeData.color;
+ Color _getDefaultColorForThemeBrightness(ThemeBrightness brightness) {
+ switch (brightness) {
+ case ThemeBrightness.dark:
+ return Colors.white;
+ case ThemeBrightness.light:
+ return Colors.black;
}
- if (iconThemeColor == null) {
- ThemeBrightness themeBrightness = Theme.of(context).brightness;
- iconThemeColor = themeBrightness == ThemeBrightness.dark ? IconThemeColor.white : IconThemeColor.black;
- }
- return iconThemeColor;
+ }
+
+ Color _getDefaultColor(BuildContext context) {
+ return IconTheme.of(context)?.color ?? _getDefaultColorForThemeBrightness(Theme.of(context).brightness);
}
Widget build(BuildContext context) {
- final int iconSize = _kIconSize[size];
- if (icon == null) {
- return new SizedBox(
- width: iconSize.toDouble(),
- height: iconSize.toDouble()
- );
- }
+ if (icon == null)
+ return new SizedBox(width: size, height: size);
- String category = '';
- String subtype = '';
- List<String> parts = icon.split('/');
- if (parts.length == 2) {
- category = parts[0];
- subtype = parts[1];
- }
- final IconThemeColor iconThemeColor = _getIconThemeColor(context);
-
- String colorSuffix;
- switch(iconThemeColor) {
- case IconThemeColor.black:
- colorSuffix = "black";
- break;
- case IconThemeColor.white:
- colorSuffix = "white";
- break;
- }
-
- Color iconColor = color;
+ Color iconColor = color ?? _getDefaultColor(context);
final int iconAlpha = (255.0 * (IconTheme.of(context)?.clampedOpacity ?? 1.0)).round();
- if (iconAlpha != 255) {
- if (color != null) {
+ if (iconAlpha != 255)
iconColor = color.withAlpha((iconAlpha * color.opacity).round());
- } else {
- switch(iconThemeColor) {
- case IconThemeColor.black:
- iconColor = Colors.black.withAlpha(iconAlpha);
- break;
- case IconThemeColor.white:
- iconColor = Colors.white.withAlpha(iconAlpha);
- break;
- }
- }
- }
- return new AssetImage(
- name: '$category/ic_${subtype}_${colorSuffix}_${iconSize}dp.png',
- width: iconSize.toDouble(),
- height: iconSize.toDouble(),
- color: iconColor
+ return new ExcludeSemantics(
+ child: new SizedBox(
+ width: size,
+ height: size,
+ child: new Center(
+ child: new Text(
+ new String.fromCharCode(icon.codePoint),
+ style: new TextStyle(
+ inherit: false,
+ color: iconColor,
+ fontSize: size,
+ fontFamily: 'MaterialIcons'
+ )
+ )
+ )
+ )
);
}
@@ -109,8 +88,6 @@
super.debugFillDescription(description);
description.add('$icon');
description.add('size: $size');
- if (this.colorTheme != null)
- description.add('colorTheme: $colorTheme');
if (this.color != null)
description.add('color: $color');
}
diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart
index 58353f6..8626974 100644
--- a/packages/flutter/lib/src/material/icon_button.dart
+++ b/packages/flutter/lib/src/material/icon_button.dart
@@ -5,7 +5,7 @@
import 'package:flutter/widgets.dart';
import 'icon.dart';
-import 'icon_theme_data.dart';
+import 'icons.dart';
import 'ink_well.dart';
import 'theme.dart';
import 'tooltip.dart';
@@ -22,23 +22,34 @@
class IconButton extends StatelessComponent {
const IconButton({
Key key,
- this.size: IconSize.s24,
+ this.size: 24.0,
this.icon,
- this.colorTheme,
this.color,
this.onPressed,
this.tooltip
}) : super(key: key);
- final IconSize size;
- final String icon;
- final IconThemeColor colorTheme;
+ /// The size of the icon inside the button.
+ ///
+ /// The button itself will be larger than the icon by 8.0 logical pixels in
+ /// each direction.
+ final double size;
+
+ /// The icon to display inside the button.
+ final IconData icon;
+
+ /// The color to use for the icon inside the button.
final Color color;
/// The callback that is invoked when the button is tapped or otherwise activated.
///
/// If this is set to null, the button will be disabled.
final VoidCallback onPressed;
+
+ /// Text that describes the action that will occur when the button is pressed.
+ ///
+ /// This text is displayed when the user long-presses on the button and is
+ /// used for accessibility.
final String tooltip;
Widget build(BuildContext context) {
@@ -47,7 +58,6 @@
child: new Icon(
size: size,
icon: icon,
- colorTheme: colorTheme,
color: onPressed != null ? color : Theme.of(context).disabledColor
)
);
@@ -68,8 +78,6 @@
description.add('$icon');
if (onPressed == null)
description.add('disabled');
- if (colorTheme != null)
- description.add('$colorTheme');
if (tooltip != null)
description.add('tooltip: "$tooltip"');
}
diff --git a/packages/flutter/lib/src/material/icon_theme_data.dart b/packages/flutter/lib/src/material/icon_theme_data.dart
index dc4b42d..860a872 100644
--- a/packages/flutter/lib/src/material/icon_theme_data.dart
+++ b/packages/flutter/lib/src/material/icon_theme_data.dart
@@ -3,21 +3,22 @@
// found in the LICENSE file.
import 'dart:ui' as ui show lerpDouble;
-import 'dart:ui' show hashValues;
-
-enum IconThemeColor { white, black }
+import 'dart:ui' show Color, hashValues;
class IconThemeData {
const IconThemeData({ this.color, this.opacity });
- final IconThemeColor color;
+ /// The default color for icons.
+ final Color color;
+
+ /// An opacity to apply to both explicit and default icon colors.
final double opacity;
double get clampedOpacity => (opacity ?? 1.0).clamp(0.0, 1.0);
static IconThemeData lerp(IconThemeData begin, IconThemeData end, double t) {
return new IconThemeData(
- color: t < 0.5 ? begin.color : end.color,
+ color: Color.lerp(begin.color, end.color, t),
opacity: ui.lerpDouble(begin.clampedOpacity, end.clampedOpacity, t)
);
}
diff --git a/packages/flutter/lib/src/material/icons.dart b/packages/flutter/lib/src/material/icons.dart
new file mode 100644
index 0000000..485f441
--- /dev/null
+++ b/packages/flutter/lib/src/material/icons.dart
@@ -0,0 +1,954 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+class IconData {
+ const IconData(this.codePoint);
+ final int codePoint;
+
+ bool operator ==(dynamic other) {
+ if (other is! IconData)
+ return false;
+ final IconData typedOther = other;
+ return codePoint == typedOther.codePoint;
+ }
+ int get hashCode => codePoint.hashCode;
+ String toString() => 'IconData(codePoint: $codePoint)';
+}
+
+class Icons {
+ Icons._();
+
+ static const IconData threed_rotation = const IconData(0xe84d); // 3d_rotation isn't a valid identifier.
+ static const IconData ac_unit = const IconData(0xeb3b);
+ static const IconData access_alarm = const IconData(0xe190);
+ static const IconData access_alarms = const IconData(0xe191);
+ static const IconData access_time = const IconData(0xe192);
+ static const IconData accessibility = const IconData(0xe84e);
+ static const IconData accessible = const IconData(0xe914);
+ static const IconData account_balance = const IconData(0xe84f);
+ static const IconData account_balance_wallet = const IconData(0xe850);
+ static const IconData account_box = const IconData(0xe851);
+ static const IconData account_circle = const IconData(0xe853);
+ static const IconData adb = const IconData(0xe60e);
+ static const IconData add = const IconData(0xe145);
+ static const IconData add_a_photo = const IconData(0xe439);
+ static const IconData add_alarm = const IconData(0xe193);
+ static const IconData add_alert = const IconData(0xe003);
+ static const IconData add_box = const IconData(0xe146);
+ static const IconData add_circle = const IconData(0xe147);
+ static const IconData add_circle_outline = const IconData(0xe148);
+ static const IconData add_location = const IconData(0xe567);
+ static const IconData add_shopping_cart = const IconData(0xe854);
+ static const IconData add_to_photos = const IconData(0xe39d);
+ static const IconData add_to_queue = const IconData(0xe05c);
+ static const IconData adjust = const IconData(0xe39e);
+ static const IconData airline_seat_flat = const IconData(0xe630);
+ static const IconData airline_seat_flat_angled = const IconData(0xe631);
+ static const IconData airline_seat_individual_suite = const IconData(0xe632);
+ static const IconData airline_seat_legroom_extra = const IconData(0xe633);
+ static const IconData airline_seat_legroom_normal = const IconData(0xe634);
+ static const IconData airline_seat_legroom_reduced = const IconData(0xe635);
+ static const IconData airline_seat_recline_extra = const IconData(0xe636);
+ static const IconData airline_seat_recline_normal = const IconData(0xe637);
+ static const IconData airplanemode_active = const IconData(0xe195);
+ static const IconData airplanemode_inactive = const IconData(0xe194);
+ static const IconData airplay = const IconData(0xe055);
+ static const IconData airport_shuttle = const IconData(0xeb3c);
+ static const IconData alarm = const IconData(0xe855);
+ static const IconData alarm_add = const IconData(0xe856);
+ static const IconData alarm_off = const IconData(0xe857);
+ static const IconData alarm_on = const IconData(0xe858);
+ static const IconData album = const IconData(0xe019);
+ static const IconData all_inclusive = const IconData(0xeb3d);
+ static const IconData all_out = const IconData(0xe90b);
+ static const IconData android = const IconData(0xe859);
+ static const IconData announcement = const IconData(0xe85a);
+ static const IconData apps = const IconData(0xe5c3);
+ static const IconData archive = const IconData(0xe149);
+ static const IconData arrow_back = const IconData(0xe5c4);
+ static const IconData arrow_downward = const IconData(0xe5db);
+ static const IconData arrow_drop_down = const IconData(0xe5c5);
+ static const IconData arrow_drop_down_circle = const IconData(0xe5c6);
+ static const IconData arrow_drop_up = const IconData(0xe5c7);
+ static const IconData arrow_forward = const IconData(0xe5c8);
+ static const IconData arrow_upward = const IconData(0xe5d8);
+ static const IconData art_track = const IconData(0xe060);
+ static const IconData aspect_ratio = const IconData(0xe85b);
+ static const IconData assessment = const IconData(0xe85c);
+ static const IconData assignment = const IconData(0xe85d);
+ static const IconData assignment_ind = const IconData(0xe85e);
+ static const IconData assignment_late = const IconData(0xe85f);
+ static const IconData assignment_return = const IconData(0xe860);
+ static const IconData assignment_returned = const IconData(0xe861);
+ static const IconData assignment_turned_in = const IconData(0xe862);
+ static const IconData assistant = const IconData(0xe39f);
+ static const IconData assistant_photo = const IconData(0xe3a0);
+ static const IconData attach_file = const IconData(0xe226);
+ static const IconData attach_money = const IconData(0xe227);
+ static const IconData attachment = const IconData(0xe2bc);
+ static const IconData audiotrack = const IconData(0xe3a1);
+ static const IconData autoreconst = const IconData(0xe863);
+ static const IconData av_timer = const IconData(0xe01b);
+ static const IconData backspace = const IconData(0xe14a);
+ static const IconData backup = const IconData(0xe864);
+ static const IconData battery_alert = const IconData(0xe19c);
+ static const IconData battery_charging_full = const IconData(0xe1a3);
+ static const IconData battery_full = const IconData(0xe1a4);
+ static const IconData battery_std = const IconData(0xe1a5);
+ static const IconData battery_unknown = const IconData(0xe1a6);
+ static const IconData beach_access = const IconData(0xeb3e);
+ static const IconData beenhere = const IconData(0xe52d);
+ static const IconData block = const IconData(0xe14b);
+ static const IconData bluetooth = const IconData(0xe1a7);
+ static const IconData bluetooth_audio = const IconData(0xe60f);
+ static const IconData bluetooth_connected = const IconData(0xe1a8);
+ static const IconData bluetooth_disabled = const IconData(0xe1a9);
+ static const IconData bluetooth_searching = const IconData(0xe1aa);
+ static const IconData blur_circular = const IconData(0xe3a2);
+ static const IconData blur_linear = const IconData(0xe3a3);
+ static const IconData blur_off = const IconData(0xe3a4);
+ static const IconData blur_on = const IconData(0xe3a5);
+ static const IconData book = const IconData(0xe865);
+ static const IconData bookmark = const IconData(0xe866);
+ static const IconData bookmark_border = const IconData(0xe867);
+ static const IconData border_all = const IconData(0xe228);
+ static const IconData border_bottom = const IconData(0xe229);
+ static const IconData border_clear = const IconData(0xe22a);
+ static const IconData border_color = const IconData(0xe22b);
+ static const IconData border_horizontal = const IconData(0xe22c);
+ static const IconData border_inner = const IconData(0xe22d);
+ static const IconData border_left = const IconData(0xe22e);
+ static const IconData border_outer = const IconData(0xe22f);
+ static const IconData border_right = const IconData(0xe230);
+ static const IconData border_style = const IconData(0xe231);
+ static const IconData border_top = const IconData(0xe232);
+ static const IconData border_vertical = const IconData(0xe233);
+ static const IconData branding_watermark = const IconData(0xe06b);
+ static const IconData brightness_1 = const IconData(0xe3a6);
+ static const IconData brightness_2 = const IconData(0xe3a7);
+ static const IconData brightness_3 = const IconData(0xe3a8);
+ static const IconData brightness_4 = const IconData(0xe3a9);
+ static const IconData brightness_5 = const IconData(0xe3aa);
+ static const IconData brightness_6 = const IconData(0xe3ab);
+ static const IconData brightness_7 = const IconData(0xe3ac);
+ static const IconData brightness_auto = const IconData(0xe1ab);
+ static const IconData brightness_high = const IconData(0xe1ac);
+ static const IconData brightness_low = const IconData(0xe1ad);
+ static const IconData brightness_medium = const IconData(0xe1ae);
+ static const IconData broken_image = const IconData(0xe3ad);
+ static const IconData brush = const IconData(0xe3ae);
+ static const IconData bubble_chart = const IconData(0xe6dd);
+ static const IconData bug_report = const IconData(0xe868);
+ static const IconData build = const IconData(0xe869);
+ static const IconData burst_mode = const IconData(0xe43c);
+ static const IconData business = const IconData(0xe0af);
+ static const IconData business_center = const IconData(0xeb3f);
+ static const IconData cached = const IconData(0xe86a);
+ static const IconData cake = const IconData(0xe7e9);
+ static const IconData call = const IconData(0xe0b0);
+ static const IconData call_end = const IconData(0xe0b1);
+ static const IconData call_made = const IconData(0xe0b2);
+ static const IconData call_merge = const IconData(0xe0b3);
+ static const IconData call_missed = const IconData(0xe0b4);
+ static const IconData call_missed_outgoing = const IconData(0xe0e4);
+ static const IconData call_received = const IconData(0xe0b5);
+ static const IconData call_split = const IconData(0xe0b6);
+ static const IconData call_to_action = const IconData(0xe06c);
+ static const IconData camera = const IconData(0xe3af);
+ static const IconData camera_alt = const IconData(0xe3b0);
+ static const IconData camera_enhance = const IconData(0xe8fc);
+ static const IconData camera_front = const IconData(0xe3b1);
+ static const IconData camera_rear = const IconData(0xe3b2);
+ static const IconData camera_roll = const IconData(0xe3b3);
+ static const IconData cancel = const IconData(0xe5c9);
+ static const IconData card_giftcard = const IconData(0xe8f6);
+ static const IconData card_membership = const IconData(0xe8f7);
+ static const IconData card_travel = const IconData(0xe8f8);
+ static const IconData casino = const IconData(0xeb40);
+ static const IconData cast = const IconData(0xe307);
+ static const IconData cast_connected = const IconData(0xe308);
+ static const IconData center_focus_strong = const IconData(0xe3b4);
+ static const IconData center_focus_weak = const IconData(0xe3b5);
+ static const IconData change_history = const IconData(0xe86b);
+ static const IconData chat = const IconData(0xe0b7);
+ static const IconData chat_bubble = const IconData(0xe0ca);
+ static const IconData chat_bubble_outline = const IconData(0xe0cb);
+ static const IconData check = const IconData(0xe5ca);
+ static const IconData check_box = const IconData(0xe834);
+ static const IconData check_box_outline_blank = const IconData(0xe835);
+ static const IconData check_circle = const IconData(0xe86c);
+ static const IconData chevron_left = const IconData(0xe5cb);
+ static const IconData chevron_right = const IconData(0xe5cc);
+ static const IconData child_care = const IconData(0xeb41);
+ static const IconData child_friendly = const IconData(0xeb42);
+ static const IconData chrome_reader_mode = const IconData(0xe86d);
+ static const IconData class_ = const IconData(0xe86e); // class is a reserved word in Dart.
+ static const IconData clear = const IconData(0xe14c);
+ static const IconData clear_all = const IconData(0xe0b8);
+ static const IconData close = const IconData(0xe5cd);
+ static const IconData closed_caption = const IconData(0xe01c);
+ static const IconData cloud = const IconData(0xe2bd);
+ static const IconData cloud_circle = const IconData(0xe2be);
+ static const IconData cloud_done = const IconData(0xe2bf);
+ static const IconData cloud_download = const IconData(0xe2c0);
+ static const IconData cloud_off = const IconData(0xe2c1);
+ static const IconData cloud_queue = const IconData(0xe2c2);
+ static const IconData cloud_upload = const IconData(0xe2c3);
+ static const IconData code = const IconData(0xe86f);
+ static const IconData collections = const IconData(0xe3b6);
+ static const IconData collections_bookmark = const IconData(0xe431);
+ static const IconData color_lens = const IconData(0xe3b7);
+ static const IconData colorize = const IconData(0xe3b8);
+ static const IconData comment = const IconData(0xe0b9);
+ static const IconData compare = const IconData(0xe3b9);
+ static const IconData compare_arrows = const IconData(0xe915);
+ static const IconData computer = const IconData(0xe30a);
+ static const IconData confirmation_number = const IconData(0xe638);
+ static const IconData contact_mail = const IconData(0xe0d0);
+ static const IconData contact_phone = const IconData(0xe0cf);
+ static const IconData contacts = const IconData(0xe0ba);
+ static const IconData content_copy = const IconData(0xe14d);
+ static const IconData content_cut = const IconData(0xe14e);
+ static const IconData content_paste = const IconData(0xe14f);
+ static const IconData control_point = const IconData(0xe3ba);
+ static const IconData control_point_duplicate = const IconData(0xe3bb);
+ static const IconData copyright = const IconData(0xe90c);
+ static const IconData create = const IconData(0xe150);
+ static const IconData create_const_folder = const IconData(0xe2cc);
+ static const IconData credit_card = const IconData(0xe870);
+ static const IconData crop = const IconData(0xe3be);
+ static const IconData crop_16_9 = const IconData(0xe3bc);
+ static const IconData crop_3_2 = const IconData(0xe3bd);
+ static const IconData crop_5_4 = const IconData(0xe3bf);
+ static const IconData crop_7_5 = const IconData(0xe3c0);
+ static const IconData crop_din = const IconData(0xe3c1);
+ static const IconData crop_free = const IconData(0xe3c2);
+ static const IconData crop_landscape = const IconData(0xe3c3);
+ static const IconData crop_original = const IconData(0xe3c4);
+ static const IconData crop_portrait = const IconData(0xe3c5);
+ static const IconData crop_rotate = const IconData(0xe437);
+ static const IconData crop_square = const IconData(0xe3c6);
+ static const IconData dashboard = const IconData(0xe871);
+ static const IconData data_usage = const IconData(0xe1af);
+ static const IconData date_range = const IconData(0xe916);
+ static const IconData dehaze = const IconData(0xe3c7);
+ static const IconData delete = const IconData(0xe872);
+ static const IconData delete_forever = const IconData(0xe92b);
+ static const IconData delete_sweep = const IconData(0xe16c);
+ static const IconData description = const IconData(0xe873);
+ static const IconData desktop_mac = const IconData(0xe30b);
+ static const IconData desktop_windows = const IconData(0xe30c);
+ static const IconData details = const IconData(0xe3c8);
+ static const IconData developer_board = const IconData(0xe30d);
+ static const IconData developer_mode = const IconData(0xe1b0);
+ static const IconData device_hub = const IconData(0xe335);
+ static const IconData devices = const IconData(0xe1b1);
+ static const IconData devices_other = const IconData(0xe337);
+ static const IconData dialer_sip = const IconData(0xe0bb);
+ static const IconData dialpad = const IconData(0xe0bc);
+ static const IconData directions = const IconData(0xe52e);
+ static const IconData directions_bike = const IconData(0xe52f);
+ static const IconData directions_boat = const IconData(0xe532);
+ static const IconData directions_bus = const IconData(0xe530);
+ static const IconData directions_car = const IconData(0xe531);
+ static const IconData directions_railway = const IconData(0xe534);
+ static const IconData directions_run = const IconData(0xe566);
+ static const IconData directions_subway = const IconData(0xe533);
+ static const IconData directions_transit = const IconData(0xe535);
+ static const IconData directions_walk = const IconData(0xe536);
+ static const IconData disc_full = const IconData(0xe610);
+ static const IconData dns = const IconData(0xe875);
+ static const IconData do_not_disturb = const IconData(0xe612);
+ static const IconData do_not_disturb_alt = const IconData(0xe611);
+ static const IconData do_not_disturb_off = const IconData(0xe643);
+ static const IconData do_not_disturb_on = const IconData(0xe644);
+ static const IconData dock = const IconData(0xe30e);
+ static const IconData domain = const IconData(0xe7ee);
+ static const IconData done = const IconData(0xe876);
+ static const IconData done_all = const IconData(0xe877);
+ static const IconData donut_large = const IconData(0xe917);
+ static const IconData donut_small = const IconData(0xe918);
+ static const IconData drafts = const IconData(0xe151);
+ static const IconData drag_handle = const IconData(0xe25d);
+ static const IconData drive_eta = const IconData(0xe613);
+ static const IconData dvr = const IconData(0xe1b2);
+ static const IconData edit = const IconData(0xe3c9);
+ static const IconData edit_location = const IconData(0xe568);
+ static const IconData eject = const IconData(0xe8fb);
+ static const IconData email = const IconData(0xe0be);
+ static const IconData enhanced_encryption = const IconData(0xe63f);
+ static const IconData equalizer = const IconData(0xe01d);
+ static const IconData error = const IconData(0xe000);
+ static const IconData error_outline = const IconData(0xe001);
+ static const IconData euro_symbol = const IconData(0xe926);
+ static const IconData ev_station = const IconData(0xe56d);
+ static const IconData event = const IconData(0xe878);
+ static const IconData event_available = const IconData(0xe614);
+ static const IconData event_busy = const IconData(0xe615);
+ static const IconData event_note = const IconData(0xe616);
+ static const IconData event_seat = const IconData(0xe903);
+ static const IconData exit_to_app = const IconData(0xe879);
+ static const IconData expand_less = const IconData(0xe5ce);
+ static const IconData expand_more = const IconData(0xe5cf);
+ static const IconData explicit = const IconData(0xe01e);
+ static const IconData explore = const IconData(0xe87a);
+ static const IconData exposure = const IconData(0xe3ca);
+ static const IconData exposure_neg_1 = const IconData(0xe3cb);
+ static const IconData exposure_neg_2 = const IconData(0xe3cc);
+ static const IconData exposure_plus_1 = const IconData(0xe3cd);
+ static const IconData exposure_plus_2 = const IconData(0xe3ce);
+ static const IconData exposure_zero = const IconData(0xe3cf);
+ static const IconData extension = const IconData(0xe87b);
+ static const IconData face = const IconData(0xe87c);
+ static const IconData fast_forward = const IconData(0xe01f);
+ static const IconData fast_rewind = const IconData(0xe020);
+ static const IconData favorite = const IconData(0xe87d);
+ static const IconData favorite_border = const IconData(0xe87e);
+ static const IconData featured_play_list = const IconData(0xe06d);
+ static const IconData featured_video = const IconData(0xe06e);
+ static const IconData feedback = const IconData(0xe87f);
+ static const IconData fiber_dvr = const IconData(0xe05d);
+ static const IconData fiber_manual_record = const IconData(0xe061);
+ static const IconData fiber_const = const IconData(0xe05e);
+ static const IconData fiber_pin = const IconData(0xe06a);
+ static const IconData fiber_smart_record = const IconData(0xe062);
+ static const IconData file_download = const IconData(0xe2c4);
+ static const IconData file_upload = const IconData(0xe2c6);
+ static const IconData filter = const IconData(0xe3d3);
+ static const IconData filter_1 = const IconData(0xe3d0);
+ static const IconData filter_2 = const IconData(0xe3d1);
+ static const IconData filter_3 = const IconData(0xe3d2);
+ static const IconData filter_4 = const IconData(0xe3d4);
+ static const IconData filter_5 = const IconData(0xe3d5);
+ static const IconData filter_6 = const IconData(0xe3d6);
+ static const IconData filter_7 = const IconData(0xe3d7);
+ static const IconData filter_8 = const IconData(0xe3d8);
+ static const IconData filter_9 = const IconData(0xe3d9);
+ static const IconData filter_9_plus = const IconData(0xe3da);
+ static const IconData filter_b_and_w = const IconData(0xe3db);
+ static const IconData filter_center_focus = const IconData(0xe3dc);
+ static const IconData filter_drama = const IconData(0xe3dd);
+ static const IconData filter_frames = const IconData(0xe3de);
+ static const IconData filter_hdr = const IconData(0xe3df);
+ static const IconData filter_list = const IconData(0xe152);
+ static const IconData filter_none = const IconData(0xe3e0);
+ static const IconData filter_tilt_shift = const IconData(0xe3e2);
+ static const IconData filter_vintage = const IconData(0xe3e3);
+ static const IconData find_in_page = const IconData(0xe880);
+ static const IconData find_replace = const IconData(0xe881);
+ static const IconData fingerprint = const IconData(0xe90d);
+ static const IconData first_page = const IconData(0xe5dc);
+ static const IconData fitness_center = const IconData(0xeb43);
+ static const IconData flag = const IconData(0xe153);
+ static const IconData flare = const IconData(0xe3e4);
+ static const IconData flash_auto = const IconData(0xe3e5);
+ static const IconData flash_off = const IconData(0xe3e6);
+ static const IconData flash_on = const IconData(0xe3e7);
+ static const IconData flight = const IconData(0xe539);
+ static const IconData flight_land = const IconData(0xe904);
+ static const IconData flight_takeoff = const IconData(0xe905);
+ static const IconData flip = const IconData(0xe3e8);
+ static const IconData flip_to_back = const IconData(0xe882);
+ static const IconData flip_to_front = const IconData(0xe883);
+ static const IconData folder = const IconData(0xe2c7);
+ static const IconData folder_open = const IconData(0xe2c8);
+ static const IconData folder_shared = const IconData(0xe2c9);
+ static const IconData folder_special = const IconData(0xe617);
+ static const IconData font_download = const IconData(0xe167);
+ static const IconData format_align_center = const IconData(0xe234);
+ static const IconData format_align_justify = const IconData(0xe235);
+ static const IconData format_align_left = const IconData(0xe236);
+ static const IconData format_align_right = const IconData(0xe237);
+ static const IconData format_bold = const IconData(0xe238);
+ static const IconData format_clear = const IconData(0xe239);
+ static const IconData format_color_fill = const IconData(0xe23a);
+ static const IconData format_color_reset = const IconData(0xe23b);
+ static const IconData format_color_text = const IconData(0xe23c);
+ static const IconData format_indent_decrease = const IconData(0xe23d);
+ static const IconData format_indent_increase = const IconData(0xe23e);
+ static const IconData format_italic = const IconData(0xe23f);
+ static const IconData format_line_spacing = const IconData(0xe240);
+ static const IconData format_list_bulleted = const IconData(0xe241);
+ static const IconData format_list_numbered = const IconData(0xe242);
+ static const IconData format_paint = const IconData(0xe243);
+ static const IconData format_quote = const IconData(0xe244);
+ static const IconData format_shapes = const IconData(0xe25e);
+ static const IconData format_size = const IconData(0xe245);
+ static const IconData format_strikethrough = const IconData(0xe246);
+ static const IconData format_textdirection_l_to_r = const IconData(0xe247);
+ static const IconData format_textdirection_r_to_l = const IconData(0xe248);
+ static const IconData format_underlined = const IconData(0xe249);
+ static const IconData forum = const IconData(0xe0bf);
+ static const IconData forward = const IconData(0xe154);
+ static const IconData forward_10 = const IconData(0xe056);
+ static const IconData forward_30 = const IconData(0xe057);
+ static const IconData forward_5 = const IconData(0xe058);
+ static const IconData free_breakfast = const IconData(0xeb44);
+ static const IconData fullscreen = const IconData(0xe5d0);
+ static const IconData fullscreen_exit = const IconData(0xe5d1);
+ static const IconData functions = const IconData(0xe24a);
+ static const IconData g_translate = const IconData(0xe927);
+ static const IconData gamepad = const IconData(0xe30f);
+ static const IconData games = const IconData(0xe021);
+ static const IconData gavel = const IconData(0xe90e);
+ static const IconData gesture = const IconData(0xe155);
+ static const IconData get_app = const IconData(0xe884);
+ static const IconData gif = const IconData(0xe908);
+ static const IconData golf_course = const IconData(0xeb45);
+ static const IconData gps_fixed = const IconData(0xe1b3);
+ static const IconData gps_not_fixed = const IconData(0xe1b4);
+ static const IconData gps_off = const IconData(0xe1b5);
+ static const IconData grade = const IconData(0xe885);
+ static const IconData gradient = const IconData(0xe3e9);
+ static const IconData grain = const IconData(0xe3ea);
+ static const IconData graphic_eq = const IconData(0xe1b8);
+ static const IconData grid_off = const IconData(0xe3eb);
+ static const IconData grid_on = const IconData(0xe3ec);
+ static const IconData group = const IconData(0xe7ef);
+ static const IconData group_add = const IconData(0xe7f0);
+ static const IconData group_work = const IconData(0xe886);
+ static const IconData hd = const IconData(0xe052);
+ static const IconData hdr_off = const IconData(0xe3ed);
+ static const IconData hdr_on = const IconData(0xe3ee);
+ static const IconData hdr_strong = const IconData(0xe3f1);
+ static const IconData hdr_weak = const IconData(0xe3f2);
+ static const IconData headset = const IconData(0xe310);
+ static const IconData headset_mic = const IconData(0xe311);
+ static const IconData healing = const IconData(0xe3f3);
+ static const IconData hearing = const IconData(0xe023);
+ static const IconData help = const IconData(0xe887);
+ static const IconData help_outline = const IconData(0xe8fd);
+ static const IconData high_quality = const IconData(0xe024);
+ static const IconData highlight = const IconData(0xe25f);
+ static const IconData highlight_off = const IconData(0xe888);
+ static const IconData history = const IconData(0xe889);
+ static const IconData home = const IconData(0xe88a);
+ static const IconData hot_tub = const IconData(0xeb46);
+ static const IconData hotel = const IconData(0xe53a);
+ static const IconData hourglass_empty = const IconData(0xe88b);
+ static const IconData hourglass_full = const IconData(0xe88c);
+ static const IconData http = const IconData(0xe902);
+ static const IconData https = const IconData(0xe88d);
+ static const IconData image = const IconData(0xe3f4);
+ static const IconData image_aspect_ratio = const IconData(0xe3f5);
+ static const IconData import_contacts = const IconData(0xe0e0);
+ static const IconData import_export = const IconData(0xe0c3);
+ static const IconData important_devices = const IconData(0xe912);
+ static const IconData inbox = const IconData(0xe156);
+ static const IconData indeterminate_check_box = const IconData(0xe909);
+ static const IconData info = const IconData(0xe88e);
+ static const IconData info_outline = const IconData(0xe88f);
+ static const IconData input = const IconData(0xe890);
+ static const IconData insert_chart = const IconData(0xe24b);
+ static const IconData insert_comment = const IconData(0xe24c);
+ static const IconData insert_drive_file = const IconData(0xe24d);
+ static const IconData insert_emoticon = const IconData(0xe24e);
+ static const IconData insert_invitation = const IconData(0xe24f);
+ static const IconData insert_link = const IconData(0xe250);
+ static const IconData insert_photo = const IconData(0xe251);
+ static const IconData invert_colors = const IconData(0xe891);
+ static const IconData invert_colors_off = const IconData(0xe0c4);
+ static const IconData iso = const IconData(0xe3f6);
+ static const IconData keyboard = const IconData(0xe312);
+ static const IconData keyboard_arrow_down = const IconData(0xe313);
+ static const IconData keyboard_arrow_left = const IconData(0xe314);
+ static const IconData keyboard_arrow_right = const IconData(0xe315);
+ static const IconData keyboard_arrow_up = const IconData(0xe316);
+ static const IconData keyboard_backspace = const IconData(0xe317);
+ static const IconData keyboard_capslock = const IconData(0xe318);
+ static const IconData keyboard_hide = const IconData(0xe31a);
+ static const IconData keyboard_return = const IconData(0xe31b);
+ static const IconData keyboard_tab = const IconData(0xe31c);
+ static const IconData keyboard_voice = const IconData(0xe31d);
+ static const IconData kitchen = const IconData(0xeb47);
+ static const IconData label = const IconData(0xe892);
+ static const IconData label_outline = const IconData(0xe893);
+ static const IconData landscape = const IconData(0xe3f7);
+ static const IconData language = const IconData(0xe894);
+ static const IconData laptop = const IconData(0xe31e);
+ static const IconData laptop_chromebook = const IconData(0xe31f);
+ static const IconData laptop_mac = const IconData(0xe320);
+ static const IconData laptop_windows = const IconData(0xe321);
+ static const IconData last_page = const IconData(0xe5dd);
+ static const IconData launch = const IconData(0xe895);
+ static const IconData layers = const IconData(0xe53b);
+ static const IconData layers_clear = const IconData(0xe53c);
+ static const IconData leak_add = const IconData(0xe3f8);
+ static const IconData leak_remove = const IconData(0xe3f9);
+ static const IconData lens = const IconData(0xe3fa);
+ static const IconData library_add = const IconData(0xe02e);
+ static const IconData library_books = const IconData(0xe02f);
+ static const IconData library_music = const IconData(0xe030);
+ static const IconData lightbulb_outline = const IconData(0xe90f);
+ static const IconData line_style = const IconData(0xe919);
+ static const IconData line_weight = const IconData(0xe91a);
+ static const IconData linear_scale = const IconData(0xe260);
+ static const IconData link = const IconData(0xe157);
+ static const IconData linked_camera = const IconData(0xe438);
+ static const IconData list = const IconData(0xe896);
+ static const IconData live_help = const IconData(0xe0c6);
+ static const IconData live_tv = const IconData(0xe639);
+ static const IconData local_activity = const IconData(0xe53f);
+ static const IconData local_airport = const IconData(0xe53d);
+ static const IconData local_atm = const IconData(0xe53e);
+ static const IconData local_bar = const IconData(0xe540);
+ static const IconData local_cafe = const IconData(0xe541);
+ static const IconData local_car_wash = const IconData(0xe542);
+ static const IconData local_convenience_store = const IconData(0xe543);
+ static const IconData local_dining = const IconData(0xe556);
+ static const IconData local_drink = const IconData(0xe544);
+ static const IconData local_florist = const IconData(0xe545);
+ static const IconData local_gas_station = const IconData(0xe546);
+ static const IconData local_grocery_store = const IconData(0xe547);
+ static const IconData local_hospital = const IconData(0xe548);
+ static const IconData local_hotel = const IconData(0xe549);
+ static const IconData local_laundry_service = const IconData(0xe54a);
+ static const IconData local_library = const IconData(0xe54b);
+ static const IconData local_mall = const IconData(0xe54c);
+ static const IconData local_movies = const IconData(0xe54d);
+ static const IconData local_offer = const IconData(0xe54e);
+ static const IconData local_parking = const IconData(0xe54f);
+ static const IconData local_pharmacy = const IconData(0xe550);
+ static const IconData local_phone = const IconData(0xe551);
+ static const IconData local_pizza = const IconData(0xe552);
+ static const IconData local_play = const IconData(0xe553);
+ static const IconData local_post_office = const IconData(0xe554);
+ static const IconData local_printshop = const IconData(0xe555);
+ static const IconData local_see = const IconData(0xe557);
+ static const IconData local_shipping = const IconData(0xe558);
+ static const IconData local_taxi = const IconData(0xe559);
+ static const IconData location_city = const IconData(0xe7f1);
+ static const IconData location_disabled = const IconData(0xe1b6);
+ static const IconData location_off = const IconData(0xe0c7);
+ static const IconData location_on = const IconData(0xe0c8);
+ static const IconData location_searching = const IconData(0xe1b7);
+ static const IconData lock = const IconData(0xe897);
+ static const IconData lock_open = const IconData(0xe898);
+ static const IconData lock_outline = const IconData(0xe899);
+ static const IconData looks = const IconData(0xe3fc);
+ static const IconData looks_3 = const IconData(0xe3fb);
+ static const IconData looks_4 = const IconData(0xe3fd);
+ static const IconData looks_5 = const IconData(0xe3fe);
+ static const IconData looks_6 = const IconData(0xe3ff);
+ static const IconData looks_one = const IconData(0xe400);
+ static const IconData looks_two = const IconData(0xe401);
+ static const IconData loop = const IconData(0xe028);
+ static const IconData loupe = const IconData(0xe402);
+ static const IconData low_priority = const IconData(0xe16d);
+ static const IconData loyalty = const IconData(0xe89a);
+ static const IconData mail = const IconData(0xe158);
+ static const IconData mail_outline = const IconData(0xe0e1);
+ static const IconData map = const IconData(0xe55b);
+ static const IconData markunread = const IconData(0xe159);
+ static const IconData markunread_mailbox = const IconData(0xe89b);
+ static const IconData memory = const IconData(0xe322);
+ static const IconData menu = const IconData(0xe5d2);
+ static const IconData merge_type = const IconData(0xe252);
+ static const IconData message = const IconData(0xe0c9);
+ static const IconData mic = const IconData(0xe029);
+ static const IconData mic_none = const IconData(0xe02a);
+ static const IconData mic_off = const IconData(0xe02b);
+ static const IconData mms = const IconData(0xe618);
+ static const IconData mode_comment = const IconData(0xe253);
+ static const IconData mode_edit = const IconData(0xe254);
+ static const IconData monetization_on = const IconData(0xe263);
+ static const IconData money_off = const IconData(0xe25c);
+ static const IconData monochrome_photos = const IconData(0xe403);
+ static const IconData mood = const IconData(0xe7f2);
+ static const IconData mood_bad = const IconData(0xe7f3);
+ static const IconData more = const IconData(0xe619);
+ static const IconData more_horiz = const IconData(0xe5d3);
+ static const IconData more_vert = const IconData(0xe5d4);
+ static const IconData motorcycle = const IconData(0xe91b);
+ static const IconData mouse = const IconData(0xe323);
+ static const IconData move_to_inbox = const IconData(0xe168);
+ static const IconData movie = const IconData(0xe02c);
+ static const IconData movie_creation = const IconData(0xe404);
+ static const IconData movie_filter = const IconData(0xe43a);
+ static const IconData multiline_chart = const IconData(0xe6df);
+ static const IconData music_note = const IconData(0xe405);
+ static const IconData music_video = const IconData(0xe063);
+ static const IconData my_location = const IconData(0xe55c);
+ static const IconData nature = const IconData(0xe406);
+ static const IconData nature_people = const IconData(0xe407);
+ static const IconData navigate_before = const IconData(0xe408);
+ static const IconData navigate_next = const IconData(0xe409);
+ static const IconData navigation = const IconData(0xe55d);
+ static const IconData near_me = const IconData(0xe569);
+ static const IconData network_cell = const IconData(0xe1b9);
+ static const IconData network_check = const IconData(0xe640);
+ static const IconData network_locked = const IconData(0xe61a);
+ static const IconData network_wifi = const IconData(0xe1ba);
+ static const IconData const_releases = const IconData(0xe031);
+ static const IconData next_week = const IconData(0xe16a);
+ static const IconData nfc = const IconData(0xe1bb);
+ static const IconData no_encryption = const IconData(0xe641);
+ static const IconData no_sim = const IconData(0xe0cc);
+ static const IconData not_interested = const IconData(0xe033);
+ static const IconData note = const IconData(0xe06f);
+ static const IconData note_add = const IconData(0xe89c);
+ static const IconData notifications = const IconData(0xe7f4);
+ static const IconData notifications_active = const IconData(0xe7f7);
+ static const IconData notifications_none = const IconData(0xe7f5);
+ static const IconData notifications_off = const IconData(0xe7f6);
+ static const IconData notifications_paused = const IconData(0xe7f8);
+ static const IconData offline_pin = const IconData(0xe90a);
+ static const IconData ondemand_video = const IconData(0xe63a);
+ static const IconData opacity = const IconData(0xe91c);
+ static const IconData open_in_browser = const IconData(0xe89d);
+ static const IconData open_in_const = const IconData(0xe89e);
+ static const IconData open_with = const IconData(0xe89f);
+ static const IconData pages = const IconData(0xe7f9);
+ static const IconData pageview = const IconData(0xe8a0);
+ static const IconData palette = const IconData(0xe40a);
+ static const IconData pan_tool = const IconData(0xe925);
+ static const IconData panorama = const IconData(0xe40b);
+ static const IconData panorama_fish_eye = const IconData(0xe40c);
+ static const IconData panorama_horizontal = const IconData(0xe40d);
+ static const IconData panorama_vertical = const IconData(0xe40e);
+ static const IconData panorama_wide_angle = const IconData(0xe40f);
+ static const IconData party_mode = const IconData(0xe7fa);
+ static const IconData pause = const IconData(0xe034);
+ static const IconData pause_circle_filled = const IconData(0xe035);
+ static const IconData pause_circle_outline = const IconData(0xe036);
+ static const IconData payment = const IconData(0xe8a1);
+ static const IconData people = const IconData(0xe7fb);
+ static const IconData people_outline = const IconData(0xe7fc);
+ static const IconData perm_camera_mic = const IconData(0xe8a2);
+ static const IconData perm_contact_calendar = const IconData(0xe8a3);
+ static const IconData perm_data_setting = const IconData(0xe8a4);
+ static const IconData perm_device_information = const IconData(0xe8a5);
+ static const IconData perm_identity = const IconData(0xe8a6);
+ static const IconData perm_media = const IconData(0xe8a7);
+ static const IconData perm_phone_msg = const IconData(0xe8a8);
+ static const IconData perm_scan_wifi = const IconData(0xe8a9);
+ static const IconData person = const IconData(0xe7fd);
+ static const IconData person_add = const IconData(0xe7fe);
+ static const IconData person_outline = const IconData(0xe7ff);
+ static const IconData person_pin = const IconData(0xe55a);
+ static const IconData person_pin_circle = const IconData(0xe56a);
+ static const IconData personal_video = const IconData(0xe63b);
+ static const IconData pets = const IconData(0xe91d);
+ static const IconData phone = const IconData(0xe0cd);
+ static const IconData phone_android = const IconData(0xe324);
+ static const IconData phone_bluetooth_speaker = const IconData(0xe61b);
+ static const IconData phone_forwarded = const IconData(0xe61c);
+ static const IconData phone_in_talk = const IconData(0xe61d);
+ static const IconData phone_iphone = const IconData(0xe325);
+ static const IconData phone_locked = const IconData(0xe61e);
+ static const IconData phone_missed = const IconData(0xe61f);
+ static const IconData phone_paused = const IconData(0xe620);
+ static const IconData phonelink = const IconData(0xe326);
+ static const IconData phonelink_erase = const IconData(0xe0db);
+ static const IconData phonelink_lock = const IconData(0xe0dc);
+ static const IconData phonelink_off = const IconData(0xe327);
+ static const IconData phonelink_ring = const IconData(0xe0dd);
+ static const IconData phonelink_setup = const IconData(0xe0de);
+ static const IconData photo = const IconData(0xe410);
+ static const IconData photo_album = const IconData(0xe411);
+ static const IconData photo_camera = const IconData(0xe412);
+ static const IconData photo_filter = const IconData(0xe43b);
+ static const IconData photo_library = const IconData(0xe413);
+ static const IconData photo_size_select_actual = const IconData(0xe432);
+ static const IconData photo_size_select_large = const IconData(0xe433);
+ static const IconData photo_size_select_small = const IconData(0xe434);
+ static const IconData picture_as_pdf = const IconData(0xe415);
+ static const IconData picture_in_picture = const IconData(0xe8aa);
+ static const IconData picture_in_picture_alt = const IconData(0xe911);
+ static const IconData pie_chart = const IconData(0xe6c4);
+ static const IconData pie_chart_outlined = const IconData(0xe6c5);
+ static const IconData pin_drop = const IconData(0xe55e);
+ static const IconData place = const IconData(0xe55f);
+ static const IconData play_arrow = const IconData(0xe037);
+ static const IconData play_circle_filled = const IconData(0xe038);
+ static const IconData play_circle_outline = const IconData(0xe039);
+ static const IconData play_for_work = const IconData(0xe906);
+ static const IconData playlist_add = const IconData(0xe03b);
+ static const IconData playlist_add_check = const IconData(0xe065);
+ static const IconData playlist_play = const IconData(0xe05f);
+ static const IconData plus_one = const IconData(0xe800);
+ static const IconData poll = const IconData(0xe801);
+ static const IconData polymer = const IconData(0xe8ab);
+ static const IconData pool = const IconData(0xeb48);
+ static const IconData portable_wifi_off = const IconData(0xe0ce);
+ static const IconData portrait = const IconData(0xe416);
+ static const IconData power = const IconData(0xe63c);
+ static const IconData power_input = const IconData(0xe336);
+ static const IconData power_settings_const = const IconData(0xe8ac);
+ static const IconData pregnant_woman = const IconData(0xe91e);
+ static const IconData present_to_all = const IconData(0xe0df);
+ static const IconData print = const IconData(0xe8ad);
+ static const IconData priority_high = const IconData(0xe645);
+ static const IconData public = const IconData(0xe80b);
+ static const IconData publish = const IconData(0xe255);
+ static const IconData query_builder = const IconData(0xe8ae);
+ static const IconData question_answer = const IconData(0xe8af);
+ static const IconData queue = const IconData(0xe03c);
+ static const IconData queue_music = const IconData(0xe03d);
+ static const IconData queue_play_next = const IconData(0xe066);
+ static const IconData radio = const IconData(0xe03e);
+ static const IconData radio_button_checked = const IconData(0xe837);
+ static const IconData radio_button_unchecked = const IconData(0xe836);
+ static const IconData rate_review = const IconData(0xe560);
+ static const IconData receipt = const IconData(0xe8b0);
+ static const IconData recent_actors = const IconData(0xe03f);
+ static const IconData record_voice_over = const IconData(0xe91f);
+ static const IconData redeem = const IconData(0xe8b1);
+ static const IconData redo = const IconData(0xe15a);
+ static const IconData refresh = const IconData(0xe5d5);
+ static const IconData remove = const IconData(0xe15b);
+ static const IconData remove_circle = const IconData(0xe15c);
+ static const IconData remove_circle_outline = const IconData(0xe15d);
+ static const IconData remove_from_queue = const IconData(0xe067);
+ static const IconData remove_red_eye = const IconData(0xe417);
+ static const IconData remove_shopping_cart = const IconData(0xe928);
+ static const IconData reorder = const IconData(0xe8fe);
+ static const IconData repeat = const IconData(0xe040);
+ static const IconData repeat_one = const IconData(0xe041);
+ static const IconData replay = const IconData(0xe042);
+ static const IconData replay_10 = const IconData(0xe059);
+ static const IconData replay_30 = const IconData(0xe05a);
+ static const IconData replay_5 = const IconData(0xe05b);
+ static const IconData reply = const IconData(0xe15e);
+ static const IconData reply_all = const IconData(0xe15f);
+ static const IconData report = const IconData(0xe160);
+ static const IconData report_problem = const IconData(0xe8b2);
+ static const IconData restaurant = const IconData(0xe56c);
+ static const IconData restaurant_menu = const IconData(0xe561);
+ static const IconData restore = const IconData(0xe8b3);
+ static const IconData restore_page = const IconData(0xe929);
+ static const IconData ring_volume = const IconData(0xe0d1);
+ static const IconData room = const IconData(0xe8b4);
+ static const IconData room_service = const IconData(0xeb49);
+ static const IconData rotate_90_degrees_ccw = const IconData(0xe418);
+ static const IconData rotate_left = const IconData(0xe419);
+ static const IconData rotate_right = const IconData(0xe41a);
+ static const IconData rounded_corner = const IconData(0xe920);
+ static const IconData router = const IconData(0xe328);
+ static const IconData rowing = const IconData(0xe921);
+ static const IconData rss_feed = const IconData(0xe0e5);
+ static const IconData rv_hookup = const IconData(0xe642);
+ static const IconData satellite = const IconData(0xe562);
+ static const IconData save = const IconData(0xe161);
+ static const IconData scanner = const IconData(0xe329);
+ static const IconData schedule = const IconData(0xe8b5);
+ static const IconData school = const IconData(0xe80c);
+ static const IconData screen_lock_landscape = const IconData(0xe1be);
+ static const IconData screen_lock_portrait = const IconData(0xe1bf);
+ static const IconData screen_lock_rotation = const IconData(0xe1c0);
+ static const IconData screen_rotation = const IconData(0xe1c1);
+ static const IconData screen_share = const IconData(0xe0e2);
+ static const IconData sd_card = const IconData(0xe623);
+ static const IconData sd_storage = const IconData(0xe1c2);
+ static const IconData search = const IconData(0xe8b6);
+ static const IconData security = const IconData(0xe32a);
+ static const IconData select_all = const IconData(0xe162);
+ static const IconData send = const IconData(0xe163);
+ static const IconData sentiment_dissatisfied = const IconData(0xe811);
+ static const IconData sentiment_neutral = const IconData(0xe812);
+ static const IconData sentiment_satisfied = const IconData(0xe813);
+ static const IconData sentiment_very_dissatisfied = const IconData(0xe814);
+ static const IconData sentiment_very_satisfied = const IconData(0xe815);
+ static const IconData settings = const IconData(0xe8b8);
+ static const IconData settings_applications = const IconData(0xe8b9);
+ static const IconData settings_backup_restore = const IconData(0xe8ba);
+ static const IconData settings_bluetooth = const IconData(0xe8bb);
+ static const IconData settings_brightness = const IconData(0xe8bd);
+ static const IconData settings_cell = const IconData(0xe8bc);
+ static const IconData settings_ethernet = const IconData(0xe8be);
+ static const IconData settings_input_antenna = const IconData(0xe8bf);
+ static const IconData settings_input_component = const IconData(0xe8c0);
+ static const IconData settings_input_composite = const IconData(0xe8c1);
+ static const IconData settings_input_hdmi = const IconData(0xe8c2);
+ static const IconData settings_input_svideo = const IconData(0xe8c3);
+ static const IconData settings_overscan = const IconData(0xe8c4);
+ static const IconData settings_phone = const IconData(0xe8c5);
+ static const IconData settings_power = const IconData(0xe8c6);
+ static const IconData settings_remote = const IconData(0xe8c7);
+ static const IconData settings_system_daydream = const IconData(0xe1c3);
+ static const IconData settings_voice = const IconData(0xe8c8);
+ static const IconData share = const IconData(0xe80d);
+ static const IconData shop = const IconData(0xe8c9);
+ static const IconData shop_two = const IconData(0xe8ca);
+ static const IconData shopping_basket = const IconData(0xe8cb);
+ static const IconData shopping_cart = const IconData(0xe8cc);
+ static const IconData short_text = const IconData(0xe261);
+ static const IconData show_chart = const IconData(0xe6e1);
+ static const IconData shuffle = const IconData(0xe043);
+ static const IconData signal_cellular_4_bar = const IconData(0xe1c8);
+ static const IconData signal_cellular_connected_no_internet_4_bar = const IconData(0xe1cd);
+ static const IconData signal_cellular_no_sim = const IconData(0xe1ce);
+ static const IconData signal_cellular_null = const IconData(0xe1cf);
+ static const IconData signal_cellular_off = const IconData(0xe1d0);
+ static const IconData signal_wifi_4_bar = const IconData(0xe1d8);
+ static const IconData signal_wifi_4_bar_lock = const IconData(0xe1d9);
+ static const IconData signal_wifi_off = const IconData(0xe1da);
+ static const IconData sim_card = const IconData(0xe32b);
+ static const IconData sim_card_alert = const IconData(0xe624);
+ static const IconData skip_next = const IconData(0xe044);
+ static const IconData skip_previous = const IconData(0xe045);
+ static const IconData slideshow = const IconData(0xe41b);
+ static const IconData slow_motion_video = const IconData(0xe068);
+ static const IconData smartphone = const IconData(0xe32c);
+ static const IconData smoke_free = const IconData(0xeb4a);
+ static const IconData smoking_rooms = const IconData(0xeb4b);
+ static const IconData sms = const IconData(0xe625);
+ static const IconData sms_failed = const IconData(0xe626);
+ static const IconData snooze = const IconData(0xe046);
+ static const IconData sort = const IconData(0xe164);
+ static const IconData sort_by_alpha = const IconData(0xe053);
+ static const IconData spa = const IconData(0xeb4c);
+ static const IconData space_bar = const IconData(0xe256);
+ static const IconData speaker = const IconData(0xe32d);
+ static const IconData speaker_group = const IconData(0xe32e);
+ static const IconData speaker_notes = const IconData(0xe8cd);
+ static const IconData speaker_notes_off = const IconData(0xe92a);
+ static const IconData speaker_phone = const IconData(0xe0d2);
+ static const IconData spellcheck = const IconData(0xe8ce);
+ static const IconData star = const IconData(0xe838);
+ static const IconData star_border = const IconData(0xe83a);
+ static const IconData star_half = const IconData(0xe839);
+ static const IconData stars = const IconData(0xe8d0);
+ static const IconData stay_current_landscape = const IconData(0xe0d3);
+ static const IconData stay_current_portrait = const IconData(0xe0d4);
+ static const IconData stay_primary_landscape = const IconData(0xe0d5);
+ static const IconData stay_primary_portrait = const IconData(0xe0d6);
+ static const IconData stop = const IconData(0xe047);
+ static const IconData stop_screen_share = const IconData(0xe0e3);
+ static const IconData storage = const IconData(0xe1db);
+ static const IconData store = const IconData(0xe8d1);
+ static const IconData store_mall_directory = const IconData(0xe563);
+ static const IconData straighten = const IconData(0xe41c);
+ static const IconData streetview = const IconData(0xe56e);
+ static const IconData strikethrough_s = const IconData(0xe257);
+ static const IconData style = const IconData(0xe41d);
+ static const IconData subdirectory_arrow_left = const IconData(0xe5d9);
+ static const IconData subdirectory_arrow_right = const IconData(0xe5da);
+ static const IconData subject = const IconData(0xe8d2);
+ static const IconData subscriptions = const IconData(0xe064);
+ static const IconData subtitles = const IconData(0xe048);
+ static const IconData subway = const IconData(0xe56f);
+ static const IconData supervisor_account = const IconData(0xe8d3);
+ static const IconData surround_sound = const IconData(0xe049);
+ static const IconData swap_calls = const IconData(0xe0d7);
+ static const IconData swap_horiz = const IconData(0xe8d4);
+ static const IconData swap_vert = const IconData(0xe8d5);
+ static const IconData swap_vertical_circle = const IconData(0xe8d6);
+ static const IconData switch_camera = const IconData(0xe41e);
+ static const IconData switch_video = const IconData(0xe41f);
+ static const IconData sync = const IconData(0xe627);
+ static const IconData sync_disabled = const IconData(0xe628);
+ static const IconData sync_problem = const IconData(0xe629);
+ static const IconData system_update = const IconData(0xe62a);
+ static const IconData system_update_alt = const IconData(0xe8d7);
+ static const IconData tab = const IconData(0xe8d8);
+ static const IconData tab_unselected = const IconData(0xe8d9);
+ static const IconData tablet = const IconData(0xe32f);
+ static const IconData tablet_android = const IconData(0xe330);
+ static const IconData tablet_mac = const IconData(0xe331);
+ static const IconData tag_faces = const IconData(0xe420);
+ static const IconData tap_and_play = const IconData(0xe62b);
+ static const IconData terrain = const IconData(0xe564);
+ static const IconData text_fields = const IconData(0xe262);
+ static const IconData text_format = const IconData(0xe165);
+ static const IconData textsms = const IconData(0xe0d8);
+ static const IconData texture = const IconData(0xe421);
+ static const IconData theaters = const IconData(0xe8da);
+ static const IconData thumb_down = const IconData(0xe8db);
+ static const IconData thumb_up = const IconData(0xe8dc);
+ static const IconData thumbs_up_down = const IconData(0xe8dd);
+ static const IconData time_to_leave = const IconData(0xe62c);
+ static const IconData timelapse = const IconData(0xe422);
+ static const IconData timeline = const IconData(0xe922);
+ static const IconData timer = const IconData(0xe425);
+ static const IconData timer_10 = const IconData(0xe423);
+ static const IconData timer_3 = const IconData(0xe424);
+ static const IconData timer_off = const IconData(0xe426);
+ static const IconData title = const IconData(0xe264);
+ static const IconData toc = const IconData(0xe8de);
+ static const IconData today = const IconData(0xe8df);
+ static const IconData toll = const IconData(0xe8e0);
+ static const IconData tonality = const IconData(0xe427);
+ static const IconData touch_app = const IconData(0xe913);
+ static const IconData toys = const IconData(0xe332);
+ static const IconData track_changes = const IconData(0xe8e1);
+ static const IconData traffic = const IconData(0xe565);
+ static const IconData train = const IconData(0xe570);
+ static const IconData tram = const IconData(0xe571);
+ static const IconData transfer_within_a_station = const IconData(0xe572);
+ static const IconData transform = const IconData(0xe428);
+ static const IconData translate = const IconData(0xe8e2);
+ static const IconData trending_down = const IconData(0xe8e3);
+ static const IconData trending_flat = const IconData(0xe8e4);
+ static const IconData trending_up = const IconData(0xe8e5);
+ static const IconData tune = const IconData(0xe429);
+ static const IconData turned_in = const IconData(0xe8e6);
+ static const IconData turned_in_not = const IconData(0xe8e7);
+ static const IconData tv = const IconData(0xe333);
+ static const IconData unarchive = const IconData(0xe169);
+ static const IconData undo = const IconData(0xe166);
+ static const IconData unfold_less = const IconData(0xe5d6);
+ static const IconData unfold_more = const IconData(0xe5d7);
+ static const IconData update = const IconData(0xe923);
+ static const IconData usb = const IconData(0xe1e0);
+ static const IconData verified_user = const IconData(0xe8e8);
+ static const IconData vertical_align_bottom = const IconData(0xe258);
+ static const IconData vertical_align_center = const IconData(0xe259);
+ static const IconData vertical_align_top = const IconData(0xe25a);
+ static const IconData vibration = const IconData(0xe62d);
+ static const IconData video_call = const IconData(0xe070);
+ static const IconData video_label = const IconData(0xe071);
+ static const IconData video_library = const IconData(0xe04a);
+ static const IconData videocam = const IconData(0xe04b);
+ static const IconData videocam_off = const IconData(0xe04c);
+ static const IconData videogame_asset = const IconData(0xe338);
+ static const IconData view_agenda = const IconData(0xe8e9);
+ static const IconData view_array = const IconData(0xe8ea);
+ static const IconData view_carousel = const IconData(0xe8eb);
+ static const IconData view_column = const IconData(0xe8ec);
+ static const IconData view_comfy = const IconData(0xe42a);
+ static const IconData view_compact = const IconData(0xe42b);
+ static const IconData view_day = const IconData(0xe8ed);
+ static const IconData view_headline = const IconData(0xe8ee);
+ static const IconData view_list = const IconData(0xe8ef);
+ static const IconData view_module = const IconData(0xe8f0);
+ static const IconData view_quilt = const IconData(0xe8f1);
+ static const IconData view_stream = const IconData(0xe8f2);
+ static const IconData view_week = const IconData(0xe8f3);
+ static const IconData vignette = const IconData(0xe435);
+ static const IconData visibility = const IconData(0xe8f4);
+ static const IconData visibility_off = const IconData(0xe8f5);
+ static const IconData voice_chat = const IconData(0xe62e);
+ static const IconData voicemail = const IconData(0xe0d9);
+ static const IconData volume_down = const IconData(0xe04d);
+ static const IconData volume_mute = const IconData(0xe04e);
+ static const IconData volume_off = const IconData(0xe04f);
+ static const IconData volume_up = const IconData(0xe050);
+ static const IconData vpn_key = const IconData(0xe0da);
+ static const IconData vpn_lock = const IconData(0xe62f);
+ static const IconData wallpaper = const IconData(0xe1bc);
+ static const IconData warning = const IconData(0xe002);
+ static const IconData watch = const IconData(0xe334);
+ static const IconData watch_later = const IconData(0xe924);
+ static const IconData wb_auto = const IconData(0xe42c);
+ static const IconData wb_cloudy = const IconData(0xe42d);
+ static const IconData wb_incandescent = const IconData(0xe42e);
+ static const IconData wb_iridescent = const IconData(0xe436);
+ static const IconData wb_sunny = const IconData(0xe430);
+ static const IconData wc = const IconData(0xe63d);
+ static const IconData web = const IconData(0xe051);
+ static const IconData web_asset = const IconData(0xe069);
+ static const IconData weekend = const IconData(0xe16b);
+ static const IconData whatshot = const IconData(0xe80e);
+ static const IconData widgets = const IconData(0xe1bd);
+ static const IconData wifi = const IconData(0xe63e);
+ static const IconData wifi_lock = const IconData(0xe1e1);
+ static const IconData wifi_tethering = const IconData(0xe1e2);
+ static const IconData work = const IconData(0xe8f9);
+ static const IconData wrap_text = const IconData(0xe25b);
+ static const IconData youtube_searched_for = const IconData(0xe8fa);
+ static const IconData zoom_in = const IconData(0xe8ff);
+ static const IconData zoom_out = const IconData(0xe900);
+ static const IconData zoom_out_map = const IconData(0xe56b);
+}
diff --git a/packages/flutter/lib/src/material/input.dart b/packages/flutter/lib/src/material/input.dart
index 20b5521..a176e05 100644
--- a/packages/flutter/lib/src/material/input.dart
+++ b/packages/flutter/lib/src/material/input.dart
@@ -8,6 +8,7 @@
import 'colors.dart';
import 'debug.dart';
import 'icon.dart';
+import 'icons.dart';
import 'theme.dart';
export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
@@ -37,7 +38,7 @@
final KeyboardType keyboardType;
/// An icon to show adjacent to the input field.
- final String icon;
+ final IconData icon;
/// Text to show above the input field.
final String labelText;
@@ -195,7 +196,7 @@
child: new Icon(
icon: config.icon,
color: focused ? activeColor : Colors.black45,
- size: config.isDense ? IconSize.s18 : IconSize.s24
+ size: config.isDense ? 18.0 : 24.0
)
),
new Flexible(child: child)
diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart
index 3b7dfa5..2effaf7 100644
--- a/packages/flutter/lib/src/material/popup_menu.dart
+++ b/packages/flutter/lib/src/material/popup_menu.dart
@@ -6,7 +6,9 @@
import 'package:flutter/widgets.dart';
+import 'divider.dart';
import 'icon.dart';
+import 'icons.dart';
import 'icon_button.dart';
import 'icon_theme.dart';
import 'icon_theme_data.dart';
@@ -26,20 +28,36 @@
const double _kMenuWidthStep = 56.0;
const double _kMenuScreenPadding = 8.0;
-class PopupMenuItem<T> extends StatelessComponent {
+abstract class PopupMenuEntry<T> extends StatelessComponent {
+ PopupMenuEntry({ Key key }) : super(key: key);
+
+ double get height;
+ T get value => null;
+ bool get enabled => true;
+}
+
+class PopupMenuDivider extends PopupMenuEntry<dynamic> {
+ PopupMenuDivider({ Key key, this.height: 16.0 }) : super(key: key);
+
+ final double height;
+
+ Widget build(BuildContext context) => new Divider(height: height);
+}
+
+class PopupMenuItem<T> extends PopupMenuEntry<T> {
PopupMenuItem({
Key key,
this.value,
this.enabled: true,
- this.hasDivider: false,
this.child
}) : super(key: key);
final T value;
final bool enabled;
- final bool hasDivider;
final Widget child;
+ double get height => _kMenuItemHeight;
+
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
TextStyle style = theme.text.subhead;
@@ -49,7 +67,7 @@
Widget item = new DefaultTextStyle(
style: style,
child: new Baseline(
- baseline: _kMenuItemHeight - _kBaselineOffsetFromBottom,
+ baseline: height - _kBaselineOffsetFromBottom,
child: child
)
);
@@ -63,11 +81,8 @@
return new MergeSemantics(
child: new Container(
- height: _kMenuItemHeight,
+ height: height,
padding: const EdgeDims.symmetric(horizontal: _kMenuHorizontalPadding),
- decoration: !hasDivider ? null : new BoxDecoration(
- border: new Border(bottom: new BorderSide(color: theme.dividerColor))
- ),
child: item
)
);
@@ -87,7 +102,7 @@
enabled: enabled,
child: new ListItem(
enabled: enabled,
- left: new Icon(icon: checked ? 'action/done' : null),
+ left: new Icon(icon: checked ? Icons.done : null),
primary: child
)
);
@@ -172,10 +187,10 @@
}
class _PopupMenuRouteLayout extends OneChildLayoutDelegate {
- _PopupMenuRouteLayout(this.position, this.selectedIndex);
+ _PopupMenuRouteLayout(this.position, this.selectedItemOffset);
final ModalPosition position;
- final int selectedIndex;
+ final double selectedItemOffset;
BoxConstraints getConstraintsForChild(BoxConstraints constraints) {
return new BoxConstraints(
@@ -195,8 +210,8 @@
double y = position?.top
?? (position?.bottom != null ? size.height - (position.bottom - childSize.height) : _kMenuScreenPadding);
- if (selectedIndex != -1)
- y -= (_kMenuItemHeight * selectedIndex) + _kMenuVerticalPadding + _kMenuItemHeight / 2.0;
+ if (selectedItemOffset != null)
+ y -= selectedItemOffset + _kMenuVerticalPadding + _kMenuItemHeight / 2.0;
if (x < _kMenuScreenPadding)
x = _kMenuScreenPadding;
@@ -224,7 +239,7 @@
}) : super(completer: completer);
final ModalPosition position;
- final List<PopupMenuItem<T>> items;
+ final List<PopupMenuEntry<T>> items;
final dynamic initialValue;
final int elevation;
@@ -242,19 +257,20 @@
Color get barrierColor => null;
Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> forwardAnimation) {
- int selectedIndex = -1;
+ double selectedItemOffset = null;
if (initialValue != null) {
- for (int i = 0; i < items.length; i++)
- if (initialValue == items[i].value) {
- selectedIndex = i;
+ selectedItemOffset = 0.0;
+ for (int i = 0; i < items.length; i++) {
+ if (initialValue == items[i].value)
break;
- }
+ selectedItemOffset += items[i].height;
+ }
}
final Size screenSize = MediaQuery.of(context).size;
return new ConstrainedBox(
constraints: new BoxConstraints(maxWidth: screenSize.width, maxHeight: screenSize.height),
child: new CustomOneChildLayout(
- delegate: new _PopupMenuRouteLayout(position, selectedIndex),
+ delegate: new _PopupMenuRouteLayout(position, selectedItemOffset),
child: new _PopupMenu(route: this)
)
);
@@ -269,7 +285,7 @@
Future/*<T>*/ showMenu/*<T>*/({
BuildContext context,
ModalPosition position,
- List<PopupMenuItem/*<T>*/> items,
+ List<PopupMenuEntry/*<T>*/> items,
dynamic/*=T*/ initialValue,
int elevation: 8
}) {
@@ -305,7 +321,7 @@
this.child
}) : super(key: key);
- final List<PopupMenuItem<T>> items;
+ final List<PopupMenuEntry<T>> items;
final T initialValue;
final PopupMenuItemSelected<T> onSelected;
final String tooltip;
@@ -338,7 +354,7 @@
Widget build(BuildContext context) {
if (config.child == null) {
return new IconButton(
- icon: 'navigation/more_vert',
+ icon: Icons.more_vert,
tooltip: config.tooltip,
onPressed: () { showButtonMenu(context); }
);
diff --git a/packages/flutter/lib/src/material/scaffold.dart b/packages/flutter/lib/src/material/scaffold.dart
index d205069..e1787f2 100644
--- a/packages/flutter/lib/src/material/scaffold.dart
+++ b/packages/flutter/lib/src/material/scaffold.dart
@@ -11,6 +11,7 @@
import 'bottom_sheet.dart';
import 'constants.dart';
import 'drawer.dart';
+import 'icons.dart';
import 'icon_button.dart';
import 'material.dart';
import 'snack_bar.dart';
@@ -371,7 +372,7 @@
if (left == null) {
if (config.drawer != null) {
left = new IconButton(
- icon: 'navigation/menu',
+ icon: Icons.menu,
onPressed: openDrawer,
tooltip: 'Open navigation menu' // TODO(ianh): Figure out how to localize this string
);
@@ -379,7 +380,7 @@
_shouldShowBackArrow ??= Navigator.canPop(context);
if (_shouldShowBackArrow) {
left = new IconButton(
- icon: 'navigation/arrow_back',
+ icon: Icons.arrow_back,
onPressed: () => Navigator.pop(context),
tooltip: 'Back' // TODO(ianh): Figure out how to localize this string
);
diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart
index 8c09cc4..794c266 100644
--- a/packages/flutter/lib/src/material/tabs.dart
+++ b/packages/flutter/lib/src/material/tabs.dart
@@ -11,6 +11,7 @@
import 'colors.dart';
import 'icon.dart';
+import 'icons.dart';
import 'icon_theme.dart';
import 'icon_theme_data.dart';
import 'ink_well.dart';
@@ -291,7 +292,7 @@
const TabLabel({ this.text, this.icon, this.iconBuilder });
final String text;
- final String icon;
+ final IconData icon;
final TabLabelIconBuilder iconBuilder;
}
@@ -703,7 +704,8 @@
void _updateScrollBehavior() {
scrollTo(scrollBehavior.updateExtents(
containerExtent: config.scrollDirection == Axis.vertical ? _viewportSize.height : _viewportSize.width,
- contentExtent: _tabWidths.reduce((double sum, double width) => sum + width)
+ contentExtent: _tabWidths.reduce((double sum, double width) => sum + width),
+ scrollOffset: scrollOffset
));
}
@@ -779,7 +781,7 @@
);
if (config.isScrollable) {
- child: new Viewport(
+ return new Viewport(
scrollDirection: Axis.horizontal,
paintOffset: scrollOffsetToPixelDelta(scrollOffset),
onPaintOffsetUpdateNeeded: _handlePaintOffsetUpdateNeeded,
diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart
index 01bfafc..694377f 100644
--- a/packages/flutter/lib/src/material/theme_data.dart
+++ b/packages/flutter/lib/src/material/theme_data.dart
@@ -125,7 +125,7 @@
errorColor ??= Colors.red[700];
text ??= isDark ? Typography.white : Typography.black;
primaryTextTheme ??= primaryColorBrightness == ThemeBrightness.dark ? Typography.white : Typography.black;
- primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: IconThemeColor.white) : const IconThemeData(color: IconThemeColor.black);
+ primaryIconTheme ??= primaryColorBrightness == ThemeBrightness.dark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
return new ThemeData.raw(
brightness: brightness,
primaryColor: primaryColor,
diff --git a/packages/flutter/lib/src/material/two_level_list.dart b/packages/flutter/lib/src/material/two_level_list.dart
index d2bd21e..18d4368 100644
--- a/packages/flutter/lib/src/material/two_level_list.dart
+++ b/packages/flutter/lib/src/material/two_level_list.dart
@@ -6,6 +6,7 @@
import 'colors.dart';
import 'icon.dart';
+import 'icons.dart';
import 'list.dart';
import 'list_item.dart';
import 'theme.dart';
@@ -115,7 +116,7 @@
right: new RotationTransition(
turns: _iconTurns,
child: new Icon(
- icon: 'navigation/expand_more',
+ icon: Icons.expand_more,
color: _iconColor.evaluate(_easeInAnimation)
)
)
diff --git a/packages/flutter/lib/src/painting/box_painter.dart b/packages/flutter/lib/src/painting/box_painter.dart
index 7155dba..e34b7a7 100644
--- a/packages/flutter/lib/src/painting/box_painter.dart
+++ b/packages/flutter/lib/src/painting/box_painter.dart
@@ -235,27 +235,43 @@
String toString() => 'BoxShadow($color, $offset, $blurRadius, $spreadRadius)';
}
+// TODO(ianh): We should probably expose something that does this on Rect.
+// https://github.com/flutter/flutter/issues/2318
+Point _offsetToPoint(Offset offset, Rect rect) {
+ return new Point(rect.left + offset.dx * rect.width, rect.top + offset.dy * rect.height);
+}
+
/// A 2D gradient.
abstract class Gradient {
const Gradient();
- Shader createShader();
+ Shader createShader(Rect rect);
}
/// A 2D linear gradient.
class LinearGradient extends Gradient {
const LinearGradient({
- this.begin,
- this.end,
+ this.begin: const Offset(0.0, 0.5),
+ this.end: const Offset(1.0, 0.5),
this.colors,
this.stops,
this.tileMode: TileMode.clamp
});
- /// The point at which stop 0.0 of the gradient is placed.
- final Point begin;
+ /// The offset from coordinate (0.0,0.0) at which stop 0.0 of the
+ /// gradient is placed, in a coordinate space that maps the top left
+ /// of the paint box at (0.0,0.0) and the bottom right at (1.0,1.0).
+ ///
+ /// For example, a begin offset of (0.0,0.5) is half way down the
+ /// left side of the box.
+ final Offset begin;
- /// The point at which stop 1.0 of the gradient is placed.
- final Point end;
+ /// The offset from coordinate (0.0,0.0) at which stop 1.0 of the
+ /// gradient is placed, in a coordinate space that maps the top left
+ /// of the paint box at (0.0,0.0) and the bottom right at (1.0,1.0).
+ ///
+ /// For example, an end offset of (1.0,0.5) is half way down the
+ /// right side of the box.
+ final Offset end;
/// The colors the gradient should obtain at each of the stops.
///
@@ -271,8 +287,11 @@
/// How this gradient should tile the plane.
final TileMode tileMode;
- Shader createShader() {
- return new ui.Gradient.linear(<Point>[begin, end], this.colors, this.stops, this.tileMode);
+ Shader createShader(Rect rect) {
+ return new ui.Gradient.linear(
+ <Point>[_offsetToPoint(begin, rect), _offsetToPoint(end, rect)],
+ colors, stops, tileMode
+ );
}
bool operator ==(dynamic other) {
@@ -316,17 +335,26 @@
/// A 2D radial gradient.
class RadialGradient extends Gradient {
const RadialGradient({
- this.center,
- this.radius,
+ this.center: const Offset(0.5, 0.5),
+ this.radius: 0.5,
this.colors,
this.stops,
this.tileMode: TileMode.clamp
});
- /// The center of the gradient.
- final Point center;
+ /// The center of the gradient, as an offset into the unit square
+ /// describing the gradient which will be mapped onto the paint box.
+ ///
+ /// For example, an offset of (0.5,0.5) will place the radial
+ /// gradient in the center of the box.
+ final Offset center;
- /// The radius at which stop 1.0 is placed.
+ /// The radius of the gradient, as a fraction of the shortest side
+ /// of the paint box.
+ ///
+ /// For example, if a radial gradient is painted on a box that is
+ /// 100.0 pixels wide and 200.0 pixels tall, then a radius of 1.0
+ /// will place the 1.0 stop at 100.0 pixels from the [center].
final double radius;
/// The colors the gradient should obtain at each of the stops.
@@ -345,8 +373,12 @@
/// How this gradient should tile the plane.
final TileMode tileMode;
- Shader createShader() {
- return new ui.Gradient.radial(center, radius, colors, stops, tileMode);
+ Shader createShader(Rect rect) {
+ return new ui.Gradient.radial(
+ _offsetToPoint(center, rect),
+ radius * rect.shortestSide,
+ colors, stops, tileMode
+ );
}
bool operator ==(dynamic other) {
@@ -909,15 +941,23 @@
final BoxDecoration _decoration;
Paint _cachedBackgroundPaint;
- Paint get _backgroundPaint {
- if (_cachedBackgroundPaint == null) {
+ Rect _rectForCachedBackgroundPaint;
+ Paint _getBackgroundPaint(Rect rect) {
+ assert(rect != null);
+ if (_cachedBackgroundPaint == null ||
+ (_decoration.gradient == null && _rectForCachedBackgroundPaint != null) ||
+ (_decoration.gradient != null && _rectForCachedBackgroundPaint != rect)) {
Paint paint = new Paint();
if (_decoration.backgroundColor != null)
paint.color = _decoration.backgroundColor;
- if (_decoration.gradient != null)
- paint.shader = _decoration.gradient.createShader();
+ if (_decoration.gradient != null) {
+ paint.shader = _decoration.gradient.createShader(rect);
+ _rectForCachedBackgroundPaint = rect;
+ } else {
+ _rectForCachedBackgroundPaint = null;
+ }
_cachedBackgroundPaint = paint;
}
@@ -977,7 +1017,7 @@
void _paintBackgroundColor(Canvas canvas, Rect rect) {
if (_decoration.backgroundColor != null || _decoration.gradient != null)
- _paintBox(canvas, rect, _backgroundPaint);
+ _paintBox(canvas, rect, _getBackgroundPaint(rect));
}
void _paintBackgroundImage(Canvas canvas, Rect rect) {
diff --git a/packages/flutter/test/animation/animation_controller_test.dart b/packages/flutter/test/animation/animation_controller_test.dart
index f7f1903..b561bff 100644
--- a/packages/flutter/test/animation/animation_controller_test.dart
+++ b/packages/flutter/test/animation/animation_controller_test.dart
@@ -102,4 +102,32 @@
controller.stop();
});
+
+ test("Forward and reverse from values", () {
+ WidgetFlutterBinding.ensureInitialized();
+ AnimationController controller = new AnimationController(
+ duration: const Duration(milliseconds: 100)
+ );
+ List<double> valueLog = <double>[];
+ List<AnimationStatus> statusLog = <AnimationStatus>[];
+ controller
+ ..addStatusListener((AnimationStatus status) {
+ statusLog.add(status);
+ })
+ ..addListener(() {
+ valueLog.add(controller.value);
+ });
+
+ controller.reverse(from: 0.2);
+ expect(statusLog, equals([ AnimationStatus.reverse ]));
+ expect(valueLog, equals([ 0.2 ]));
+ expect(controller.value, equals(0.2));
+ statusLog.clear();
+ valueLog.clear();
+
+ controller.forward(from: 0.0);
+ expect(statusLog, equals([ AnimationStatus.dismissed, AnimationStatus.forward ]));
+ expect(valueLog, equals([ 0.0 ]));
+ expect(controller.value, equals(0.0));
+ });
}
diff --git a/packages/flutter/test/rendering/box_test.dart b/packages/flutter/test/rendering/box_test.dart
index 0fcda75..7c42c4c 100644
--- a/packages/flutter/test/rendering/box_test.dart
+++ b/packages/flutter/test/rendering/box_test.dart
@@ -14,7 +14,7 @@
decoration: new BoxDecoration(
backgroundColor: const Color(0xFF00FF00),
gradient: new RadialGradient(
- center: Point.origin, radius: 500.0,
+ center: Offset.zero, radius: 1.8,
colors: <Color>[Colors.yellow[500], Colors.blue[500]]),
boxShadow: elevationToShadow[3])
);
diff --git a/packages/flutter/test/widget/shader_mask_test.dart b/packages/flutter/test/widget/shader_mask_test.dart
index 72a1df7..b65b308 100644
--- a/packages/flutter/test/widget/shader_mask_test.dart
+++ b/packages/flutter/test/widget/shader_mask_test.dart
@@ -10,12 +10,12 @@
Shader createShader(Rect bounds) {
return new LinearGradient(
- begin: bounds.topLeft,
- end: bounds.bottomLeft,
+ begin: const Offset(0.0, 0.0),
+ end: const Offset(0.0, 1.0),
colors: <Color>[const Color(0x00FFFFFF), const Color(0xFFFFFFFF)],
stops: <double>[0.1, 0.35]
)
- .createShader();
+ .createShader(bounds);
}
diff --git a/packages/flutter/test/widget/tabs_test.dart b/packages/flutter/test/widget/tabs_test.dart
index ed1d45d..a8ded32 100644
--- a/packages/flutter/test/widget/tabs_test.dart
+++ b/packages/flutter/test/widget/tabs_test.dart
@@ -7,12 +7,13 @@
import 'package:flutter/widgets.dart';
import 'package:test/test.dart';
-Widget buildFrame({ List<String> tabs, String value, bool isScrollable: false }) {
+Widget buildFrame({ List<String> tabs, String value, bool isScrollable: false, Key tabBarKey }) {
return new Material(
child: new TabBarSelection<String>(
value: value,
values: tabs,
child: new TabBar<String>(
+ key: tabBarKey,
labels: new Map<String, TabLabel>.fromIterable(tabs, value: (String tab) => new TabLabel(text: tab)),
isScrollable: isScrollable
)
@@ -98,4 +99,48 @@
expect(selection.value, equals('A'));
});
});
+
+ test('Scrollable TabBar tap centers selected tab', () {
+ testWidgets((WidgetTester tester) {
+ List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL'];
+ Key tabBarKey = new Key('TabBar');
+ tester.pumpWidget(buildFrame(tabs: tabs, value: 'AAAAAA', isScrollable: true, tabBarKey: tabBarKey));
+ TabBarSelectionState<String> selection = TabBarSelection.of(tester.findText('AAAAAA'));
+ expect(selection, isNotNull);
+ expect(selection.value, equals('AAAAAA'));
+
+ expect(tester.getSize(tester.findElementByKey(tabBarKey)).width, equals(800.0));
+ // The center of the FFFFFF item is to the right of the TabBar's center
+ expect(tester.getCenter(tester.findText('FFFFFF')).x, greaterThan(401.0));
+
+ tester.tap(tester.findText('FFFFFF'));
+ tester.pump();
+ tester.pump(const Duration(seconds: 1)); // finish the scroll animation
+ expect(selection.value, equals('FFFFFF'));
+ // The center of the FFFFFF item is now at the TabBar's center
+ expect(tester.getCenter(tester.findText('FFFFFF')).x, closeTo(400.0, 1.0));
+ });
+ });
+
+
+ test('TabBar can be scrolled independent of the selection', () {
+ testWidgets((WidgetTester tester) {
+ List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL'];
+ Key tabBarKey = new Key('TabBar');
+ tester.pumpWidget(buildFrame(tabs: tabs, value: 'AAAAAA', isScrollable: true, tabBarKey: tabBarKey));
+ TabBarSelectionState<String> selection = TabBarSelection.of(tester.findText('AAAAAA'));
+ expect(selection, isNotNull);
+ expect(selection.value, equals('AAAAAA'));
+
+ // Fling-scroll the TabBar to the left
+ expect(tester.getCenter(tester.findText('HHHHHH')).x, lessThan(700.0));
+ tester.fling(tester.findElementByKey(tabBarKey), const Offset(-20.0, 0.0), 1000.0);
+ tester.pump();
+ tester.pump(const Duration(seconds: 1)); // finish the scroll animation
+ expect(tester.getCenter(tester.findText('HHHHHH')).x, lessThan(500.0));
+
+ // Scrolling the TabBar doesn't change the selection
+ expect(selection.value, equals('AAAAAA'));
+ });
+ });
}
diff --git a/packages/flutter_tools/lib/flutter_tools.dart b/packages/flutter_tools/lib/flutter_tools.dart
index dfd7a94..076b0f6 100644
--- a/packages/flutter_tools/lib/flutter_tools.dart
+++ b/packages/flutter_tools/lib/flutter_tools.dart
@@ -13,7 +13,6 @@
Map manifestDescriptor: const {},
File snapshotFile: null,
String assetBasePath: flx.defaultAssetBasePath,
- String materialAssetBasePath: flx.defaultMaterialAssetBasePath,
String outputPath: flx.defaultFlxOutputPath,
String privateKeyPath: flx.defaultPrivateKeyPath
}) async {
@@ -21,7 +20,6 @@
manifestDescriptor: manifestDescriptor,
snapshotFile: snapshotFile,
assetBasePath: assetBasePath,
- materialAssetBasePath: materialAssetBasePath,
outputPath: outputPath,
privateKeyPath: privateKeyPath
);
diff --git a/packages/flutter_tools/lib/src/base/utils.dart b/packages/flutter_tools/lib/src/base/utils.dart
index e7f5412..62a9b8f 100644
--- a/packages/flutter_tools/lib/src/base/utils.dart
+++ b/packages/flutter_tools/lib/src/base/utils.dart
@@ -13,6 +13,21 @@
return CryptoUtils.bytesToHex(sha1.close());
}
+/// Convert `foo_bar` to `fooBar`.
+String camelCase(String str) {
+ int index = str.indexOf('_');
+ while (index != -1 && index < str.length - 2) {
+ str = str.substring(0, index) +
+ str.substring(index + 1, index + 2).toUpperCase() +
+ str.substring(index + 2);
+ index = str.indexOf('_');
+ }
+ return str;
+}
+
+/// Return the plural of the given word (`cat(s)`).
+String pluralize(String word, int count) => count == 1 ? word : word + 's';
+
/// A class to maintain a list of items, fire events when items are added or
/// removed, and calculate a diff of changes when a new list of items is
/// available.
diff --git a/packages/flutter_tools/lib/src/commands/build.dart b/packages/flutter_tools/lib/src/commands/build.dart
index 4318334..1d96c2d 100644
--- a/packages/flutter_tools/lib/src/commands/build.dart
+++ b/packages/flutter_tools/lib/src/commands/build.dart
@@ -15,7 +15,9 @@
BuildCommand() {
argParser.addFlag('precompiled', negatable: false);
- argParser.addOption('asset-base', defaultsTo: defaultMaterialAssetBasePath);
+ // This option is still referenced by the iOS build scripts. We should
+ // remove it once we've updated those build scripts.
+ argParser.addOption('asset-base', help: 'Ignored. Will be removed.', hide: true);
argParser.addOption('compiler');
argParser.addOption('target',
abbr: 't',
@@ -42,7 +44,6 @@
return await build(
toolchain,
- materialAssetBasePath: argResults['asset-base'],
mainPath: argResults.wasParsed('main') ? argResults['main'] : argResults['target'],
manifestPath: argResults['manifest'],
outputPath: outputPath,
diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart
index 3449dd2..020d944 100644
--- a/packages/flutter_tools/lib/src/commands/create.dart
+++ b/packages/flutter_tools/lib/src/commands/create.dart
@@ -10,6 +10,7 @@
import '../android/android.dart' as android;
import '../artifacts.dart';
+import '../base/utils.dart';
import '../dart/pub.dart';
import '../globals.dart';
import '../template.dart';
@@ -87,8 +88,10 @@
_renderTemplates(projectName, dirPath, flutterPackagesDirectory,
renderDriverTest: argResults['with-driver-test']);
+ printStatus('');
+
if (argResults['pub']) {
- int code = await pubGet(directory: projectDir.path);
+ int code = await pubGet(directory: dirPath);
if (code != 0)
return code;
}
@@ -103,7 +106,7 @@
printStatus('''
All done! In order to run your application, type:
- \$ cd ${projectDir.path}
+ \$ cd $dirPath
\$ flutter run
''');
} else {
@@ -116,7 +119,7 @@
printStatus('');
printStatus("After installing components, run 'flutter doctor' in order to "
"re-validate your setup.");
- printStatus("When complete, type 'flutter run' from the '${projectDir.path}' "
+ printStatus("When complete, type 'flutter run' from the '$dirPath' "
"directory in order to launch your app.");
}
@@ -125,7 +128,6 @@
void _renderTemplates(String projectName, String dirPath,
String flutterPackagesDirectory, { bool renderDriverTest: false }) {
- String projectIdentifier = _createProjectIdentifier(path.basename(dirPath));
String relativeFlutterPackagesDirectory = path.relative(flutterPackagesDirectory, from: dirPath);
printStatus('Creating project ${path.basename(projectName)}:');
@@ -134,7 +136,8 @@
Map templateContext = <String, dynamic>{
'projectName': projectName,
- 'projectIdentifier': projectIdentifier,
+ 'androidIdentifier': _createAndroidIdentifier(projectName),
+ 'iosIdentifier': _createUTIIdentifier(projectName),
'description': description,
'flutterPackagesDirectory': relativeFlutterPackagesDirectory,
'androidMinApiLevel': android.minApiLevel
@@ -163,11 +166,15 @@
return name;
}
-String _createProjectIdentifier(String name) {
+String _createAndroidIdentifier(String name) {
+ return 'com.yourcompany.${camelCase(name)}';
+}
+
+String _createUTIIdentifier(String name) {
// Create a UTI (https://en.wikipedia.org/wiki/Uniform_Type_Identifier) from a base name
RegExp disallowed = new RegExp(r"[^a-zA-Z0-9\-.\u0080-\uffff]+");
- name = name.replaceAll(disallowed, '');
- name = name.length == 0 ? 'untitled' : name;
+ name = camelCase(name).replaceAll(disallowed, '');
+ name = name.isEmpty ? 'untitled' : name;
return 'com.yourcompany.$name';
}
diff --git a/packages/flutter_tools/lib/src/commands/devices.dart b/packages/flutter_tools/lib/src/commands/devices.dart
index a6611e4..b5b1a09 100644
--- a/packages/flutter_tools/lib/src/commands/devices.dart
+++ b/packages/flutter_tools/lib/src/commands/devices.dart
@@ -4,6 +4,7 @@
import 'dart:async';
+import '../base/utils.dart';
import '../device.dart';
import '../globals.dart';
import '../runner/flutter_command.dart';
@@ -38,5 +39,3 @@
return 0;
}
}
-
-String pluralize(String word, int count) => count == 1 ? word : word + 's';
diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart
index 77ffcad..620f473 100644
--- a/packages/flutter_tools/lib/src/commands/run.dart
+++ b/packages/flutter_tools/lib/src/commands/run.dart
@@ -9,6 +9,7 @@
import '../application_package.dart';
import '../base/common.dart';
+import '../base/utils.dart';
import '../build_configuration.dart';
import '../dart/pub.dart';
import '../device.dart';
@@ -17,7 +18,6 @@
import '../runner/flutter_command.dart';
import '../toolchain.dart';
import 'apk.dart';
-import 'devices.dart';
import 'install.dart';
/// Given the value of the --target option, return the path of the Dart file
diff --git a/packages/flutter_tools/lib/src/flx.dart b/packages/flutter_tools/lib/src/flx.dart
index 8e72b43..e7aa7da 100644
--- a/packages/flutter_tools/lib/src/flx.dart
+++ b/packages/flutter_tools/lib/src/flx.dart
@@ -11,6 +11,7 @@
import 'package:path/path.dart' as path;
import 'package:yaml/yaml.dart';
+import 'artifacts.dart';
import 'base/file_system.dart' show ensureDirectoryExists;
import 'globals.dart';
import 'toolchain.dart';
@@ -18,22 +19,12 @@
const String defaultMainPath = 'lib/main.dart';
const String defaultAssetBasePath = '.';
-const String defaultMaterialAssetBasePath = 'packages/material_design_icons/icons';
const String defaultManifestPath = 'flutter.yaml';
const String defaultFlxOutputPath = 'build/app.flx';
const String defaultSnapshotPath = 'build/snapshot_blob.bin';
const String defaultPrivateKeyPath = 'privatekey.der';
const String _kSnapshotKey = 'snapshot_blob.bin';
-Map<String, double> _kIconDensities = {
- 'mdpi': 1.0,
- 'hdpi' : 1.5,
- 'xhdpi' : 2.0,
- 'xxhdpi' : 3.0,
- 'xxxhdpi' : 4.0
-};
-const List<String> _kThemes = const <String>['white', 'black'];
-const List<int> _kSizes = const <int>[18, 24, 36, 48];
class _Asset {
final String source;
@@ -43,6 +34,27 @@
_Asset({ this.source, this.base, this.key });
}
+const String _kMaterialIconsKey = 'fonts/MaterialIcons-Regular.ttf';
+
+List _getMaterialFonts() {
+ return [{
+ 'family': 'MaterialIcons',
+ 'fonts': [{
+ 'asset': _kMaterialIconsKey
+ }]
+ }];
+}
+
+List<_Asset> _getMaterialAssets() {
+ return <_Asset>[
+ new _Asset(
+ base: '${ArtifactStore.flutterRoot}/bin/cache/artifacts/material_fonts',
+ source: 'MaterialIcons-Regular.ttf',
+ key: _kMaterialIconsKey
+ )
+ ];
+}
+
Map<_Asset, List<_Asset>> _parseAssets(Map manifestDescriptor, String assetBase) {
Map<_Asset, List<_Asset>> result = <_Asset, List<_Asset>>{};
if (manifestDescriptor == null)
@@ -70,68 +82,6 @@
return result;
}
-class _MaterialAsset extends _Asset {
- final String name;
- final String density;
- final String theme;
- final int size;
-
- _MaterialAsset(this.name, this.density, this.theme, this.size, String assetBase)
- : super(base: assetBase);
-
- String get source {
- List<String> parts = name.split('/');
- String category = parts[0];
- String subtype = parts[1];
- return '$category/drawable-$density/ic_${subtype}_${theme}_${size}dp.png';
- }
-
- String get key {
- List<String> parts = name.split('/');
- String category = parts[0];
- String subtype = parts[1];
- double devicePixelRatio = _kIconDensities[density];
- if (devicePixelRatio == 1.0)
- return '$category/ic_${subtype}_${theme}_${size}dp.png';
- else
- return '$category/${devicePixelRatio}x/ic_${subtype}_${theme}_${size}dp.png';
- }
-}
-
-Iterable/*<T>*/ _generateValues/*<T>*/(
- Map/*<String, T>*/ assetDescriptor,
- String key,
- Iterable/*<T>*/ defaults
-) {
- return assetDescriptor.containsKey(key) ? /*<T>*/[assetDescriptor[key]] : defaults;
-}
-
-void _accumulateMaterialAssets(Map<_Asset, List<_Asset>> result, Map assetDescriptor, String assetBase) {
- String name = assetDescriptor['name'];
- for (String theme in _generateValues(assetDescriptor, 'theme', _kThemes)) {
- for (int size in _generateValues(assetDescriptor, 'size', _kSizes)) {
- _MaterialAsset main = new _MaterialAsset(name, 'mdpi', theme, size, assetBase);
- List<_Asset> variants = <_Asset>[];
- result[main] = variants;
- for (String density in _generateValues(assetDescriptor, 'density', _kIconDensities.keys)) {
- if (density == 'mdpi')
- continue;
- variants.add(new _MaterialAsset(name, density, theme, size, assetBase));
- }
- }
- }
-}
-
-Map<_Asset, List<_Asset>> _parseMaterialAssets(Map manifestDescriptor, String assetBase) {
- Map<_Asset, List<_Asset>> result = <_Asset, List<_Asset>>{};
- if (manifestDescriptor == null || !manifestDescriptor.containsKey('material-design-icons'))
- return result;
- for (Map assetDescriptor in manifestDescriptor['material-design-icons']) {
- _accumulateMaterialAssets(result, assetDescriptor, assetBase);
- }
- return result;
-}
-
dynamic _loadManifest(String manifestPath) {
if (manifestPath == null || !FileSystemEntity.isFileSync(manifestPath))
return null;
@@ -160,12 +110,15 @@
return new ZipEntry.fromString('AssetManifest.json', JSON.encode(json));
}
-ZipEntry _createFontManifest(Map manifestDescriptor) {
- if (manifestDescriptor != null && manifestDescriptor.containsKey('fonts')) {
- return new ZipEntry.fromString('FontManifest.json', JSON.encode(manifestDescriptor['fonts']));
- } else {
+ZipEntry _createFontManifest(Map manifestDescriptor, List additionalFonts) {
+ List fonts = [];
+ if (additionalFonts != null)
+ fonts.addAll(additionalFonts);
+ if (manifestDescriptor != null && manifestDescriptor.containsKey('fonts'))
+ fonts.addAll(manifestDescriptor['fonts']);
+ if (fonts.isEmpty)
return null;
- }
+ return new ZipEntry.fromString('FontManifest.json', JSON.encode(fonts));
}
/// Build the flx in the build/ directory and return `localBundlePath` on success.
@@ -203,7 +156,6 @@
Future<int> build(
Toolchain toolchain, {
- String materialAssetBasePath: defaultMaterialAssetBasePath,
String mainPath: defaultMainPath,
String manifestPath: defaultManifestPath,
String outputPath: defaultFlxOutputPath,
@@ -234,7 +186,6 @@
manifestDescriptor: manifestDescriptor,
snapshotFile: snapshotFile,
assetBasePath: assetBasePath,
- materialAssetBasePath: materialAssetBasePath,
outputPath: outputPath,
privateKeyPath: privateKeyPath
);
@@ -244,14 +195,14 @@
Map manifestDescriptor: const {},
File snapshotFile,
String assetBasePath: defaultAssetBasePath,
- String materialAssetBasePath: defaultMaterialAssetBasePath,
String outputPath: defaultFlxOutputPath,
String privateKeyPath: defaultPrivateKeyPath
}) async {
printTrace('Building $outputPath');
Map<_Asset, List<_Asset>> assets = _parseAssets(manifestDescriptor, assetBasePath);
- assets.addAll(_parseMaterialAssets(manifestDescriptor, materialAssetBasePath));
+
+ final bool usesMaterialDesign = manifestDescriptor != null && manifestDescriptor['uses-material-design'] == true;
ZipBuilder zipBuilder = new ZipBuilder();
@@ -262,21 +213,28 @@
ZipEntry assetEntry = _createAssetEntry(asset);
if (assetEntry == null)
return 1;
- else
- zipBuilder.addEntry(assetEntry);
+ zipBuilder.addEntry(assetEntry);
for (_Asset variant in assets[asset]) {
ZipEntry variantEntry = _createAssetEntry(variant);
if (variantEntry == null)
return 1;
- else
- zipBuilder.addEntry(variantEntry);
+ zipBuilder.addEntry(variantEntry);
+ }
+ }
+
+ if (usesMaterialDesign) {
+ for (_Asset asset in _getMaterialAssets()) {
+ ZipEntry assetEntry = _createAssetEntry(asset);
+ if (assetEntry == null)
+ return 1;
+ zipBuilder.addEntry(assetEntry);
}
}
zipBuilder.addEntry(_createAssetManifest(assets));
- ZipEntry fontManifest = _createFontManifest(manifestDescriptor);
+ ZipEntry fontManifest = _createFontManifest(manifestDescriptor, usesMaterialDesign ? _getMaterialFonts() : null);
if (fontManifest != null)
zipBuilder.addEntry(fontManifest);
diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart
index 2ee1846..d8ea7b7 100644
--- a/packages/flutter_tools/lib/src/ios/simulators.dart
+++ b/packages/flutter_tools/lib/src/ios/simulators.dart
@@ -14,6 +14,7 @@
import '../base/process.dart';
import '../build_configuration.dart';
import '../device.dart';
+import '../flx.dart' as flx;
import '../globals.dart';
import '../toolchain.dart';
import 'mac.dart';
@@ -314,12 +315,69 @@
int debugPort: observatoryDefaultPort,
Map<String, dynamic> platformArgs
}) async {
- // TODO(chinmaygarde): Use mainPath, route.
printTrace('Building ${app.name} for $id.');
if (clearLogs)
this.clearLogs();
+ if(!(await _setupUpdatedApplicationBundle(app, toolchain)))
+ return false;
+
+ // Prepare launch arguments.
+ List<String> args = <String>[
+ "--flx=${path.absolute(path.join('build', 'app.flx'))}",
+ "--dart-main=${path.absolute(mainPath)}",
+ "--package-root=${path.absolute('packages')}",
+ ];
+
+ if (checked)
+ args.add("--enable-checked-mode");
+
+ if (startPaused)
+ args.add("--start-paused");
+
+ if (debugPort != observatoryDefaultPort)
+ args.add("--observatory-port=$debugPort");
+
+ // Launch the updated application in the simulator.
+ try {
+ SimControl.instance.launch(id, app.id, args);
+ } catch (error) {
+ printError('$error');
+ return false;
+ }
+
+ printTrace('Successfully started ${app.name} on $id.');
+
+ return true;
+ }
+
+ bool _applicationIsInstalledAndRunning(ApplicationPackage app) {
+ bool isInstalled = exitsHappy([
+ 'xcrun',
+ 'simctl',
+ 'get_app_container',
+ 'booted',
+ app.id,
+ ]);
+
+ bool isRunning = exitsHappy([
+ '/usr/bin/killall',
+ 'Runner',
+ ]);
+
+ return isInstalled && isRunning;
+ }
+
+ Future<bool> _setupUpdatedApplicationBundle(ApplicationPackage app, Toolchain toolchain) async {
+ if (_applicationIsInstalledAndRunning(app)) {
+ return _sideloadUpdatedAssetsForInstalledApplicationBundle(app, toolchain);
+ } else {
+ return _buildAndInstallApplicationBundle(app);
+ }
+ }
+
+ Future<bool> _buildAndInstallApplicationBundle(ApplicationPackage app) async {
// Step 1: Build the Xcode project.
bool buildResult = await buildIOSXcodeProject(app, buildForDevice: false);
if (!buildResult) {
@@ -337,32 +395,14 @@
// Step 3: Install the updated bundle to the simulator.
SimControl.instance.install(id, path.absolute(bundle.path));
-
- // Step 4: Prepare launch arguments.
- List<String> args = <String>[];
-
- if (checked)
- args.add("--enable-checked-mode");
-
- if (startPaused)
- args.add("--start-paused");
-
- if (debugPort != observatoryDefaultPort)
- args.add("--observatory-port=$debugPort");
-
- // Step 5: Launch the updated application in the simulator.
- try {
- SimControl.instance.launch(id, app.id, args);
- } catch (error) {
- printError('$error');
- return false;
- }
-
- printTrace('Successfully started ${app.name} on $id.');
-
return true;
}
+ Future<bool> _sideloadUpdatedAssetsForInstalledApplicationBundle(
+ ApplicationPackage app, Toolchain toolchain) async {
+ return (await flx.build(toolchain, precompiledSnapshot: true)) == 0;
+ }
+
@override
Future<bool> stopApp(ApplicationPackage app) async {
// Currently we don't have a way to stop an app running on iOS.
diff --git a/packages/flutter_tools/templates/create/android/AndroidManifest.xml.tmpl b/packages/flutter_tools/templates/create/android/AndroidManifest.xml.tmpl
index c6455e7..3cc4855 100644
--- a/packages/flutter_tools/templates/create/android/AndroidManifest.xml.tmpl
+++ b/packages/flutter_tools/templates/create/android/AndroidManifest.xml.tmpl
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="{{projectIdentifier}}"
+ package="{{androidIdentifier}}"
android:versionCode="1"
android:versionName="0.0.1">
diff --git a/packages/flutter_tools/templates/create/flutter.yaml.tmpl b/packages/flutter_tools/templates/create/flutter.yaml.tmpl
index 7dfaee1..baae445 100644
--- a/packages/flutter_tools/templates/create/flutter.yaml.tmpl
+++ b/packages/flutter_tools/templates/create/flutter.yaml.tmpl
@@ -1,6 +1,2 @@
name: {{projectName}}
-material-design-icons:
- - name: content/add
- - name: navigation/arrow_back
- - name: navigation/menu
- - name: navigation/more_vert
+uses-material-design: true
diff --git a/packages/flutter_tools/templates/create/ios/Info.plist.tmpl b/packages/flutter_tools/templates/create/ios/Info.plist.tmpl
index 8b317f3..88a6066 100644
--- a/packages/flutter_tools/templates/create/ios/Info.plist.tmpl
+++ b/packages/flutter_tools/templates/create/ios/Info.plist.tmpl
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Runner</string>
<key>CFBundleIdentifier</key>
- <string>{{projectIdentifier}}</string>
+ <string>{{iosIdentifier}}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
diff --git a/packages/flutter_tools/templates/create/lib/main.dart.tmpl b/packages/flutter_tools/templates/create/lib/main.dart.tmpl
index b4c6fd6..f441a1f 100644
--- a/packages/flutter_tools/templates/create/lib/main.dart.tmpl
+++ b/packages/flutter_tools/templates/create/lib/main.dart.tmpl
@@ -44,7 +44,7 @@
onPressed: _incrementCounter,
tooltip: 'Increment',
child: new Icon(
- icon: 'content/add'
+ icon: Icons.add
)
)
);
diff --git a/packages/newton/lib/newton.dart b/packages/newton/lib/newton.dart
index 855de8c..94b6df0 100644
--- a/packages/newton/lib/newton.dart
+++ b/packages/newton/lib/newton.dart
@@ -5,16 +5,12 @@
/// Simple Physics Simulations for Dart. Springs, friction, gravity, etc.
library newton;
-import 'dart:math' as math;
-
-part 'src/simulation.dart';
-part 'src/simulation_group.dart';
-part 'src/tolerance.dart';
-part 'src/utils.dart';
-
-part 'src/clamped_simulation.dart';
-part 'src/friction_simulation.dart';
-part 'src/gravity_simulation.dart';
-part 'src/scroll_simulation.dart';
-part 'src/spring_simulation.dart';
-part 'src/spring_solution.dart';
+export 'src/clamped_simulation.dart';
+export 'src/friction_simulation.dart';
+export 'src/gravity_simulation.dart';
+export 'src/scroll_simulation.dart';
+export 'src/simulation_group.dart';
+export 'src/simulation.dart';
+export 'src/spring_simulation.dart';
+export 'src/tolerance.dart';
+export 'src/utils.dart';
diff --git a/packages/newton/lib/src/clamped_simulation.dart b/packages/newton/lib/src/clamped_simulation.dart
index b485287..b56abf7 100644
--- a/packages/newton/lib/src/clamped_simulation.dart
+++ b/packages/newton/lib/src/clamped_simulation.dart
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'simulation.dart';
class ClampedSimulation extends Simulation {
ClampedSimulation(this.simulation, {
diff --git a/packages/newton/lib/src/friction_simulation.dart b/packages/newton/lib/src/friction_simulation.dart
index 17d1ccc..95b0e5a 100644
--- a/packages/newton/lib/src/friction_simulation.dart
+++ b/packages/newton/lib/src/friction_simulation.dart
@@ -1,8 +1,11 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'dart:math' as math;
+
+import 'simulation.dart';
+import 'tolerance.dart';
class FrictionSimulation extends Simulation {
final double _drag;
diff --git a/packages/newton/lib/src/gravity_simulation.dart b/packages/newton/lib/src/gravity_simulation.dart
index 2f002b7..7a59a18 100644
--- a/packages/newton/lib/src/gravity_simulation.dart
+++ b/packages/newton/lib/src/gravity_simulation.dart
@@ -1,8 +1,8 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'simulation.dart';
class GravitySimulation extends Simulation {
final double _x;
diff --git a/packages/newton/lib/src/scroll_simulation.dart b/packages/newton/lib/src/scroll_simulation.dart
index 3912650..d73ae88 100644
--- a/packages/newton/lib/src/scroll_simulation.dart
+++ b/packages/newton/lib/src/scroll_simulation.dart
@@ -1,8 +1,11 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'friction_simulation.dart';
+import 'simulation_group.dart';
+import 'simulation.dart';
+import 'spring_simulation.dart';
/// Simulates kinetic scrolling behavior between a leading and trailing
/// boundary. Friction is applied within the extends and a spring action applied
diff --git a/packages/newton/lib/src/simulation.dart b/packages/newton/lib/src/simulation.dart
index e374c9d..def3b37 100644
--- a/packages/newton/lib/src/simulation.dart
+++ b/packages/newton/lib/src/simulation.dart
@@ -1,8 +1,8 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'tolerance.dart';
abstract class Simulatable {
/// The current position of the object in the simulation
diff --git a/packages/newton/lib/src/simulation_group.dart b/packages/newton/lib/src/simulation_group.dart
index a7359da..76fb440 100644
--- a/packages/newton/lib/src/simulation_group.dart
+++ b/packages/newton/lib/src/simulation_group.dart
@@ -1,8 +1,10 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'simulation.dart';
+import 'tolerance.dart';
+import 'utils.dart';
/// The abstract base class for all composite simulations. Concrete subclasses
/// must implement the appropriate methods to select the appropriate simulation
@@ -46,7 +48,7 @@
double _lastStep = -1.0;
void _stepIfNecessary(double time) {
- if (_nearEqual(_lastStep, time, toleranceDefault.time)) {
+ if (nearEqual(_lastStep, time, toleranceDefault.time)) {
return;
}
diff --git a/packages/newton/lib/src/spring_simulation.dart b/packages/newton/lib/src/spring_simulation.dart
index ebe5fe1..8406a793 100644
--- a/packages/newton/lib/src/spring_simulation.dart
+++ b/packages/newton/lib/src/spring_simulation.dart
@@ -1,8 +1,124 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
+import 'dart:math' as math;
+
+import 'simulation.dart';
+import 'utils.dart';
+
+abstract class _SpringSolution implements Simulatable {
+ factory _SpringSolution(
+ SpringDescription desc, double initialPosition, double initialVelocity) {
+ double cmk =
+ desc.damping * desc.damping - 4 * desc.mass * desc.springConstant;
+
+ if (cmk == 0.0) {
+ return new _CriticalSolution(desc, initialPosition, initialVelocity);
+ } else if (cmk > 0.0) {
+ return new _OverdampedSolution(desc, initialPosition, initialVelocity);
+ } else {
+ return new _UnderdampedSolution(desc, initialPosition, initialVelocity);
+ }
+
+ return null;
+ }
+
+ SpringType get type;
+}
+
+class _CriticalSolution implements _SpringSolution {
+ final double _r, _c1, _c2;
+
+ factory _CriticalSolution(
+ SpringDescription desc, double distance, double velocity) {
+ final double r = -desc.damping / (2.0 * desc.mass);
+ final double c1 = distance;
+ final double c2 = velocity / (r * distance);
+ return new _CriticalSolution.withArgs(r, c1, c2);
+ }
+
+ SpringType get type => SpringType.criticallyDamped;
+
+ _CriticalSolution.withArgs(double r, double c1, double c2)
+ : _r = r,
+ _c1 = c1,
+ _c2 = c2;
+
+ double x(double time) => (_c1 + _c2 * time) * math.pow(math.E, _r * time);
+
+ double dx(double time) {
+ final double power = math.pow(math.E, _r * time);
+ return _r * (_c1 + _c2 * time) * power + _c2 * power;
+ }
+}
+
+class _OverdampedSolution implements _SpringSolution {
+ final double _r1, _r2, _c1, _c2;
+
+ factory _OverdampedSolution(
+ SpringDescription desc, double distance, double velocity) {
+ final double cmk =
+ desc.damping * desc.damping - 4 * desc.mass * desc.springConstant;
+
+ final double r1 = (-desc.damping - math.sqrt(cmk)) / (2.0 * desc.mass);
+ final double r2 = (-desc.damping + math.sqrt(cmk)) / (2.0 * desc.mass);
+ final double c2 = (velocity - r1 * distance) / (r2 - r1);
+ final double c1 = distance - c2;
+
+ return new _OverdampedSolution.withArgs(r1, r2, c1, c2);
+ }
+
+ _OverdampedSolution.withArgs(double r1, double r2, double c1, double c2)
+ : _r1 = r1,
+ _r2 = r2,
+ _c1 = c1,
+ _c2 = c2;
+
+ SpringType get type => SpringType.overDamped;
+
+ double x(double time) =>
+ (_c1 * math.pow(math.E, _r1 * time) + _c2 * math.pow(math.E, _r2 * time));
+
+ double dx(double time) => (_c1 * _r1 * math.pow(math.E, _r1 * time) +
+ _c2 * _r2 * math.pow(math.E, _r2 * time));
+}
+
+class _UnderdampedSolution implements _SpringSolution {
+ final double _w, _r, _c1, _c2;
+
+ factory _UnderdampedSolution(
+ SpringDescription desc, double distance, double velocity) {
+ final double w = math.sqrt(4.0 * desc.mass * desc.springConstant -
+ desc.damping * desc.damping) /
+ (2.0 * desc.mass);
+ final double r = -(desc.damping / 2.0 * desc.mass);
+ final double c1 = distance;
+ final double c2 = (velocity - r * distance) / w;
+
+ return new _UnderdampedSolution.withArgs(w, r, c1, c2);
+ }
+
+ _UnderdampedSolution.withArgs(double w, double r, double c1, double c2)
+ : _w = w,
+ _r = r,
+ _c1 = c1,
+ _c2 = c2;
+
+ SpringType get type => SpringType.underDamped;
+
+ double x(double time) => math.pow(math.E, _r * time) *
+ (_c1 * math.cos(_w * time) + _c2 * math.sin(_w * time));
+
+ double dx(double time) {
+ final double power = math.pow(math.E, _r * time);
+ final double cosine = math.cos(_w * time);
+ final double sine = math.sin(_w * time);
+
+ return power * (_c2 * _w * cosine - _c1 * _w * sine) +
+ _r * power * (_c2 * sine + _c1 * cosine);
+ }
+}
class SpringDescription {
/// The mass of the spring (m)
@@ -58,8 +174,8 @@
double dx(double time) => _solution.dx(time);
bool isDone(double time) {
- return _nearZero(_solution.x(time), tolerance.distance) &&
- _nearZero(_solution.dx(time), tolerance.velocity);
+ return nearZero(_solution.x(time), tolerance.distance) &&
+ nearZero(_solution.dx(time), tolerance.velocity);
}
}
diff --git a/packages/newton/lib/src/spring_solution.dart b/packages/newton/lib/src/spring_solution.dart
deleted file mode 100644
index 3241311..0000000
--- a/packages/newton/lib/src/spring_solution.dart
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-part of newton;
-
-abstract class _SpringSolution implements Simulatable {
- factory _SpringSolution(
- SpringDescription desc, double initialPosition, double initialVelocity) {
- double cmk =
- desc.damping * desc.damping - 4 * desc.mass * desc.springConstant;
-
- if (cmk == 0.0) {
- return new _CriticalSolution(desc, initialPosition, initialVelocity);
- } else if (cmk > 0.0) {
- return new _OverdampedSolution(desc, initialPosition, initialVelocity);
- } else {
- return new _UnderdampedSolution(desc, initialPosition, initialVelocity);
- }
-
- return null;
- }
-
- SpringType get type;
-}
-
-class _CriticalSolution implements _SpringSolution {
- final double _r, _c1, _c2;
-
- factory _CriticalSolution(
- SpringDescription desc, double distance, double velocity) {
- final double r = -desc.damping / (2.0 * desc.mass);
- final double c1 = distance;
- final double c2 = velocity / (r * distance);
- return new _CriticalSolution.withArgs(r, c1, c2);
- }
-
- SpringType get type => SpringType.criticallyDamped;
-
- _CriticalSolution.withArgs(double r, double c1, double c2)
- : _r = r,
- _c1 = c1,
- _c2 = c2;
-
- double x(double time) => (_c1 + _c2 * time) * math.pow(math.E, _r * time);
-
- double dx(double time) {
- final double power = math.pow(math.E, _r * time);
- return _r * (_c1 + _c2 * time) * power + _c2 * power;
- }
-}
-
-class _OverdampedSolution implements _SpringSolution {
- final double _r1, _r2, _c1, _c2;
-
- factory _OverdampedSolution(
- SpringDescription desc, double distance, double velocity) {
- final double cmk =
- desc.damping * desc.damping - 4 * desc.mass * desc.springConstant;
-
- final double r1 = (-desc.damping - math.sqrt(cmk)) / (2.0 * desc.mass);
- final double r2 = (-desc.damping + math.sqrt(cmk)) / (2.0 * desc.mass);
- final double c2 = (velocity - r1 * distance) / (r2 - r1);
- final double c1 = distance - c2;
-
- return new _OverdampedSolution.withArgs(r1, r2, c1, c2);
- }
-
- _OverdampedSolution.withArgs(double r1, double r2, double c1, double c2)
- : _r1 = r1,
- _r2 = r2,
- _c1 = c1,
- _c2 = c2;
-
- SpringType get type => SpringType.overDamped;
-
- double x(double time) =>
- (_c1 * math.pow(math.E, _r1 * time) + _c2 * math.pow(math.E, _r2 * time));
-
- double dx(double time) => (_c1 * _r1 * math.pow(math.E, _r1 * time) +
- _c2 * _r2 * math.pow(math.E, _r2 * time));
-}
-
-class _UnderdampedSolution implements _SpringSolution {
- final double _w, _r, _c1, _c2;
-
- factory _UnderdampedSolution(
- SpringDescription desc, double distance, double velocity) {
- final double w = math.sqrt(4.0 * desc.mass * desc.springConstant -
- desc.damping * desc.damping) /
- (2.0 * desc.mass);
- final double r = -(desc.damping / 2.0 * desc.mass);
- final double c1 = distance;
- final double c2 = (velocity - r * distance) / w;
-
- return new _UnderdampedSolution.withArgs(w, r, c1, c2);
- }
-
- _UnderdampedSolution.withArgs(double w, double r, double c1, double c2)
- : _w = w,
- _r = r,
- _c1 = c1,
- _c2 = c2;
-
- SpringType get type => SpringType.underDamped;
-
- double x(double time) => math.pow(math.E, _r * time) *
- (_c1 * math.cos(_w * time) + _c2 * math.sin(_w * time));
-
- double dx(double time) {
- final double power = math.pow(math.E, _r * time);
- final double cosine = math.cos(_w * time);
- final double sine = math.sin(_w * time);
-
- return power * (_c2 * _w * cosine - _c1 * _w * sine) +
- _r * power * (_c2 * sine + _c1 * cosine);
- }
-}
diff --git a/packages/newton/lib/src/tolerance.dart b/packages/newton/lib/src/tolerance.dart
index ae417f8..5b764d8 100644
--- a/packages/newton/lib/src/tolerance.dart
+++ b/packages/newton/lib/src/tolerance.dart
@@ -1,9 +1,7 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
-
class Tolerance {
final double distance;
final double time;
diff --git a/packages/newton/lib/src/utils.dart b/packages/newton/lib/src/utils.dart
index 75709a3..24a5e11 100644
--- a/packages/newton/lib/src/utils.dart
+++ b/packages/newton/lib/src/utils.dart
@@ -1,10 +1,8 @@
-// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-part of newton;
-
-bool _nearEqual(double a, double b, double epsilon) =>
+bool nearEqual(double a, double b, double epsilon) =>
(a > (b - epsilon)) && (a < (b + epsilon));
-bool _nearZero(double a, double epsilon) => _nearEqual(a, 0.0, epsilon);
+bool nearZero(double a, double epsilon) => nearEqual(a, 0.0, epsilon);