This reverts commit 5fd259be24.
This commit is contained in:
@@ -32,12 +32,14 @@ class _TextFieldPageState extends State<TextFieldPage> {
|
||||
TextField(
|
||||
key: normalTextFieldKey,
|
||||
controller: _normalController,
|
||||
autofocus: false,
|
||||
),
|
||||
const Spacer(),
|
||||
TextField(
|
||||
key: passwordTextFieldKey,
|
||||
controller: _passwordController,
|
||||
obscureText: true,
|
||||
autofocus: false,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -227,7 +227,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
||||
setState(() {});
|
||||
break;
|
||||
}
|
||||
return Future<dynamic>.value();
|
||||
return Future<dynamic>.value(null);
|
||||
}
|
||||
|
||||
Future<dynamic> onViewMethodChannelCall(MethodCall call) {
|
||||
@@ -240,7 +240,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
||||
setState(() {});
|
||||
break;
|
||||
}
|
||||
return Future<dynamic>.value();
|
||||
return Future<dynamic>.value(null);
|
||||
}
|
||||
|
||||
Widget buildEventTile(BuildContext context, int index) {
|
||||
|
||||
@@ -10,7 +10,8 @@ import 'test_step.dart';
|
||||
Future<TestStepResult> methodCallJsonSuccessHandshake(dynamic payload) async {
|
||||
const MethodChannel channel =
|
||||
MethodChannel('json-method', JSONMethodCodec());
|
||||
return _methodCallSuccessHandshake('JSON success($payload)', channel, payload);
|
||||
return _methodCallSuccessHandshake(
|
||||
'JSON success($payload)', channel, payload);
|
||||
}
|
||||
|
||||
Future<TestStepResult> methodCallJsonErrorHandshake(dynamic payload) async {
|
||||
@@ -31,7 +32,8 @@ Future<TestStepResult> methodCallStandardSuccessHandshake(
|
||||
'std-method',
|
||||
StandardMethodCodec(ExtendedStandardMessageCodec()),
|
||||
);
|
||||
return _methodCallSuccessHandshake('Standard success($payload)', channel, payload);
|
||||
return _methodCallSuccessHandshake(
|
||||
'Standard success($payload)', channel, payload);
|
||||
}
|
||||
|
||||
Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
|
||||
@@ -39,7 +41,8 @@ Future<TestStepResult> methodCallStandardErrorHandshake(dynamic payload) async {
|
||||
'std-method',
|
||||
StandardMethodCodec(ExtendedStandardMessageCodec()),
|
||||
);
|
||||
return _methodCallErrorHandshake('Standard error($payload)', channel, payload);
|
||||
return _methodCallErrorHandshake(
|
||||
'Standard error($payload)', channel, payload);
|
||||
}
|
||||
|
||||
Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
|
||||
@@ -47,7 +50,8 @@ Future<TestStepResult> methodCallStandardNotImplementedHandshake() async {
|
||||
'std-method',
|
||||
StandardMethodCodec(ExtendedStandardMessageCodec()),
|
||||
);
|
||||
return _methodCallNotImplementedHandshake('Standard notImplemented()', channel);
|
||||
return _methodCallNotImplementedHandshake(
|
||||
'Standard notImplemented()', channel);
|
||||
}
|
||||
|
||||
Future<TestStepResult> _methodCallSuccessHandshake(
|
||||
@@ -85,7 +89,8 @@ Future<TestStepResult> _methodCallErrorHandshake(
|
||||
final List<dynamic> received = <dynamic>[];
|
||||
channel.setMethodCallHandler((MethodCall call) async {
|
||||
received.add(call.arguments);
|
||||
throw PlatformException(code: 'error', details: arguments);
|
||||
throw PlatformException(
|
||||
code: 'error', message: null, details: arguments);
|
||||
});
|
||||
dynamic errorDetails = nothing;
|
||||
dynamic error = nothing;
|
||||
|
||||
@@ -23,6 +23,8 @@ class SectionCard extends StatelessWidget {
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: <Color>[
|
||||
section.leftColor!,
|
||||
section.rightColor!,
|
||||
@@ -130,6 +132,7 @@ class SectionDetailView extends StatelessWidget {
|
||||
package: detail.imageAssetPackage,
|
||||
),
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -136,7 +136,7 @@ class CalcExpression {
|
||||
/// in the calculator's display panel.
|
||||
@override
|
||||
String toString() {
|
||||
final StringBuffer buffer = StringBuffer();
|
||||
final StringBuffer buffer = StringBuffer('');
|
||||
buffer.writeAll(_list);
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ class ColorItem extends StatelessWidget {
|
||||
bottom: false,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text('$prefix$index'),
|
||||
Text(colorString()),
|
||||
|
||||
@@ -327,6 +327,7 @@ class Tab1ItemPageState extends State<Tab1ItemPage> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 128.0,
|
||||
|
||||
@@ -247,6 +247,7 @@ class _CupertinoPickerDemoState extends State<CupertinoPickerDemo> {
|
||||
return _BottomPicker(
|
||||
child: CupertinoDatePicker(
|
||||
backgroundColor: CupertinoColors.systemBackground.resolveFrom(context),
|
||||
mode: CupertinoDatePickerMode.dateAndTime,
|
||||
initialDateTime: dateTime,
|
||||
onDateTimeChanged: (DateTime newDateTime) {
|
||||
setState(() => dateTime = newDateTime);
|
||||
|
||||
@@ -117,11 +117,13 @@ class _CupertinoSegmentedControlDemoState extends State<CupertinoSegmentedContro
|
||||
BoxShadow(
|
||||
offset: Offset(0.0, 6.0),
|
||||
blurRadius: 10.0,
|
||||
spreadRadius: 0.0,
|
||||
color: _kKeyPenumbraOpacity,
|
||||
),
|
||||
BoxShadow(
|
||||
offset: Offset(0.0, 1.0),
|
||||
blurRadius: 18.0,
|
||||
spreadRadius: 0.0,
|
||||
color: _kAmbientShadowOpacity,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -42,6 +42,7 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
|
||||
children: <Widget> [
|
||||
CupertinoSlider(
|
||||
value: _value,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
@@ -57,6 +58,7 @@ class _CupertinoSliderDemoState extends State<CupertinoSliderDemo> {
|
||||
children: <Widget> [
|
||||
CupertinoSlider(
|
||||
value: _discreteValue,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
divisions: 5,
|
||||
onChanged: (double value) {
|
||||
|
||||
@@ -27,6 +27,7 @@ class _BottomAppBarDemoState extends State<BottomAppBarDemo> {
|
||||
static const _ChoiceValue<Widget> kNoFab = _ChoiceValue<Widget>(
|
||||
title: 'None',
|
||||
label: 'do not show a floating action button',
|
||||
value: null,
|
||||
);
|
||||
|
||||
static const _ChoiceValue<Widget> kCircularFab = _ChoiceValue<Widget>(
|
||||
|
||||
@@ -275,6 +275,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
ListTile(
|
||||
title: const Text('Simple dropdown:'),
|
||||
|
||||
@@ -344,7 +344,7 @@ class _ChipDemoState extends State<ChipDemo> {
|
||||
data: _showShapeBorder
|
||||
? theme.chipTheme.copyWith(
|
||||
shape: BeveledRectangleBorder(
|
||||
side: const BorderSide(width: 0.66, color: Colors.grey),
|
||||
side: const BorderSide(width: 0.66, style: BorderStyle.solid, color: Colors.grey),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
))
|
||||
: theme.chipTheme,
|
||||
|
||||
@@ -33,6 +33,8 @@ class DialogDemoItem extends StatelessWidget {
|
||||
return SimpleDialogOption(
|
||||
onPressed: onPressed,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Icon(icon, size: 36.0, color: color),
|
||||
Padding(
|
||||
|
||||
@@ -308,6 +308,7 @@ class _ExpansionPanelsDemoState extends State<ExpansionPanelsDemo> {
|
||||
// Allow room for the value indicator.
|
||||
padding: const EdgeInsets.only(top: 44.0),
|
||||
child: Slider(
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
divisions: 5,
|
||||
activeColor: Colors.orange[100 + (field.value! * 5.0).round()],
|
||||
|
||||
@@ -284,6 +284,7 @@ class _SlidersState extends State<_Sliders> {
|
||||
Slider.adaptive(
|
||||
label: _continuousValue.toStringAsFixed(6),
|
||||
value: _continuousValue,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
@@ -306,6 +307,7 @@ class _SlidersState extends State<_Sliders> {
|
||||
children: <Widget>[
|
||||
Slider.adaptive(
|
||||
value: _discreteValue,
|
||||
min: 0.0,
|
||||
max: 200.0,
|
||||
divisions: 5,
|
||||
label: '${_discreteValue.round()}',
|
||||
@@ -336,6 +338,7 @@ class _SlidersState extends State<_Sliders> {
|
||||
),
|
||||
child: Slider(
|
||||
value: _discreteCustomValue,
|
||||
min: 0.0,
|
||||
max: 200.0,
|
||||
divisions: 5,
|
||||
semanticFormatterCallback: (double value) => value.round().toString(),
|
||||
@@ -378,6 +381,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
|
||||
children: <Widget>[
|
||||
RangeSlider(
|
||||
values: _continuousValues,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
onChanged: (RangeValues values) {
|
||||
setState(() {
|
||||
@@ -400,6 +404,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
|
||||
children: <Widget>[
|
||||
RangeSlider(
|
||||
values: _discreteValues,
|
||||
min: 0.0,
|
||||
max: 200.0,
|
||||
divisions: 5,
|
||||
labels: RangeLabels('${_discreteValues.start.round()}', '${_discreteValues.end.round()}'),
|
||||
@@ -428,6 +433,7 @@ class _RangeSlidersState extends State<_RangeSliders> {
|
||||
),
|
||||
child: RangeSlider(
|
||||
values: _discreteCustomValues,
|
||||
min: 0.0,
|
||||
max: 200.0,
|
||||
divisions: 5,
|
||||
labels: RangeLabels('${_discreteCustomValues.start.round()}', '${_discreteCustomValues.end.round()}'),
|
||||
|
||||
@@ -107,6 +107,7 @@ class _CardDataItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Align(
|
||||
alignment: page!.id == 'H'
|
||||
|
||||
@@ -252,6 +252,7 @@ class TextFormFieldDemoState extends State<TextFormFieldDemo> {
|
||||
suffixText: 'USD',
|
||||
suffixStyle: TextStyle(color: Colors.green),
|
||||
),
|
||||
maxLines: 1,
|
||||
),
|
||||
const SizedBox(height: 24.0),
|
||||
PasswordField(
|
||||
|
||||
@@ -171,7 +171,7 @@ class ExpandingBottomSheetState extends State<ExpandingBottomSheet> with TickerP
|
||||
).animate(
|
||||
CurvedAnimation(
|
||||
parent: _controller.view,
|
||||
curve: const Interval(0.434, 1.0), // not used
|
||||
curve: const Interval(0.434, 1.0, curve: Curves.linear), // not used
|
||||
// only the reverseCurve will be used
|
||||
reverseCurve: Interval(0.434, 1.0, curve: Curves.fastOutSlowIn.flipped),
|
||||
),
|
||||
@@ -448,7 +448,7 @@ class _ProductThumbnailRowState extends State<ProductThumbnailRow> {
|
||||
);
|
||||
|
||||
final Animation<double> opacity = CurvedAnimation(
|
||||
curve: const Interval(0.33, 1.0),
|
||||
curve: const Interval(0.33, 1.0, curve: Curves.linear),
|
||||
parent: animation,
|
||||
);
|
||||
|
||||
|
||||
@@ -124,6 +124,7 @@ class ShoppingCartSummary extends StatelessWidget {
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
const Expanded(
|
||||
child: Text('TOTAL'),
|
||||
|
||||
@@ -45,6 +45,7 @@ class ProductCard extends StatelessWidget {
|
||||
children: <Widget>[
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
AspectRatio(
|
||||
aspectRatio: imageAspectRatio,
|
||||
@@ -55,6 +56,7 @@ class ProductCard extends StatelessWidget {
|
||||
width: 121.0,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
product == null ? '' : product!.name,
|
||||
|
||||
@@ -253,6 +253,7 @@ class GridLists {
|
||||
// loaded from the web.
|
||||
GridView.count(
|
||||
crossAxisCount: 3,
|
||||
childAspectRatio: 1.0,
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
mainAxisSpacing: 4.0,
|
||||
crossAxisSpacing: 4.0,
|
||||
|
||||
@@ -58,12 +58,14 @@ class _CategoryItem extends StatelessWidget {
|
||||
// repainted when the button's ink splash animates.
|
||||
return RepaintBoundary(
|
||||
child: RawMaterialButton(
|
||||
padding: EdgeInsets.zero,
|
||||
hoverColor: theme.primaryColor.withOpacity(0.05),
|
||||
splashColor: theme.primaryColor.withOpacity(0.12),
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: onTap,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
@@ -182,6 +184,7 @@ class _DemoItem extends StatelessWidget {
|
||||
final bool isDark = theme.brightness == Brightness.dark;
|
||||
final double textScaleFactor = MediaQuery.textScaleFactorOf(context);
|
||||
return RawMaterialButton(
|
||||
padding: EdgeInsets.zero,
|
||||
splashColor: theme.primaryColor.withOpacity(0.12),
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () {
|
||||
|
||||
@@ -162,7 +162,7 @@ Future<void> smokeGallery(WidgetTester tester) async {
|
||||
await tester.tap(find.text(category.name));
|
||||
await tester.pumpAndSettle();
|
||||
for (final GalleryDemo demo in kGalleryCategoryToDemos[category]!) {
|
||||
await Scrollable.ensureVisible(tester.element(find.text(demo.title)));
|
||||
await Scrollable.ensureVisible(tester.element(find.text(demo.title)), alignment: 0.0);
|
||||
await smokeDemo(tester, demo);
|
||||
tester.binding.debugAssertNoTransientCallbacks('A transient callback was still active after running $demo');
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ Future<void> runDemos(List<String> demos, WidgetController controller) async {
|
||||
await controller.pumpAndSettle();
|
||||
// Scroll back to the top
|
||||
await controller.drag(demoList, const Offset(0.0, 10000.0));
|
||||
await controller.pumpAndSettle();
|
||||
await controller.pumpAndSettle(const Duration(milliseconds: 100));
|
||||
}
|
||||
currentDemoCategory = demoCategory;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ void main([List<String> args = const <String>[]]) {
|
||||
await tester.pumpAndSettle();
|
||||
final int id = tester.getSemantics(find.bySemanticsLabel('Material')).id;
|
||||
expect(id, greaterThan(-1));
|
||||
}, skip: !withSemantics);
|
||||
}, skip: !withSemantics, semanticsEnabled: true);
|
||||
|
||||
testWidgets(
|
||||
'all demos',
|
||||
|
||||
@@ -31,6 +31,7 @@ Future<void> main() async {
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: const IgnorePointer(
|
||||
ignoring: true,
|
||||
child: GalleryApp(testMode: true),
|
||||
),
|
||||
));
|
||||
|
||||
@@ -199,7 +199,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
||||
setState(() {});
|
||||
break;
|
||||
}
|
||||
return Future<dynamic>.value();
|
||||
return Future<dynamic>.value(null);
|
||||
}
|
||||
|
||||
Future<dynamic> onViewMethodChannelCall(MethodCall call) {
|
||||
@@ -212,7 +212,7 @@ class MotionEventsBodyState extends State<MotionEventsBody> {
|
||||
setState(() {});
|
||||
break;
|
||||
}
|
||||
return Future<dynamic>.value();
|
||||
return Future<dynamic>.value(null);
|
||||
}
|
||||
|
||||
Widget buildEventTile(BuildContext context, int index) {
|
||||
|
||||
@@ -105,5 +105,6 @@ void dispatchMouseWheelEvent(int mouseX, int mouseY,
|
||||
deltaMode: deltaMode,
|
||||
deltaX : deltaX,
|
||||
deltaY : deltaY,
|
||||
shiftKey: false,
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user