Update gallery, fix Cupertino fonts by using GoogleSans instead (#155)

* Update gallery, fix Cupertino fonts

Cupertino fonts fixed by using GoogleSans instead

* remove BUILD.gn

* remove ios and android dirs from web/gallery

* remove meta/flutter_gallery.cmx

* revert provider_shopper/pubspec.lock

* remove gallery's test and tool directories

* update web/gallery README
pull/157/head
John Ryan 5 years ago committed by GitHub
parent 2af51a8222
commit a29853144b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,73 +0,0 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.packages
.pub-cache/
.pub/
/build/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java
# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

@ -1,10 +0,0 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 393106fbf58124aef777fc12e97a20e237842f99
channel: master
project_type: app

@ -1,5 +1,28 @@
A gallery of Flutter widgets and UX studies. # Flutter gallery
Original source on [GitHub][gallery]. This is a copy of the [Flutter gallery] hosted at
[flutter.github.io/samples][hosted url].
[gallery]: https://github.com/flutter/flutter/tree/master/examples/flutter_gallery ## Updating
To update, copy the contents of the gallery directory, and remove the following
files and directories:
```bash
rm BUILD.gn
rm -rf tool/
rm -rf test/
rm -rf android/
rm -rf ios/
```
If you changed the `pubspec.yaml` file, make sure to use Google Sans instead of
San Francisco (which is not available on the web) by copy-pasting the `fonts`
section from Google Sans:
- Use "GoogleSans" for ".SF Pro Text".
- Use "GoogleSansDisplay" for ".SF Pro Display"
- Use "GoogleSans" for ".SF UI Text"
- Use "GoogleSansDisplay" for ".SF UI Display".
[Flutter gallery]: https://github.com/flutter/flutter/tree/master/examples/flutter_gallery
[hosted url]: https://flutter.github.io/samples/gallery/#/

@ -0,0 +1,8 @@
# Take our settings from the repo's main analysis_options.yaml file, but add
# an exclude for the build directory.
include: ../../analysis_options.yaml
analyzer:
exclude:
- build/**

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

@ -302,8 +302,9 @@ class CalcExpression {
assert(false); assert(false);
} }
} }
final List<ExpressionToken> outList = <ExpressionToken>[]; final List<ExpressionToken> outList = <ExpressionToken>[
outList.add(ResultToken(currentTermValue)); ResultToken(currentTermValue),
];
return CalcExpression(outList, ExpressionState.Result); return CalcExpression(outList, ExpressionState.Result);
} }

@ -117,7 +117,7 @@ class PaletteTabView extends StatelessWidget {
); );
}), }),
], ],
) ),
); );
} }
} }

@ -54,33 +54,31 @@ class _ContactItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final List<Widget> columnChildren = lines.sublist(0, lines.length - 1).map<Widget>((String line) => Text(line)).toList();
columnChildren.add(Text(lines.last, style: themeData.textTheme.caption));
final List<Widget> rowChildren = <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: columnChildren,
),
),
];
if (icon != null) {
rowChildren.add(SizedBox(
width: 72.0,
child: IconButton(
icon: Icon(icon),
color: themeData.primaryColor,
onPressed: onPressed,
),
));
}
return MergeSemantics( return MergeSemantics(
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0), padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: rowChildren, children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
...lines.sublist(0, lines.length - 1).map<Widget>((String line) => Text(line)),
Text(lines.last, style: themeData.textTheme.caption),
],
),
),
if (icon != null)
SizedBox(
width: 72.0,
child: IconButton(
icon: Icon(icon),
color: themeData.primaryColor,
onPressed: onPressed,
),
),
],
), ),
), ),
); );

@ -53,159 +53,146 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
style: CupertinoTheme.of(context).textTheme.textStyle, style: CupertinoTheme.of(context).textTheme.textStyle,
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
final List<Widget> stackChildren = <Widget>[
CupertinoScrollbar(
child: ListView(
// Add more padding to the normal safe area.
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0)
+ MediaQuery.of(context).padding,
children: <Widget>[
CupertinoButton.filled(
child: const Text('Alert'),
onPressed: () {
showDemoDialog(
context: context,
child: CupertinoAlertDialog(
title: const Text('Discard draft?'),
actions: <Widget>[
CupertinoDialogAction(
child: const Text('Discard'),
isDestructiveAction: true,
onPressed: () {
Navigator.pop(context, 'Discard');
},
),
CupertinoDialogAction(
child: const Text('Cancel'),
isDefaultAction: true,
onPressed: () {
Navigator.pop(context, 'Cancel');
},
),
],
),
);
},
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Alert with Title'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () {
showDemoDialog(
context: context,
child: CupertinoAlertDialog(
title: const Text('Allow "Maps" to access your location while you are using the app?'),
content: const Text('Your current location will be displayed on the map and used '
'for directions, nearby search results, and estimated travel times.'),
actions: <Widget>[
CupertinoDialogAction(
child: const Text('Don\'t Allow'),
onPressed: () {
Navigator.pop(context, 'Disallow');
},
),
CupertinoDialogAction(
child: const Text('Allow'),
onPressed: () {
Navigator.pop(context, 'Allow');
},
),
],
),
);
},
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Alert with Buttons'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () {
showDemoDialog(
context: context,
child: const CupertinoDessertDialog(
title: Text('Select Favorite Dessert'),
content: Text('Please select your favorite type of dessert from the '
'list below. Your selection will be used to customize the suggested '
'list of eateries in your area.'),
),
);
},
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Alert Buttons Only'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () {
showDemoDialog(
context: context,
child: const CupertinoDessertDialog(),
);
},
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Action Sheet'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () {
showDemoActionSheet(
context: context,
child: CupertinoActionSheet(
title: const Text('Favorite Dessert'),
message: const Text('Please select the best dessert from the options below.'),
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('Profiteroles'),
onPressed: () {
Navigator.pop(context, 'Profiteroles');
},
),
CupertinoActionSheetAction(
child: const Text('Cannolis'),
onPressed: () {
Navigator.pop(context, 'Cannolis');
},
),
CupertinoActionSheetAction(
child: const Text('Trifle'),
onPressed: () {
Navigator.pop(context, 'Trifle');
},
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
isDefaultAction: true,
onPressed: () {
Navigator.pop(context, 'Cancel');
},
),
),
);
},
),
],
),
),
];
if (lastSelectedValue != null) {
stackChildren.add(
Positioned(
bottom: 32.0,
child: Text('You selected: $lastSelectedValue'),
),
);
}
return Stack( return Stack(
alignment: Alignment.center, alignment: Alignment.center,
children: stackChildren, children: <Widget>[
CupertinoScrollbar(
child: ListView(
// Add more padding to the normal safe area.
padding: const EdgeInsets.symmetric(vertical: 24.0, horizontal: 72.0)
+ MediaQuery.of(context).padding,
children: <Widget>[
CupertinoButton.filled(
child: const Text('Alert'),
onPressed: () => _onAlertPress(context),
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Alert with Title'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () => _onAlertWithTitlePress(context),
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Alert with Buttons'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () => _onAlertWithButtonsPress(context),
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Alert Buttons Only'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () {
showDemoDialog(
context: context,
child: const CupertinoDessertDialog(),
);
},
),
const Padding(padding: EdgeInsets.all(8.0)),
CupertinoButton.filled(
child: const Text('Action Sheet'),
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
onPressed: () => _onActionSheetPress(context),
),
],
),
),
if (lastSelectedValue != null)
Positioned(
bottom: 32.0,
child: Text('You selected: $lastSelectedValue'),
),
],
); );
}, },
), ),
), ),
); );
} }
void _onAlertPress(BuildContext context) {
showDemoDialog(
context: context,
child: CupertinoAlertDialog(
title: const Text('Discard draft?'),
actions: <Widget>[
CupertinoDialogAction(
child: const Text('Discard'),
isDestructiveAction: true,
onPressed: () => Navigator.pop(context, 'Discard'),
),
CupertinoDialogAction(
child: const Text('Cancel'),
isDefaultAction: true,
onPressed: () => Navigator.pop(context, 'Cancel'),
),
],
),
);
}
void _onAlertWithTitlePress(BuildContext context) {
showDemoDialog(
context: context,
child: CupertinoAlertDialog(
title: const Text('Allow "Maps" to access your location while you are using the app?'),
content: const Text('Your current location will be displayed on the map and used '
'for directions, nearby search results, and estimated travel times.'),
actions: <Widget>[
CupertinoDialogAction(
child: const Text('Don\'t Allow'),
onPressed: () => Navigator.pop(context, 'Disallow'),
),
CupertinoDialogAction(
child: const Text('Allow'),
onPressed: () => Navigator.pop(context, 'Allow'),
),
],
),
);
}
void _onAlertWithButtonsPress(BuildContext context) {
showDemoDialog(
context: context,
child: const CupertinoDessertDialog(
title: Text('Select Favorite Dessert'),
content: Text('Please select your favorite type of dessert from the '
'list below. Your selection will be used to customize the suggested '
'list of eateries in your area.'),
),
);
}
void _onActionSheetPress(BuildContext context) {
showDemoActionSheet(
context: context,
child: CupertinoActionSheet(
title: const Text('Favorite Dessert'),
message: const Text('Please select the best dessert from the options below.'),
actions: <Widget>[
CupertinoActionSheetAction(
child: const Text('Profiteroles'),
onPressed: () => Navigator.pop(context, 'Profiteroles'),
),
CupertinoActionSheetAction(
child: const Text('Cannolis'),
onPressed: () => Navigator.pop(context, 'Cannolis'),
),
CupertinoActionSheetAction(
child: const Text('Trifle'),
onPressed: () => Navigator.pop(context, 'Trifle'),
),
],
cancelButton: CupertinoActionSheetAction(
child: const Text('Cancel'),
isDefaultAction: true,
onPressed: () => Navigator.pop(context, 'Cancel'),
),
),
);
}
} }
class CupertinoDessertDialog extends StatelessWidget { class CupertinoDessertDialog extends StatelessWidget {

@ -647,25 +647,21 @@ class Tab2ConversationRow extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<Widget> children = <Widget>[];
if (avatar != null)
children.add(avatar);
final bool isSelf = avatar == null; final bool isSelf = avatar == null;
children.add(
Tab2ConversationBubble(
text: text,
color: isSelf
? Tab2ConversationBubbleColor.blue
: Tab2ConversationBubbleColor.gray,
),
);
return SafeArea( return SafeArea(
child: Row( child: Row(
mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start, mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end, crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
children: children, children: <Widget>[
if (avatar != null) avatar,
Tab2ConversationBubble(
text: text,
color: isSelf
? Tab2ConversationBubbleColor.blue
: Tab2ConversationBubbleColor.gray,
),
],
), ),
); );
} }

@ -139,7 +139,7 @@ class FruitPage extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
CircleAvatar( const CircleAvatar(
backgroundImage: ExactAssetImage( backgroundImage: ExactAssetImage(
'people/square/trevor.png', 'people/square/trevor.png',
package: 'flutter_gallery_assets', package: 'flutter_gallery_assets',

@ -140,7 +140,7 @@ class CategoryView extends StatelessWidget {
], ],
); );
}).toList(), }).toList(),
) ),
); );
} }
} }

@ -57,7 +57,7 @@ class _BannerDemoState extends State<BannerDemo> {
setState(() { setState(() {
_displayBanner = false; _displayBanner = false;
}); });
} },
), ),
if (_showMultipleActions) if (_showMultipleActions)
FlatButton( FlatButton(
@ -66,7 +66,7 @@ class _BannerDemoState extends State<BannerDemo> {
setState(() { setState(() {
_displayBanner = false; _displayBanner = false;
}); });
} },
), ),
], ],
); );

@ -164,10 +164,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
} }
Widget _buildTransitionsStack() { Widget _buildTransitionsStack() {
final List<FadeTransition> transitions = <FadeTransition>[]; final List<FadeTransition> transitions = <FadeTransition>[
for (NavigationIconView view in _navigationViews) view.transition(_type, context),
for (NavigationIconView view in _navigationViews) ];
transitions.add(view.transition(_type, context));
// We want to have the newly animating (fading in) views on top. // We want to have the newly animating (fading in) views on top.
transitions.sort((FadeTransition a, FadeTransition b) { transitions.sort((FadeTransition a, FadeTransition b) {

@ -262,89 +262,83 @@ class TravelDestinationContent extends StatelessWidget {
final TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white); final TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white);
final TextStyle descriptionStyle = theme.textTheme.subhead; final TextStyle descriptionStyle = theme.textTheme.subhead;
final List<Widget> children = <Widget>[ return Column(
// Photo and title. crossAxisAlignment: CrossAxisAlignment.start,
SizedBox( children: <Widget>[
height: 184.0, // Photo and title.
child: Stack( SizedBox(
children: <Widget>[ height: 184.0,
Positioned.fill( child: Stack(
// In order to have the ink splash appear above the image, you children: <Widget>[
// must use Ink.image. This allows the image to be painted as part Positioned.fill(
// of the Material and display ink effects above it. Using a // In order to have the ink splash appear above the image, you
// standard Image will obscure the ink splash. // must use Ink.image. This allows the image to be painted as part
child: Ink.image( // of the Material and display ink effects above it. Using a
image: AssetImage(destination.assetName, package: destination.assetPackage), // standard Image will obscure the ink splash.
fit: BoxFit.cover, child: Ink.image(
child: Container(), image: AssetImage(destination.assetName, package: destination.assetPackage),
), fit: BoxFit.cover,
), child: Container(),
Positioned(
bottom: 16.0,
left: 16.0,
right: 16.0,
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
destination.title,
style: titleStyle,
), ),
), ),
), Positioned(
], bottom: 16.0,
), left: 16.0,
), right: 16.0,
// Description and share/explore buttons. child: FittedBox(
Padding( fit: BoxFit.scaleDown,
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0), alignment: Alignment.centerLeft,
child: DefaultTextStyle( child: Text(
softWrap: false, destination.title,
overflow: TextOverflow.ellipsis, style: titleStyle,
style: descriptionStyle, ),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// three line description
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
destination.description,
style: descriptionStyle.copyWith(color: Colors.black54),
), ),
), ),
Text(destination.city),
Text(destination.location),
], ],
), ),
), ),
), // Description and share/explore buttons.
]; Padding(
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0),
if (destination.type == CardDemoType.standard) { child: DefaultTextStyle(
children.add( softWrap: false,
// share, explore buttons overflow: TextOverflow.ellipsis,
ButtonBar( style: descriptionStyle,
alignment: MainAxisAlignment.start, child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
FlatButton( children: <Widget>[
child: Text('SHARE', semanticsLabel: 'Share ${destination.title}'), // three line description
textColor: Colors.amber.shade500, Padding(
onPressed: () { print('pressed'); }, padding: const EdgeInsets.only(bottom: 8.0),
), child: Text(
FlatButton( destination.description,
child: Text('EXPLORE', semanticsLabel: 'Explore ${destination.title}'), style: descriptionStyle.copyWith(color: Colors.black54),
textColor: Colors.amber.shade500, ),
onPressed: () { print('pressed'); }, ),
Text(destination.city),
Text(destination.location),
],
), ),
], ),
), ),
); if (destination.type == CardDemoType.standard)
} // share, explore buttons
ButtonBar(
return Column( alignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: children, FlatButton(
child: Text('SHARE', semanticsLabel: 'Share ${destination.title}'),
textColor: Colors.amber.shade500,
onPressed: () { print('pressed'); },
),
FlatButton(
child: Text('EXPLORE', semanticsLabel: 'Explore ${destination.title}'),
textColor: Colors.amber.shade500,
onPressed: () { print('pressed'); },
),
],
),
],
); );
} }
} }

@ -83,40 +83,36 @@ class _ChipsTile extends StatelessWidget {
// Wraps a list of chips into a ListTile for display as a section in the demo. // Wraps a list of chips into a ListTile for display as a section in the demo.
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<Widget> cardChildren = <Widget>[
Container(
padding: const EdgeInsets.only(top: 16.0, bottom: 4.0),
alignment: Alignment.center,
child: Text(label, textAlign: TextAlign.start),
),
];
if (children.isNotEmpty) {
cardChildren.add(Wrap(
children: children.map<Widget>((Widget chip) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: chip,
);
}).toList()));
} else {
final TextStyle textStyle = Theme.of(context).textTheme.caption.copyWith(fontStyle: FontStyle.italic);
cardChildren.add(
Semantics(
container: true,
child: Container(
alignment: Alignment.center,
constraints: const BoxConstraints(minWidth: 48.0, minHeight: 48.0),
padding: const EdgeInsets.all(8.0),
child: Text('None', style: textStyle),
),
));
}
return Card( return Card(
semanticContainer: false, semanticContainer: false,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: cardChildren, children: <Widget>[
Container(
padding: const EdgeInsets.only(top: 16.0, bottom: 4.0),
alignment: Alignment.center,
child: Text(label, textAlign: TextAlign.start),
),
if (children.isNotEmpty)
Wrap(
children: children.map<Widget>((Widget chip) {
return Padding(
padding: const EdgeInsets.all(2.0),
child: chip,
);
}).toList(),
)
else
Semantics(
container: true,
child: Container(
alignment: Alignment.center,
constraints: const BoxConstraints(minWidth: 48.0, minHeight: 48.0),
padding: const EdgeInsets.all(8.0),
child: Text('None', style: Theme.of(context).textTheme.caption.copyWith(fontStyle: FontStyle.italic)),
),
),
],
), ),
); );
} }

@ -245,14 +245,18 @@ class _LeaveBehindListItem extends StatelessWidget {
}, },
background: Container( background: Container(
color: theme.primaryColor, color: theme.primaryColor,
child: const ListTile( child: const Center(
leading: Icon(Icons.delete, color: Colors.white, size: 36.0), child: ListTile(
leading: Icon(Icons.delete, color: Colors.white, size: 36.0),
),
), ),
), ),
secondaryBackground: Container( secondaryBackground: Container(
color: theme.primaryColor, color: theme.primaryColor,
child: const ListTile( child: const Center(
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0), child: ListTile(
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0),
),
), ),
), ),
child: Container( child: Container(

@ -204,22 +204,23 @@ class _SearchDemoSearchDelegate extends SearchDelegate<int> {
@override @override
List<Widget> buildActions(BuildContext context) { List<Widget> buildActions(BuildContext context) {
return <Widget>[ return <Widget>[
query.isEmpty if (query.isEmpty)
? IconButton( IconButton(
tooltip: 'Voice Search', tooltip: 'Voice Search',
icon: const Icon(Icons.mic), icon: const Icon(Icons.mic),
onPressed: () { onPressed: () {
query = 'TODO: implement voice input'; query = 'TODO: implement voice input';
}, },
) )
: IconButton( else
tooltip: 'Clear', IconButton(
icon: const Icon(Icons.clear), tooltip: 'Clear',
onPressed: () { icon: const Icon(Icons.clear),
query = ''; onPressed: () {
showSuggestions(context); query = '';
}, showSuggestions(context);
), },
),
]; ];
} }
} }

@ -88,7 +88,7 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
tooltip: 'Create', tooltip: 'Create',
onPressed: () { onPressed: () {
print('Floating Action Button was pressed'); print('Floating Action Button was pressed');
} },
), ),
); );
} }

@ -22,6 +22,65 @@ const Cubic _kDecelerateCurve = Cubic(0.23, 0.94, 0.41, 1.0);
const double _kPeakVelocityTime = 0.248210; const double _kPeakVelocityTime = 0.248210;
const double _kPeakVelocityProgress = 0.379146; const double _kPeakVelocityProgress = 0.379146;
class _TappableWhileStatusIs extends StatefulWidget {
const _TappableWhileStatusIs(
this.status, {
Key key,
this.controller,
this.child,
}) : super(key: key);
final AnimationController controller;
final AnimationStatus status;
final Widget child;
@override
_TappableWhileStatusIsState createState() => _TappableWhileStatusIsState();
}
class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> {
bool _active;
@override
void initState() {
super.initState();
widget.controller.addStatusListener(_handleStatusChange);
_active = widget.controller.status == widget.status;
}
@override
void dispose() {
widget.controller.removeStatusListener(_handleStatusChange);
super.dispose();
}
void _handleStatusChange(AnimationStatus status) {
final bool value = widget.controller.status == widget.status;
if (_active != value) {
setState(() {
_active = value;
});
}
}
@override
Widget build(BuildContext context) {
Widget child = AbsorbPointer(
absorbing: !_active,
child: widget.child,
);
if (!_active) {
child = FocusScope(
canRequestFocus: false,
debugLabel: '$_TappableWhileStatusIs',
child: child,
);
}
return child;
}
}
class _FrontLayer extends StatelessWidget { class _FrontLayer extends StatelessWidget {
const _FrontLayer({ const _FrontLayer({
Key key, Key key,
@ -275,12 +334,20 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
return Stack( return Stack(
key: _backdropKey, key: _backdropKey,
children: <Widget>[ children: <Widget>[
widget.backLayer, _TappableWhileStatusIs(
AnimationStatus.dismissed,
controller: _controller,
child: widget.backLayer,
),
PositionedTransition( PositionedTransition(
rect: _layerAnimation, rect: _layerAnimation,
child: _FrontLayer( child: _FrontLayer(
onTap: _toggleBackdropLayerVisibility, onTap: _toggleBackdropLayerVisibility,
child: widget.frontLayer, child: _TappableWhileStatusIs(
AnimationStatus.completed,
controller: _controller,
child: widget.frontLayer,
),
), ),
), ),
], ],

@ -48,6 +48,8 @@ class TypographyDemo extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme; final TextTheme textTheme = Theme.of(context).textTheme;
final List<Widget> styleItems = <Widget>[ final List<Widget> styleItems = <Widget>[
if (MediaQuery.of(context).size.width > 500.0)
TextStyleItem(name: 'Display 4', style: textTheme.display4, text: 'Light 112sp'),
TextStyleItem(name: 'Display 3', style: textTheme.display3, text: 'Regular 56sp'), TextStyleItem(name: 'Display 3', style: textTheme.display3, text: 'Regular 56sp'),
TextStyleItem(name: 'Display 2', style: textTheme.display2, text: 'Regular 45sp'), TextStyleItem(name: 'Display 2', style: textTheme.display2, text: 'Regular 45sp'),
TextStyleItem(name: 'Display 1', style: textTheme.display1, text: 'Regular 34sp'), TextStyleItem(name: 'Display 1', style: textTheme.display1, text: 'Regular 34sp'),
@ -60,14 +62,6 @@ class TypographyDemo extends StatelessWidget {
TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp'), TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp'),
]; ];
if (MediaQuery.of(context).size.width > 500.0) {
styleItems.insert(0, TextStyleItem(
name: 'Display 4',
style: textTheme.display4,
text: 'Light 112sp',
));
}
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('Typography')), appBar: AppBar(title: const Text('Typography')),
body: SafeArea( body: SafeArea(

@ -66,10 +66,19 @@ class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AbsorbPointer( Widget child = AbsorbPointer(
absorbing: !_active, absorbing: !_active,
child: widget.child, child: widget.child,
); );
if (!_active) {
child = FocusScope(
canRequestFocus: false,
debugLabel: '$_TappableWhileStatusIs',
child: child,
);
}
return child;
} }
} }
@ -138,36 +147,31 @@ class _BackAppBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final List<Widget> children = <Widget>[
Container(
alignment: Alignment.center,
width: 56.0,
child: leading,
),
Expanded(
child: title,
),
];
if (trailing != null) {
children.add(
Container(
alignment: Alignment.center,
width: 56.0,
child: trailing,
),
);
}
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return IconTheme.merge( return IconTheme.merge(
data: theme.primaryIconTheme, data: theme.primaryIconTheme,
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.primaryTextTheme.title, style: theme.primaryTextTheme.title,
child: SizedBox( child: SizedBox(
height: _kBackAppBarHeight, height: _kBackAppBarHeight,
child: Row(children: children), child: Row(
children: <Widget>[
Container(
alignment: Alignment.center,
width: 56.0,
child: leading,
),
Expanded(
child: title,
),
if (trailing != null)
Container(
alignment: Alignment.center,
width: 56.0,
child: trailing,
),
],
),
), ),
), ),
); );
@ -255,95 +259,92 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
begin: RelativeRect.fromLTRB(0.0, constraints.biggest.height - _kFrontClosedHeight, 0.0, 0.0), begin: RelativeRect.fromLTRB(0.0, constraints.biggest.height - _kFrontClosedHeight, 0.0, 0.0),
end: const RelativeRect.fromLTRB(0.0, _kBackAppBarHeight, 0.0, 0.0), end: const RelativeRect.fromLTRB(0.0, _kBackAppBarHeight, 0.0, 0.0),
)); ));
return Stack(
final List<Widget> layers = <Widget>[ key: _backdropKey,
// Back layer children: <Widget>[
Column( // Back layer
crossAxisAlignment: CrossAxisAlignment.stretch, Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.stretch,
_BackAppBar( children: <Widget>[
leading: widget.frontAction, _BackAppBar(
title: _CrossFadeTransition( leading: widget.frontAction,
progress: _controller, title: _CrossFadeTransition(
alignment: AlignmentDirectional.centerStart,
child0: Semantics(namesRoute: true, child: widget.frontTitle),
child1: Semantics(namesRoute: true, child: widget.backTitle),
),
trailing: IconButton(
onPressed: _toggleFrontLayer,
tooltip: 'Toggle options page',
icon: AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: _controller, progress: _controller,
alignment: AlignmentDirectional.centerStart,
child0: Semantics(namesRoute: true, child: widget.frontTitle),
child1: Semantics(namesRoute: true, child: widget.backTitle),
),
trailing: IconButton(
onPressed: _toggleFrontLayer,
tooltip: 'Toggle options page',
icon: AnimatedIcon(
icon: AnimatedIcons.close_menu,
progress: _controller,
),
), ),
), ),
), Expanded(
Expanded( child: _TappableWhileStatusIs(
child: Visibility( AnimationStatus.dismissed,
child: widget.backLayer, controller: _controller,
visible: _controller.status != AnimationStatus.completed, child: Visibility(
maintainState: true, child: widget.backLayer,
), visible: _controller.status != AnimationStatus.completed,
), maintainState: true,
],
),
// Front layer
PositionedTransition(
rect: frontRelativeRect,
child: AnimatedBuilder(
animation: _controller,
builder: (BuildContext context, Widget child) {
return PhysicalShape(
elevation: 12.0,
color: Theme.of(context).canvasColor,
clipper: ShapeBorderClipper(
shape: BeveledRectangleBorder(
borderRadius: _kFrontHeadingBevelRadius.transform(_controller.value),
), ),
), ),
clipBehavior: Clip.antiAlias,
child: child,
);
},
child: _TappableWhileStatusIs(
AnimationStatus.completed,
controller: _controller,
child: FadeTransition(
opacity: _frontOpacity,
child: widget.frontLayer,
), ),
), ],
), ),
), // Front layer
];
// The front "heading" is a (typically transparent) widget that's stacked on
// top of, and at the top of, the front layer. It adds support for dragging
// the front layer up and down and for opening and closing the front layer
// with a tap. It may obscure part of the front layer's topmost child.
if (widget.frontHeading != null) {
layers.add(
PositionedTransition( PositionedTransition(
rect: frontRelativeRect, rect: frontRelativeRect,
child: ExcludeSemantics( child: AnimatedBuilder(
child: Container( animation: _controller,
alignment: Alignment.topLeft, builder: (BuildContext context, Widget child) {
child: GestureDetector( return PhysicalShape(
behavior: HitTestBehavior.opaque, elevation: 12.0,
onTap: _toggleFrontLayer, color: Theme.of(context).canvasColor,
onVerticalDragUpdate: _handleDragUpdate, clipper: ShapeBorderClipper(
onVerticalDragEnd: _handleDragEnd, shape: BeveledRectangleBorder(
child: widget.frontHeading, borderRadius: _kFrontHeadingBevelRadius.transform(_controller.value),
),
),
clipBehavior: Clip.antiAlias,
child: child,
);
},
child: _TappableWhileStatusIs(
AnimationStatus.completed,
controller: _controller,
child: FadeTransition(
opacity: _frontOpacity,
child: widget.frontLayer,
), ),
), ),
), ),
), ),
); // The front "heading" is a (typically transparent) widget that's stacked on
} // top of, and at the top of, the front layer. It adds support for dragging
// the front layer up and down and for opening and closing the front layer
return Stack( // with a tap. It may obscure part of the front layer's topmost child.
key: _backdropKey, if (widget.frontHeading != null)
children: layers, PositionedTransition(
rect: frontRelativeRect,
child: ExcludeSemantics(
child: Container(
alignment: Alignment.topLeft,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: _toggleFrontLayer,
onVerticalDragUpdate: _handleDragUpdate,
onVerticalDragEnd: _handleDragEnd,
child: widget.frontHeading,
),
),
),
),
],
); );
} }

@ -184,26 +184,6 @@ class _DemoItem extends StatelessWidget {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final bool isDark = theme.brightness == Brightness.dark; final bool isDark = theme.brightness == Brightness.dark;
final double textScaleFactor = MediaQuery.textScaleFactorOf(context); final double textScaleFactor = MediaQuery.textScaleFactorOf(context);
final List<Widget> titleChildren = <Widget>[
Text(
demo.title,
style: theme.textTheme.subhead.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
];
if (demo.subtitle != null) {
titleChildren.add(
Text(
demo.subtitle,
style: theme.textTheme.body1.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)
),
),
);
}
return RawMaterialButton( return RawMaterialButton(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
splashColor: theme.primaryColor.withOpacity(0.12), splashColor: theme.primaryColor.withOpacity(0.12),
@ -229,7 +209,21 @@ class _DemoItem extends StatelessWidget {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: titleChildren, children: <Widget>[
Text(
demo.title,
style: theme.textTheme.subhead.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124),
),
),
if (demo.subtitle != null)
Text(
demo.subtitle,
style: theme.textTheme.body1.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B)
),
),
],
), ),
), ),
const SizedBox(width: 44.0), const SizedBox(width: 44.0),
@ -294,11 +288,11 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
GalleryDemoCategory _category; GalleryDemoCategory _category;
static Widget _topHomeLayout(Widget currentChild, List<Widget> previousChildren) { static Widget _topHomeLayout(Widget currentChild, List<Widget> previousChildren) {
List<Widget> children = previousChildren;
if (currentChild != null)
children = children.toList()..add(currentChild);
return Stack( return Stack(
children: children, children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
); );
} }

@ -425,13 +425,10 @@ class GalleryOptionsPage extends StatelessWidget {
options.showPerformanceOverlay == null) options.showPerformanceOverlay == null)
return const <Widget>[]; return const <Widget>[];
final List<Widget> items = <Widget>[ return <Widget>[
const Divider(), const Divider(),
const _Heading('Diagnostics'), const _Heading('Diagnostics'),
]; if (options.showOffscreenLayersCheckerboard != null)
if (options.showOffscreenLayersCheckerboard != null) {
items.add(
_BooleanItem( _BooleanItem(
'Highlight offscreen layers', 'Highlight offscreen layers',
options.showOffscreenLayersCheckerboard, options.showOffscreenLayersCheckerboard,
@ -439,10 +436,7 @@ class GalleryOptionsPage extends StatelessWidget {
onOptionsChanged(options.copyWith(showOffscreenLayersCheckerboard: value)); onOptionsChanged(options.copyWith(showOffscreenLayersCheckerboard: value));
}, },
), ),
); if (options.showRasterCacheImagesCheckerboard != null)
}
if (options.showRasterCacheImagesCheckerboard != null) {
items.add(
_BooleanItem( _BooleanItem(
'Highlight raster cache images', 'Highlight raster cache images',
options.showRasterCacheImagesCheckerboard, options.showRasterCacheImagesCheckerboard,
@ -450,10 +444,7 @@ class GalleryOptionsPage extends StatelessWidget {
onOptionsChanged(options.copyWith(showRasterCacheImagesCheckerboard: value)); onOptionsChanged(options.copyWith(showRasterCacheImagesCheckerboard: value));
}, },
), ),
); if (options.showPerformanceOverlay != null)
}
if (options.showPerformanceOverlay != null) {
items.add(
_BooleanItem( _BooleanItem(
'Show performance overlay', 'Show performance overlay',
options.showPerformanceOverlay, options.showPerformanceOverlay,
@ -461,10 +452,7 @@ class GalleryOptionsPage extends StatelessWidget {
onOptionsChanged(options.copyWith(showPerformanceOverlay: value)); onOptionsChanged(options.copyWith(showPerformanceOverlay: value));
}, },
), ),
); ];
}
return items;
} }
@override @override

@ -56,7 +56,7 @@ packages:
name: connectivity name: connectivity
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.3+7" version: "0.4.5+1"
convert: convert:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -70,7 +70,7 @@ packages:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.2" version: "2.1.3"
csslib: csslib:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -91,19 +91,24 @@ packages:
name: device_info name: device_info
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.0+2" version: "0.4.1"
file: file:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.8+1" version: "5.1.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_driver:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_gallery_assets: flutter_gallery_assets:
dependency: "direct main" dependency: "direct main"
description: description:
@ -111,6 +116,18 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.9+2" version: "0.1.9+2"
flutter_goldens:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
flutter_goldens_client:
dependency: transitive
description:
path: "../../../flutter/packages/flutter_goldens_client"
relative: true
source: path
version: "0.0.0"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -123,20 +140,25 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.19" version: "0.1.19"
fuchsia_remote_debug_protocol:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
glob: glob:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: glob name: glob
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.7" version: "1.2.0"
html: html:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: html name: html
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.14.0+2" version: "0.14.0+3"
http: http:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -171,7 +193,7 @@ packages:
name: intl name: intl
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.15.8" version: "0.16.0"
io: io:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -228,13 +250,27 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.2"
node_interop:
dependency: "direct dev"
description:
name: node_interop
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
node_io:
dependency: "direct dev"
description:
name: node_io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1+2"
node_preamble: node_preamble:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: node_preamble name: node_preamble
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.6" version: "1.4.8"
package_config: package_config:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -290,7 +326,7 @@ packages:
name: process name: process
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.11" version: "3.0.12"
pub_semver: pub_semver:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -435,7 +471,7 @@ packages:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.1.2" version: "5.2.3"
vector_math: vector_math:
dependency: "direct main" dependency: "direct main"
description: description:
@ -449,7 +485,7 @@ packages:
name: video_player name: video_player
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.10.1+6" version: "0.10.2+5"
vm_service_client: vm_service_client:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -470,7 +506,7 @@ packages:
name: web_socket_channel name: web_socket_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.15" version: "1.1.0"
xml: xml:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -484,7 +520,7 @@ packages:
name: yaml name: yaml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.16" version: "2.2.0"
sdks: sdks:
dart: ">=2.4.0 <3.0.0" dart: ">=2.4.0 <3.0.0"
flutter: ">=1.5.0 <2.0.0" flutter: ">=1.9.1+hotfix.4 <2.0.0"

@ -8,13 +8,13 @@ dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
collection: 1.14.11 collection: 1.14.11
device_info: 0.4.0+2 device_info: 0.4.1
intl: 0.15.8 intl: 0.16.0
connectivity: 0.4.3+7 connectivity: 0.4.5+1
string_scanner: 1.0.5 string_scanner: 1.0.5
url_launcher: 5.1.2 url_launcher: 5.2.3
cupertino_icons: 0.1.2 cupertino_icons: 0.1.2
video_player: 0.10.1+6 video_player: 0.10.2+5
scoped_model: 1.0.1 scoped_model: 1.0.1
shrine_images: 1.1.2 shrine_images: 1.1.2
@ -32,6 +32,10 @@ dependencies:
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_driver:
sdk: flutter
flutter_goldens:
sdk: flutter
test: 1.6.3 test: 1.6.3
analyzer: 0.36.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" analyzer: 0.36.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@ -40,12 +44,12 @@ dev_dependencies:
async: 2.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" async: 2.3.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
boolean_selector: 1.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" boolean_selector: 1.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
convert: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" convert: 2.1.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
crypto: 2.1.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" crypto: 2.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib: 0.16.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" csslib: 0.16.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
file: 5.0.8+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" file: 5.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end: 0.1.19 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" front_end: 0.1.19 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
glob: 1.1.7 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" glob: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
html: 0.14.0+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" html: 0.14.0+3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http: 0.12.0+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" http: 0.12.0+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_multi_server: 2.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" http_multi_server: 2.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_parser: 3.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" http_parser: 3.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@ -57,14 +61,16 @@ dev_dependencies:
matcher: 0.12.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" matcher: 0.12.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
mime: 0.9.6+3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" mime: 0.9.6+3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
multi_server_socket: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" multi_server_socket: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
node_preamble: 1.4.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" node_interop: 1.0.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
node_io: 1.0.1+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
node_preamble: 1.4.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
package_config: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" package_config: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
package_resolver: 1.0.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" package_resolver: 1.0.10 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pedantic: 1.8.0+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" pedantic: 1.8.0+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
petitparser: 2.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" petitparser: 2.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
platform: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" platform: 2.2.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pool: 1.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" pool: 1.4.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
process: 3.0.11 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" process: 3.0.12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pub_semver: 1.4.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" pub_semver: 1.4.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
quiver: 2.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" quiver: 2.0.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
shelf: 0.7.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" shelf: 0.7.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@ -79,9 +85,9 @@ dev_dependencies:
test_core: 0.2.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" test_core: 0.2.5 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
vm_service_client: 0.2.6+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" vm_service_client: 0.2.6+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
watcher: 0.9.7+12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" watcher: 0.9.7+12 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
web_socket_channel: 1.0.15 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" web_socket_channel: 1.1.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
xml: 3.5.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" xml: 3.5.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml: 2.1.16 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade" yaml: 2.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
flutter: flutter:
uses-material-design: true uses-material-design: true
@ -192,7 +198,6 @@ flutter:
- packages/shrine_images/35-0.jpg - packages/shrine_images/35-0.jpg
- packages/shrine_images/36-0.jpg - packages/shrine_images/36-0.jpg
- packages/shrine_images/37-0.jpg - packages/shrine_images/37-0.jpg
- preview.png
fonts: fonts:
- family: Raleway - family: Raleway
@ -244,15 +249,85 @@ flutter:
weight: 400 weight: 400
- family: LibreFranklin - family: LibreFranklin
fonts: fonts:
- asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Bold.ttf - asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Bold.ttf
- asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Light.ttf - asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Light.ttf
- asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Medium.ttf - asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Medium.ttf
- asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Regular.ttf - asset: packages/flutter_gallery_assets/fonts/librefranklin/LibreFranklin-Regular.ttf
- family: Merriweather - family: Merriweather
fonts: fonts:
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-BlackItalic.ttf - asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-BlackItalic.ttf
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Italic.ttf - asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Italic.ttf
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf - asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Regular.ttf
- asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf - asset: packages/flutter_gallery_assets/fonts/merriweather/Merriweather-Light.ttf
# TODO (ryjohn): Find a way to get Cupertino fonts working
- family: .SF Pro Text
fonts:
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-BoldItalic.ttf
weight: 700
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Bold.ttf
weight: 700
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Italic.ttf
weight: 400
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-MediumItalic.ttf
weight: 500
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Medium.ttf
weight: 500
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Regular.ttf
weight: 400
- family: .SF Pro Display
fonts:
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-BoldItalic.ttf
weight: 700
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Bold.ttf
weight: 700
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Italic.ttf
weight: 400
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-MediumItalic.ttf
style: italic
weight: 500
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Medium.ttf
weight: 500
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Regular.ttf
weight: 400
- family: .SF UI Text
fonts:
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-BoldItalic.ttf
weight: 700
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Bold.ttf
weight: 700
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Italic.ttf
weight: 400
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-MediumItalic.ttf
weight: 500
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Medium.ttf
weight: 500
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSans-Regular.ttf
weight: 400
- family: .SF UI Display
fonts:
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-BoldItalic.ttf
weight: 700
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Bold.ttf
weight: 700
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Italic.ttf
weight: 400
style: italic
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-MediumItalic.ttf
style: italic
weight: 500
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Medium.ttf
weight: 500
- asset: packages/flutter_gallery_assets/fonts/private/googlesans/GoogleSansDisplay-Regular.ttf
weight: 400
# PUBSPEC CHECKSUM: ba0e # PUBSPEC CHECKSUM: 76b5

@ -1,60 +0,0 @@
// Copyright 2018 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/material.dart';
import 'package:flutter_gallery/demo/material/text_form_field_demo.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('validates name field correctly', (WidgetTester tester) async {
await tester.pumpWidget(const MaterialApp(home: TextFormFieldDemo()));
final Finder submitButton = find.widgetWithText(RaisedButton, 'SUBMIT');
expect(submitButton, findsOneWidget);
final Finder nameField = find.widgetWithText(TextFormField, 'Name * ');
expect(nameField, findsOneWidget);
final Finder passwordField =
find.widgetWithText(TextFormField, 'Password *');
expect(passwordField, findsOneWidget);
await tester.enterText(nameField, '');
await tester.pumpAndSettle();
// The submit button isn't initially visible. Drag it into view so that
// it will see the tap.
await tester.drag(nameField, const Offset(0.0, -1200.0));
await tester.pumpAndSettle();
await tester.tap(submitButton);
await tester.pumpAndSettle();
// Now drag the password field (the submit button will be obscured by
// the snackbar) and expose the name field again.
await tester.drag(passwordField, const Offset(0.0, 1200.0));
await tester.pumpAndSettle();
expect(find.text('Name is required.'), findsOneWidget);
expect(
find.text('Please enter only alphabetical characters.'), findsNothing);
await tester.enterText(nameField, '#');
await tester.pumpAndSettle();
// Make the submit button visible again (by dragging the name field), so
// it will see the tap.
await tester.drag(nameField, const Offset(0.0, -1200.0));
await tester.tap(submitButton);
await tester.pumpAndSettle();
expect(find.text('Name is required.'), findsNothing);
expect(find.text('Please enter only alphabetical characters.'),
findsOneWidget);
await tester.enterText(nameField, 'Jane Doe');
// TODO(b/123539399): Why does it pass in Flutter without this `drag`?
await tester.drag(nameField, const Offset(0.0, -1200.0));
await tester.tap(submitButton);
await tester.pumpAndSettle();
expect(find.text('Name is required.'), findsNothing);
expect(
find.text('Please enter only alphabetical characters.'), findsNothing);
});
}

@ -1,12 +0,0 @@
// Copyright 2018 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_test/flutter_test.dart';
import 'package:flutter_gallery/gallery/app.dart';
void main() {
testWidgets('Gallery starts', (WidgetTester tester) async {
await tester.pumpWidget(GalleryApp());
});
}

@ -1,10 +1,12 @@
<!-- Copyright 2019 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. -->
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <title>Flutter Gallery</title>
<title>gallery</title> </head>
</head> <body>
<body> <script src="main.dart.js"></script>
<script src="main.dart.js" type="application/javascript"></script> </body>
</body> </html>
</html>
Loading…
Cancel
Save