mirror of
https://github.com/flutter/samples.git
synced 2025-11-11 07:18:15 +00:00
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
This commit is contained in:
73
web/gallery/.gitignore
vendored
73
web/gallery/.gitignore
vendored
@@ -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/#/
|
||||||
|
|||||||
8
web/gallery/analysis_options.yaml
Normal file
8
web/gallery/analysis_options.yaml
Normal file
@@ -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();
|
return MergeSemantics(
|
||||||
columnChildren.add(Text(lines.last, style: themeData.textTheme.caption));
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||||
final List<Widget> rowChildren = <Widget>[
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: columnChildren,
|
children: <Widget>[
|
||||||
|
...lines.sublist(0, lines.length - 1).map<Widget>((String line) => Text(line)),
|
||||||
|
Text(lines.last, style: themeData.textTheme.caption),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
];
|
if (icon != null)
|
||||||
if (icon != null) {
|
SizedBox(
|
||||||
rowChildren.add(SizedBox(
|
|
||||||
width: 72.0,
|
width: 72.0,
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
icon: Icon(icon),
|
icon: Icon(icon),
|
||||||
color: themeData.primaryColor,
|
color: themeData.primaryColor,
|
||||||
onPressed: onPressed,
|
onPressed: onPressed,
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
}
|
],
|
||||||
return MergeSemantics(
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: rowChildren,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ 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>[
|
return Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: <Widget>[
|
||||||
CupertinoScrollbar(
|
CupertinoScrollbar(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
// Add more padding to the normal safe area.
|
// Add more padding to the normal safe area.
|
||||||
@@ -62,75 +64,19 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CupertinoButton.filled(
|
CupertinoButton.filled(
|
||||||
child: const Text('Alert'),
|
child: const Text('Alert'),
|
||||||
onPressed: () {
|
onPressed: () => _onAlertPress(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');
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.all(8.0)),
|
const Padding(padding: EdgeInsets.all(8.0)),
|
||||||
CupertinoButton.filled(
|
CupertinoButton.filled(
|
||||||
child: const Text('Alert with Title'),
|
child: const Text('Alert with Title'),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||||
onPressed: () {
|
onPressed: () => _onAlertWithTitlePress(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');
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.all(8.0)),
|
const Padding(padding: EdgeInsets.all(8.0)),
|
||||||
CupertinoButton.filled(
|
CupertinoButton.filled(
|
||||||
child: const Text('Alert with Buttons'),
|
child: const Text('Alert with Buttons'),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||||
onPressed: () {
|
onPressed: () => _onAlertWithButtonsPress(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.'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.all(8.0)),
|
const Padding(padding: EdgeInsets.all(8.0)),
|
||||||
CupertinoButton.filled(
|
CupertinoButton.filled(
|
||||||
@@ -147,7 +93,79 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||||||
CupertinoButton.filled(
|
CupertinoButton.filled(
|
||||||
child: const Text('Action Sheet'),
|
child: const Text('Action Sheet'),
|
||||||
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
padding: const EdgeInsets.symmetric(vertical: 16.0, horizontal: 36.0),
|
||||||
onPressed: () {
|
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(
|
showDemoActionSheet(
|
||||||
context: context,
|
context: context,
|
||||||
child: CupertinoActionSheet(
|
child: CupertinoActionSheet(
|
||||||
@@ -156,52 +174,21 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
|||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
child: const Text('Profiteroles'),
|
child: const Text('Profiteroles'),
|
||||||
onPressed: () {
|
onPressed: () => Navigator.pop(context, 'Profiteroles'),
|
||||||
Navigator.pop(context, 'Profiteroles');
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
child: const Text('Cannolis'),
|
child: const Text('Cannolis'),
|
||||||
onPressed: () {
|
onPressed: () => Navigator.pop(context, 'Cannolis'),
|
||||||
Navigator.pop(context, 'Cannolis');
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
CupertinoActionSheetAction(
|
CupertinoActionSheetAction(
|
||||||
child: const Text('Trifle'),
|
child: const Text('Trifle'),
|
||||||
onPressed: () {
|
onPressed: () => Navigator.pop(context, 'Trifle'),
|
||||||
Navigator.pop(context, 'Trifle');
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
cancelButton: CupertinoActionSheetAction(
|
cancelButton: CupertinoActionSheetAction(
|
||||||
child: const Text('Cancel'),
|
child: const Text('Cancel'),
|
||||||
isDefaultAction: true,
|
isDefaultAction: true,
|
||||||
onPressed: () {
|
onPressed: () => Navigator.pop(context, 'Cancel'),
|
||||||
Navigator.pop(context, 'Cancel');
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
];
|
|
||||||
|
|
||||||
if (lastSelectedValue != null) {
|
|
||||||
stackChildren.add(
|
|
||||||
Positioned(
|
|
||||||
bottom: 32.0,
|
|
||||||
child: Text('You selected: $lastSelectedValue'),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return Stack(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
children: stackChildren,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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(
|
return SafeArea(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
|
if (avatar != null) avatar,
|
||||||
Tab2ConversationBubble(
|
Tab2ConversationBubble(
|
||||||
text: text,
|
text: text,
|
||||||
color: isSelf
|
color: isSelf
|
||||||
? Tab2ConversationBubbleColor.blue
|
? Tab2ConversationBubbleColor.blue
|
||||||
: Tab2ConversationBubbleColor.gray,
|
: Tab2ConversationBubbleColor.gray,
|
||||||
),
|
),
|
||||||
);
|
],
|
||||||
return SafeArea(
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: isSelf ? MainAxisAlignment.end : MainAxisAlignment.start,
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: isSelf ? CrossAxisAlignment.center : CrossAxisAlignment.end,
|
|
||||||
children: children,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,7 +262,9 @@ 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(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
// Photo and title.
|
// Photo and title.
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 184.0,
|
height: 184.0,
|
||||||
@@ -319,10 +321,7 @@ class TravelDestinationContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
];
|
if (destination.type == CardDemoType.standard)
|
||||||
|
|
||||||
if (destination.type == CardDemoType.standard) {
|
|
||||||
children.add(
|
|
||||||
// share, explore buttons
|
// share, explore buttons
|
||||||
ButtonBar(
|
ButtonBar(
|
||||||
alignment: MainAxisAlignment.start,
|
alignment: MainAxisAlignment.start,
|
||||||
@@ -339,12 +338,7 @@ class TravelDestinationContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
],
|
||||||
}
|
|
||||||
|
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: children,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>[
|
return Card(
|
||||||
|
semanticContainer: false,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.only(top: 16.0, bottom: 4.0),
|
padding: const EdgeInsets.only(top: 16.0, bottom: 4.0),
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Text(label, textAlign: TextAlign.start),
|
child: Text(label, textAlign: TextAlign.start),
|
||||||
),
|
),
|
||||||
];
|
if (children.isNotEmpty)
|
||||||
if (children.isNotEmpty) {
|
Wrap(
|
||||||
cardChildren.add(Wrap(
|
|
||||||
children: children.map<Widget>((Widget chip) {
|
children: children.map<Widget>((Widget chip) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(2.0),
|
padding: const EdgeInsets.all(2.0),
|
||||||
child: chip,
|
child: chip,
|
||||||
);
|
);
|
||||||
}).toList()));
|
}).toList(),
|
||||||
} else {
|
)
|
||||||
final TextStyle textStyle = Theme.of(context).textTheme.caption.copyWith(fontStyle: FontStyle.italic);
|
else
|
||||||
cardChildren.add(
|
|
||||||
Semantics(
|
Semantics(
|
||||||
container: true,
|
container: true,
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
constraints: const BoxConstraints(minWidth: 48.0, minHeight: 48.0),
|
constraints: const BoxConstraints(minWidth: 48.0, minHeight: 48.0),
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Text('None', style: textStyle),
|
child: Text('None', style: Theme.of(context).textTheme.caption.copyWith(fontStyle: FontStyle.italic)),
|
||||||
),
|
),
|
||||||
));
|
),
|
||||||
}
|
],
|
||||||
|
|
||||||
return Card(
|
|
||||||
semanticContainer: false,
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: cardChildren,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,16 +245,20 @@ class _LeaveBehindListItem extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
background: Container(
|
background: Container(
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
child: const ListTile(
|
child: const Center(
|
||||||
|
child: ListTile(
|
||||||
leading: Icon(Icons.delete, color: Colors.white, size: 36.0),
|
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(
|
||||||
|
child: ListTile(
|
||||||
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0),
|
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.canvasColor,
|
color: theme.canvasColor,
|
||||||
|
|||||||
@@ -204,15 +204,16 @@ 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
|
||||||
|
IconButton(
|
||||||
tooltip: 'Clear',
|
tooltip: 'Clear',
|
||||||
icon: const Icon(Icons.clear),
|
icon: const Icon(Icons.clear),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
|||||||
@@ -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,14 +334,22 @@ 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: _TappableWhileStatusIs(
|
||||||
|
AnimationStatus.completed,
|
||||||
|
controller: _controller,
|
||||||
child: widget.frontLayer,
|
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,7 +147,15 @@ class _BackAppBar extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final List<Widget> children = <Widget>[
|
final ThemeData theme = Theme.of(context);
|
||||||
|
return IconTheme.merge(
|
||||||
|
data: theme.primaryIconTheme,
|
||||||
|
child: DefaultTextStyle(
|
||||||
|
style: theme.primaryTextTheme.title,
|
||||||
|
child: SizedBox(
|
||||||
|
height: _kBackAppBarHeight,
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
width: 56.0,
|
width: 56.0,
|
||||||
@@ -147,27 +164,14 @@ class _BackAppBar extends StatelessWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: title,
|
child: title,
|
||||||
),
|
),
|
||||||
];
|
if (trailing != null)
|
||||||
|
|
||||||
if (trailing != null) {
|
|
||||||
children.add(
|
|
||||||
Container(
|
Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
width: 56.0,
|
width: 56.0,
|
||||||
child: trailing,
|
child: trailing,
|
||||||
),
|
),
|
||||||
);
|
],
|
||||||
}
|
),
|
||||||
|
|
||||||
final ThemeData theme = Theme.of(context);
|
|
||||||
|
|
||||||
return IconTheme.merge(
|
|
||||||
data: theme.primaryIconTheme,
|
|
||||||
child: DefaultTextStyle(
|
|
||||||
style: theme.primaryTextTheme.title,
|
|
||||||
child: SizedBox(
|
|
||||||
height: _kBackAppBarHeight,
|
|
||||||
child: Row(children: children),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -255,8 +259,9 @@ 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,
|
||||||
|
children: <Widget>[
|
||||||
// Back layer
|
// Back layer
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
@@ -279,12 +284,16 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: _TappableWhileStatusIs(
|
||||||
|
AnimationStatus.dismissed,
|
||||||
|
controller: _controller,
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
child: widget.backLayer,
|
child: widget.backLayer,
|
||||||
visible: _controller.status != AnimationStatus.completed,
|
visible: _controller.status != AnimationStatus.completed,
|
||||||
maintainState: true,
|
maintainState: true,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// Front layer
|
// Front layer
|
||||||
@@ -315,14 +324,11 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
];
|
|
||||||
|
|
||||||
// The front "heading" is a (typically transparent) widget that's stacked on
|
// 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
|
// 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
|
// 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.
|
// with a tap. It may obscure part of the front layer's topmost child.
|
||||||
if (widget.frontHeading != null) {
|
if (widget.frontHeading != null)
|
||||||
layers.add(
|
|
||||||
PositionedTransition(
|
PositionedTransition(
|
||||||
rect: frontRelativeRect,
|
rect: frontRelativeRect,
|
||||||
child: ExcludeSemantics(
|
child: ExcludeSemantics(
|
||||||
@@ -338,12 +344,7 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
],
|
||||||
}
|
|
||||||
|
|
||||||
return Stack(
|
|
||||||
key: _backdropKey,
|
|
||||||
children: layers,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -254,5 +259,75 @@ flutter:
|
|||||||
- 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" type="application/javascript"></script>
|
<script src="main.dart.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user