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);
|
||||
}
|
||||
}
|
||||
final List<ExpressionToken> outList = <ExpressionToken>[];
|
||||
outList.add(ResultToken(currentTermValue));
|
||||
final List<ExpressionToken> outList = <ExpressionToken>[
|
||||
ResultToken(currentTermValue),
|
||||
];
|
||||
return CalcExpression(outList, ExpressionState.Result);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class PaletteTabView extends StatelessWidget {
|
||||
);
|
||||
}),
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,33 +54,31 @@ class _ContactItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext 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>[
|
||||
return MergeSemantics(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: Column(
|
||||
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) {
|
||||
rowChildren.add(SizedBox(
|
||||
if (icon != null)
|
||||
SizedBox(
|
||||
width: 72.0,
|
||||
child: IconButton(
|
||||
icon: Icon(icon),
|
||||
color: themeData.primaryColor,
|
||||
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,
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
final List<Widget> stackChildren = <Widget>[
|
||||
return Stack(
|
||||
alignment: Alignment.center,
|
||||
children: <Widget>[
|
||||
CupertinoScrollbar(
|
||||
child: ListView(
|
||||
// Add more padding to the normal safe area.
|
||||
@@ -62,75 +64,19 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
||||
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');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
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: () {
|
||||
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');
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
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: () {
|
||||
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.'),
|
||||
),
|
||||
);
|
||||
},
|
||||
onPressed: () => _onAlertWithButtonsPress(context),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(8.0)),
|
||||
CupertinoButton.filled(
|
||||
@@ -147,7 +93,79 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
||||
CupertinoButton.filled(
|
||||
child: const Text('Action Sheet'),
|
||||
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(
|
||||
context: context,
|
||||
child: CupertinoActionSheet(
|
||||
@@ -156,52 +174,21 @@ class _CupertinoAlertDemoState extends State<CupertinoAlertDemo> {
|
||||
actions: <Widget>[
|
||||
CupertinoActionSheetAction(
|
||||
child: const Text('Profiteroles'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, 'Profiteroles');
|
||||
},
|
||||
onPressed: () => Navigator.pop(context, 'Profiteroles'),
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
child: const Text('Cannolis'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, 'Cannolis');
|
||||
},
|
||||
onPressed: () => Navigator.pop(context, 'Cannolis'),
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
child: const Text('Trifle'),
|
||||
onPressed: () {
|
||||
Navigator.pop(context, '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(
|
||||
alignment: Alignment.center,
|
||||
children: stackChildren,
|
||||
);
|
||||
},
|
||||
onPressed: () => Navigator.pop(context, 'Cancel'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -647,25 +647,21 @@ class Tab2ConversationRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final List<Widget> children = <Widget>[];
|
||||
if (avatar != null)
|
||||
children.add(avatar);
|
||||
|
||||
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(
|
||||
text: text,
|
||||
color: isSelf
|
||||
? Tab2ConversationBubbleColor.blue
|
||||
: 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),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
CircleAvatar(
|
||||
const CircleAvatar(
|
||||
backgroundImage: ExactAssetImage(
|
||||
'people/square/trevor.png',
|
||||
package: 'flutter_gallery_assets',
|
||||
|
||||
@@ -140,7 +140,7 @@ class CategoryView extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class _BannerDemoState extends State<BannerDemo> {
|
||||
setState(() {
|
||||
_displayBanner = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
if (_showMultipleActions)
|
||||
FlatButton(
|
||||
@@ -66,7 +66,7 @@ class _BannerDemoState extends State<BannerDemo> {
|
||||
setState(() {
|
||||
_displayBanner = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -164,10 +164,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
|
||||
}
|
||||
|
||||
Widget _buildTransitionsStack() {
|
||||
final List<FadeTransition> transitions = <FadeTransition>[];
|
||||
|
||||
for (NavigationIconView view in _navigationViews)
|
||||
transitions.add(view.transition(_type, context));
|
||||
final List<FadeTransition> transitions = <FadeTransition>[
|
||||
for (NavigationIconView view in _navigationViews) view.transition(_type, context),
|
||||
];
|
||||
|
||||
// We want to have the newly animating (fading in) views on top.
|
||||
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 descriptionStyle = theme.textTheme.subhead;
|
||||
|
||||
final List<Widget> children = <Widget>[
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
// Photo and title.
|
||||
SizedBox(
|
||||
height: 184.0,
|
||||
@@ -319,10 +321,7 @@ class TravelDestinationContent extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
if (destination.type == CardDemoType.standard) {
|
||||
children.add(
|
||||
if (destination.type == CardDemoType.standard)
|
||||
// share, explore buttons
|
||||
ButtonBar(
|
||||
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.
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final List<Widget> cardChildren = <Widget>[
|
||||
return Card(
|
||||
semanticContainer: false,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
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) {
|
||||
cardChildren.add(Wrap(
|
||||
if (children.isNotEmpty)
|
||||
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(
|
||||
}).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: 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(
|
||||
color: theme.primaryColor,
|
||||
child: const ListTile(
|
||||
child: const Center(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.delete, color: Colors.white, size: 36.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
secondaryBackground: Container(
|
||||
color: theme.primaryColor,
|
||||
child: const ListTile(
|
||||
child: const Center(
|
||||
child: ListTile(
|
||||
trailing: Icon(Icons.archive, color: Colors.white, size: 36.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.canvasColor,
|
||||
|
||||
@@ -204,15 +204,16 @@ class _SearchDemoSearchDelegate extends SearchDelegate<int> {
|
||||
@override
|
||||
List<Widget> buildActions(BuildContext context) {
|
||||
return <Widget>[
|
||||
query.isEmpty
|
||||
? IconButton(
|
||||
if (query.isEmpty)
|
||||
IconButton(
|
||||
tooltip: 'Voice Search',
|
||||
icon: const Icon(Icons.mic),
|
||||
onPressed: () {
|
||||
query = 'TODO: implement voice input';
|
||||
},
|
||||
)
|
||||
: IconButton(
|
||||
else
|
||||
IconButton(
|
||||
tooltip: 'Clear',
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () {
|
||||
|
||||
@@ -88,7 +88,7 @@ class _SnackBarDemoState extends State<SnackBarDemo> {
|
||||
tooltip: 'Create',
|
||||
onPressed: () {
|
||||
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 _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 {
|
||||
const _FrontLayer({
|
||||
Key key,
|
||||
@@ -275,14 +334,22 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
||||
return Stack(
|
||||
key: _backdropKey,
|
||||
children: <Widget>[
|
||||
widget.backLayer,
|
||||
_TappableWhileStatusIs(
|
||||
AnimationStatus.dismissed,
|
||||
controller: _controller,
|
||||
child: widget.backLayer,
|
||||
),
|
||||
PositionedTransition(
|
||||
rect: _layerAnimation,
|
||||
child: _FrontLayer(
|
||||
onTap: _toggleBackdropLayerVisibility,
|
||||
child: _TappableWhileStatusIs(
|
||||
AnimationStatus.completed,
|
||||
controller: _controller,
|
||||
child: widget.frontLayer,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ class TypographyDemo extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||
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 2', style: textTheme.display2, text: 'Regular 45sp'),
|
||||
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'),
|
||||
];
|
||||
|
||||
if (MediaQuery.of(context).size.width > 500.0) {
|
||||
styleItems.insert(0, TextStyleItem(
|
||||
name: 'Display 4',
|
||||
style: textTheme.display4,
|
||||
text: 'Light 112sp',
|
||||
));
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Typography')),
|
||||
body: SafeArea(
|
||||
|
||||
@@ -66,10 +66,19 @@ class _TappableWhileStatusIsState extends State<_TappableWhileStatusIs> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AbsorbPointer(
|
||||
Widget child = AbsorbPointer(
|
||||
absorbing: !_active,
|
||||
child: widget.child,
|
||||
);
|
||||
|
||||
if (!_active) {
|
||||
child = FocusScope(
|
||||
canRequestFocus: false,
|
||||
debugLabel: '$_TappableWhileStatusIs',
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +147,15 @@ class _BackAppBar extends StatelessWidget {
|
||||
|
||||
@override
|
||||
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(
|
||||
alignment: Alignment.center,
|
||||
width: 56.0,
|
||||
@@ -147,27 +164,14 @@ class _BackAppBar extends StatelessWidget {
|
||||
Expanded(
|
||||
child: title,
|
||||
),
|
||||
];
|
||||
|
||||
if (trailing != null) {
|
||||
children.add(
|
||||
if (trailing != null)
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
width: 56.0,
|
||||
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),
|
||||
end: const RelativeRect.fromLTRB(0.0, _kBackAppBarHeight, 0.0, 0.0),
|
||||
));
|
||||
|
||||
final List<Widget> layers = <Widget>[
|
||||
return Stack(
|
||||
key: _backdropKey,
|
||||
children: <Widget>[
|
||||
// Back layer
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -279,12 +284,16 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: _TappableWhileStatusIs(
|
||||
AnimationStatus.dismissed,
|
||||
controller: _controller,
|
||||
child: Visibility(
|
||||
child: widget.backLayer,
|
||||
visible: _controller.status != AnimationStatus.completed,
|
||||
maintainState: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// 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
|
||||
// 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(
|
||||
if (widget.frontHeading != null)
|
||||
PositionedTransition(
|
||||
rect: frontRelativeRect,
|
||||
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 bool isDark = theme.brightness == Brightness.dark;
|
||||
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(
|
||||
padding: EdgeInsets.zero,
|
||||
splashColor: theme.primaryColor.withOpacity(0.12),
|
||||
@@ -229,7 +209,21 @@ class _DemoItem extends StatelessWidget {
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
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),
|
||||
@@ -294,11 +288,11 @@ class _GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStat
|
||||
GalleryDemoCategory _category;
|
||||
|
||||
static Widget _topHomeLayout(Widget currentChild, List<Widget> previousChildren) {
|
||||
List<Widget> children = previousChildren;
|
||||
if (currentChild != null)
|
||||
children = children.toList()..add(currentChild);
|
||||
return Stack(
|
||||
children: children,
|
||||
children: <Widget>[
|
||||
...previousChildren,
|
||||
if (currentChild != null) currentChild,
|
||||
],
|
||||
alignment: Alignment.topCenter,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -425,13 +425,10 @@ class GalleryOptionsPage extends StatelessWidget {
|
||||
options.showPerformanceOverlay == null)
|
||||
return const <Widget>[];
|
||||
|
||||
final List<Widget> items = <Widget>[
|
||||
return <Widget>[
|
||||
const Divider(),
|
||||
const _Heading('Diagnostics'),
|
||||
];
|
||||
|
||||
if (options.showOffscreenLayersCheckerboard != null) {
|
||||
items.add(
|
||||
if (options.showOffscreenLayersCheckerboard != null)
|
||||
_BooleanItem(
|
||||
'Highlight offscreen layers',
|
||||
options.showOffscreenLayersCheckerboard,
|
||||
@@ -439,10 +436,7 @@ class GalleryOptionsPage extends StatelessWidget {
|
||||
onOptionsChanged(options.copyWith(showOffscreenLayersCheckerboard: value));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
if (options.showRasterCacheImagesCheckerboard != null) {
|
||||
items.add(
|
||||
if (options.showRasterCacheImagesCheckerboard != null)
|
||||
_BooleanItem(
|
||||
'Highlight raster cache images',
|
||||
options.showRasterCacheImagesCheckerboard,
|
||||
@@ -450,10 +444,7 @@ class GalleryOptionsPage extends StatelessWidget {
|
||||
onOptionsChanged(options.copyWith(showRasterCacheImagesCheckerboard: value));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
if (options.showPerformanceOverlay != null) {
|
||||
items.add(
|
||||
if (options.showPerformanceOverlay != null)
|
||||
_BooleanItem(
|
||||
'Show performance overlay',
|
||||
options.showPerformanceOverlay,
|
||||
@@ -461,10 +452,7 @@ class GalleryOptionsPage extends StatelessWidget {
|
||||
onOptionsChanged(options.copyWith(showPerformanceOverlay: value));
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return items;
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -56,7 +56,7 @@ packages:
|
||||
name: connectivity
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.3+7"
|
||||
version: "0.4.5+1"
|
||||
convert:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -70,7 +70,7 @@ packages:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.3"
|
||||
csslib:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -91,19 +91,24 @@ packages:
|
||||
name: device_info
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.0+2"
|
||||
version: "0.4.1"
|
||||
file:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: file
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.0.8+1"
|
||||
version: "5.1.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_driver:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_gallery_assets:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -111,6 +116,18 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -123,20 +140,25 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.19"
|
||||
fuchsia_remote_debug_protocol:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
glob:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.7"
|
||||
version: "1.2.0"
|
||||
html:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: html
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.14.0+2"
|
||||
version: "0.14.0+3"
|
||||
http:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -171,7 +193,7 @@ packages:
|
||||
name: intl
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.15.8"
|
||||
version: "0.16.0"
|
||||
io:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -228,13 +250,27 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
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:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: node_preamble
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.6"
|
||||
version: "1.4.8"
|
||||
package_config:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -290,7 +326,7 @@ packages:
|
||||
name: process
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.11"
|
||||
version: "3.0.12"
|
||||
pub_semver:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -435,7 +471,7 @@ packages:
|
||||
name: url_launcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "5.1.2"
|
||||
version: "5.2.3"
|
||||
vector_math:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -449,7 +485,7 @@ packages:
|
||||
name: video_player
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.10.1+6"
|
||||
version: "0.10.2+5"
|
||||
vm_service_client:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -470,7 +506,7 @@ packages:
|
||||
name: web_socket_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.15"
|
||||
version: "1.1.0"
|
||||
xml:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@@ -484,7 +520,7 @@ packages:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.16"
|
||||
version: "2.2.0"
|
||||
sdks:
|
||||
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:
|
||||
sdk: flutter
|
||||
collection: 1.14.11
|
||||
device_info: 0.4.0+2
|
||||
intl: 0.15.8
|
||||
connectivity: 0.4.3+7
|
||||
device_info: 0.4.1
|
||||
intl: 0.16.0
|
||||
connectivity: 0.4.5+1
|
||||
string_scanner: 1.0.5
|
||||
url_launcher: 5.1.2
|
||||
url_launcher: 5.2.3
|
||||
cupertino_icons: 0.1.2
|
||||
video_player: 0.10.1+6
|
||||
video_player: 0.10.2+5
|
||||
scoped_model: 1.0.1
|
||||
shrine_images: 1.1.2
|
||||
|
||||
@@ -32,6 +32,10 @@ dependencies:
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_driver:
|
||||
sdk: flutter
|
||||
flutter_goldens:
|
||||
sdk: flutter
|
||||
test: 1.6.3
|
||||
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
glob: 1.1.7 # 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"
|
||||
glob: 1.2.0 # 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_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"
|
||||
@@ -57,14 +61,16 @@ dev_dependencies:
|
||||
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"
|
||||
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_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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
@@ -79,9 +85,9 @@ dev_dependencies:
|
||||
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"
|
||||
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"
|
||||
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:
|
||||
uses-material-design: true
|
||||
@@ -192,7 +198,6 @@ flutter:
|
||||
- packages/shrine_images/35-0.jpg
|
||||
- packages/shrine_images/36-0.jpg
|
||||
- packages/shrine_images/37-0.jpg
|
||||
- preview.png
|
||||
|
||||
fonts:
|
||||
- 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-Regular.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>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>gallery</title>
|
||||
<title>Flutter Gallery</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="main.dart.js" type="application/javascript"></script>
|
||||
<script src="main.dart.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user