add missing trailing commas (#81406)
This commit is contained in:
parent
7c27db3dfe
commit
7f31861914
@ -68,7 +68,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
|
'Platform button tapped $_counter time${ _counter == 1 ? '' : 's' }.',
|
||||||
style: const TextStyle(fontSize: 17.0)),
|
style: const TextStyle(fontSize: 17.0),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
|
@ -10,7 +10,7 @@ void main() =>
|
|||||||
child:
|
child:
|
||||||
Text('Hello, world!',
|
Text('Hello, world!',
|
||||||
key: Key('title'),
|
key: Key('title'),
|
||||||
textDirection: TextDirection.ltr
|
textDirection: TextDirection.ltr,
|
||||||
)
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
@ -83,7 +83,7 @@ class MyHttpOverrides extends HttpOverrides {
|
|||||||
@override
|
@override
|
||||||
HttpClient createHttpClient(SecurityContext? context) {
|
HttpClient createHttpClient(SecurityContext? context) {
|
||||||
return super.createHttpClient(
|
return super.createHttpClient(
|
||||||
(context ?? SecurityContext())..setTrustedCertificatesBytes(certificate.codeUnits)
|
(context ?? SecurityContext())..setTrustedCertificatesBytes(certificate.codeUnits),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -189,11 +189,13 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
|||||||
Completer<bool>(),
|
Completer<bool>(),
|
||||||
];
|
];
|
||||||
final List<Future<bool>> futures = completers.map(
|
final List<Future<bool>> futures = completers.map(
|
||||||
(Completer<bool> completer) => completer.future).toList();
|
(Completer<bool> completer) => completer.future,
|
||||||
|
).toList();
|
||||||
final DateTime started = DateTime.now();
|
final DateTime started = DateTime.now();
|
||||||
Future.wait(futures).then((_) {
|
Future.wait(futures).then((_) {
|
||||||
print(
|
print(
|
||||||
'===image_list=== all loaded in ${DateTime.now().difference(started).inMilliseconds}ms.');
|
'===image_list=== all loaded in ${DateTime.now().difference(started).inMilliseconds}ms.',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
@ -222,8 +224,11 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> createImageList(int count, List<Completer<bool>> completers,
|
List<Widget> createImageList(
|
||||||
List<AnimationController> controllers) {
|
int count,
|
||||||
|
List<Completer<bool>> completers,
|
||||||
|
List<AnimationController> controllers,
|
||||||
|
) {
|
||||||
final List<Widget> list = <Widget>[];
|
final List<Widget> list = <Widget>[];
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
list.add(Flexible(
|
list.add(Flexible(
|
||||||
@ -231,7 +236,9 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
|||||||
flex: i + 1,
|
flex: i + 1,
|
||||||
child: RotationTransition(
|
child: RotationTransition(
|
||||||
turns: controllers[i],
|
turns: controllers[i],
|
||||||
child: createImage(i + 1, completers[i]))));
|
child: createImage(i + 1, completers[i]),
|
||||||
|
),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,9 @@ Future<void> beginFrame(Duration timeStamp) async {
|
|||||||
final ui.Paint backgroundPaint = ui.Paint()..color = Colors.white;
|
final ui.Paint backgroundPaint = ui.Paint()..color = Colors.white;
|
||||||
canvas.drawRect(paintBounds, backgroundPaint);
|
canvas.drawRect(paintBounds, backgroundPaint);
|
||||||
await const DefaultShaderWarmUp(
|
await const DefaultShaderWarmUp(
|
||||||
drawCallSpacing: 80.0, canvasSize: ui.Size(1024, 1024))
|
drawCallSpacing: 80.0,
|
||||||
.warmUpOnCanvas(canvas);
|
canvasSize: ui.Size(1024, 1024),
|
||||||
|
).warmUpOnCanvas(canvas);
|
||||||
final ui.Picture picture = recorder.endRecording();
|
final ui.Picture picture = recorder.endRecording();
|
||||||
|
|
||||||
// COMPOSITE
|
// COMPOSITE
|
||||||
|
@ -29,8 +29,10 @@ void beginFrame(Duration timeStamp) {
|
|||||||
final double t = timeStamp.inMicroseconds / Duration.microsecondsPerMillisecond / 1800.0;
|
final double t = timeStamp.inMicroseconds / Duration.microsecondsPerMillisecond / 1800.0;
|
||||||
canvas.rotate(math.pi * (t % 1.0));
|
canvas.rotate(math.pi * (t % 1.0));
|
||||||
|
|
||||||
canvas.drawRect(const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
|
canvas.drawRect(
|
||||||
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0));
|
const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
|
||||||
|
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0),
|
||||||
|
);
|
||||||
final ui.Picture picture = recorder.endRecording();
|
final ui.Picture picture = recorder.endRecording();
|
||||||
|
|
||||||
// COMPOSITE
|
// COMPOSITE
|
||||||
|
@ -19,8 +19,10 @@ ui.Picture paint(ui.Rect paintBounds) {
|
|||||||
final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio;
|
final ui.Size logicalSize = ui.window.physicalSize / devicePixelRatio;
|
||||||
|
|
||||||
canvas.translate(logicalSize.width / 2.0, logicalSize.height / 2.0);
|
canvas.translate(logicalSize.width / 2.0, logicalSize.height / 2.0);
|
||||||
canvas.drawRect(const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
|
canvas.drawRect(
|
||||||
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0));
|
const ui.Rect.fromLTRB(-100.0, -100.0, 100.0, 100.0),
|
||||||
|
ui.Paint()..color = const ui.Color.fromARGB(255, 0, 255, 0),
|
||||||
|
);
|
||||||
|
|
||||||
// The paint method of Paragraph draws the contents of the paragraph onto the
|
// The paint method of Paragraph draws the contents of the paragraph onto the
|
||||||
// given canvas.
|
// given canvas.
|
||||||
|
@ -20,7 +20,7 @@ class NonStopVSync implements TickerProvider {
|
|||||||
void main() {
|
void main() {
|
||||||
// We first create a render object that represents a green box.
|
// We first create a render object that represents a green box.
|
||||||
final RenderBox green = RenderDecoratedBox(
|
final RenderBox green = RenderDecoratedBox(
|
||||||
decoration: const BoxDecoration(color: Color(0xFF00FF00))
|
decoration: const BoxDecoration(color: Color(0xFF00FF00)),
|
||||||
);
|
);
|
||||||
// Second, we wrap that green box in a render object that forces the green box
|
// Second, we wrap that green box in a render object that forces the green box
|
||||||
// to have a specific size.
|
// to have a specific size.
|
||||||
|
@ -40,7 +40,7 @@ class Calculator {
|
|||||||
if (key is int && i++ % _NOTIFY_INTERVAL == 0)
|
if (key is int && i++ % _NOTIFY_INTERVAL == 0)
|
||||||
onProgressListener(i.toDouble(), _NUM_ITEMS.toDouble());
|
onProgressListener(i.toDouble(), _NUM_ITEMS.toDouble());
|
||||||
return value;
|
return value;
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
final List<dynamic> result = decoder.convert(_data) as List<dynamic>;
|
final List<dynamic> result = decoder.convert(_data) as List<dynamic>;
|
||||||
@ -249,7 +249,7 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
|||||||
Opacity(
|
Opacity(
|
||||||
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
|
opacity: _calculationManager.isRunning ? 1.0 : 0.0,
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
value: _progress
|
value: _progress,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(_status),
|
Text(_status),
|
||||||
|
@ -30,8 +30,9 @@ class _GesturePainter extends CustomPainter {
|
|||||||
final Offset center = size.center(Offset.zero) * zoom + offset;
|
final Offset center = size.center(Offset.zero) * zoom + offset;
|
||||||
final double radius = size.width / 2.0 * zoom;
|
final double radius = size.width / 2.0 * zoom;
|
||||||
final Gradient gradient = RadialGradient(
|
final Gradient gradient = RadialGradient(
|
||||||
colors: forward ? <Color>[swatch.shade50, swatch.shade900]
|
colors: forward
|
||||||
: <Color>[swatch.shade900, swatch.shade50]
|
? <Color>[swatch.shade50, swatch.shade900]
|
||||||
|
: <Color>[swatch.shade900, swatch.shade50],
|
||||||
);
|
);
|
||||||
final Paint paint = Paint()
|
final Paint paint = Paint()
|
||||||
..shader = gradient.createShader(Rect.fromCircle(
|
..shader = gradient.createShader(Rect.fromCircle(
|
||||||
|
@ -135,7 +135,7 @@ class SectorAppState extends State<SectorApp> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
margin: const EdgeInsets.all(8.0),
|
margin: const EdgeInsets.all(8.0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all()
|
border: Border.all(),
|
||||||
),
|
),
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: WidgetToRenderBoxAdapter(
|
child: WidgetToRenderBoxAdapter(
|
||||||
|
@ -67,8 +67,8 @@ class SpeakerSeparator extends StatelessWidget {
|
|||||||
margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 64.0),
|
margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 64.0),
|
||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0))
|
bottom: BorderSide(color: Color.fromARGB(24, 0, 0, 0)),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
child: Platform.isIOS
|
child: Platform.isIOS
|
||||||
? const Text('Continue in iOS view')
|
? const Text('Continue in iOS view')
|
||||||
: const Text('Continue in Android view'),
|
: const Text('Continue in Android view'),
|
||||||
onPressed: _launchPlatformCount),
|
onPressed: _launchPlatformCount,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -88,8 +89,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
|||||||
padding: const EdgeInsets.only(bottom: 15.0, left: 5.0),
|
padding: const EdgeInsets.only(bottom: 15.0, left: 5.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Image.asset('assets/flutter-mark-square-64.png',
|
Image.asset('assets/flutter-mark-square-64.png', scale: 1.5),
|
||||||
scale: 1.5),
|
|
||||||
const Text(
|
const Text(
|
||||||
'Flutter',
|
'Flutter',
|
||||||
style: TextStyle(fontSize: 30.0),
|
style: TextStyle(fontSize: 30.0),
|
||||||
|
@ -1199,8 +1199,10 @@ class _RenderCupertinoDialog extends RenderBox {
|
|||||||
|
|
||||||
// Set the position of the actions box to sit at the bottom of the dialog.
|
// Set the position of the actions box to sit at the bottom of the dialog.
|
||||||
// The content box defaults to the top left, which is where we want it.
|
// The content box defaults to the top left, which is where we want it.
|
||||||
assert((!isActionSheet && actionsSection!.parentData is BoxParentData)
|
assert(
|
||||||
|| (isActionSheet && actionsSection!.parentData is MultiChildLayoutParentData));
|
(!isActionSheet && actionsSection!.parentData is BoxParentData) ||
|
||||||
|
(isActionSheet && actionsSection!.parentData is MultiChildLayoutParentData),
|
||||||
|
);
|
||||||
if (isActionSheet) {
|
if (isActionSheet) {
|
||||||
final MultiChildLayoutParentData actionParentData = actionsSection!.parentData! as MultiChildLayoutParentData;
|
final MultiChildLayoutParentData actionParentData = actionsSection!.parentData! as MultiChildLayoutParentData;
|
||||||
actionParentData.offset = Offset(0.0, dialogSizes.contentHeight + dialogSizes.dividerThickness);
|
actionParentData.offset = Offset(0.0, dialogSizes.contentHeight + dialogSizes.dividerThickness);
|
||||||
@ -1880,8 +1882,7 @@ class _CupertinoDialogActionsRenderWidget extends MultiChildRenderObjectWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void updateRenderObject(
|
void updateRenderObject(BuildContext context, _RenderCupertinoDialogActions renderObject) {
|
||||||
BuildContext context, _RenderCupertinoDialogActions renderObject) {
|
|
||||||
renderObject
|
renderObject
|
||||||
..dialogWidth = _isActionSheet
|
..dialogWidth = _isActionSheet
|
||||||
? null
|
? null
|
||||||
@ -2226,7 +2227,7 @@ class _RenderCupertinoDialogActions extends RenderBox
|
|||||||
);
|
);
|
||||||
|
|
||||||
return constraints.constrain(
|
return constraints.constrain(
|
||||||
Size(dialogWidth!, childSize.height)
|
Size(dialogWidth!, childSize.height),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// Each button gets half the available width, minus a single divider.
|
// Each button gets half the available width, minus a single divider.
|
||||||
|
@ -812,7 +812,8 @@ class _AppBarState extends State<AppBar> {
|
|||||||
states,
|
states,
|
||||||
widget.backgroundColor,
|
widget.backgroundColor,
|
||||||
appBarTheme.backgroundColor,
|
appBarTheme.backgroundColor,
|
||||||
colorScheme.brightness == Brightness.dark ? colorScheme.surface : colorScheme.primary);
|
colorScheme.brightness == Brightness.dark ? colorScheme.surface : colorScheme.primary,
|
||||||
|
);
|
||||||
|
|
||||||
final Color foregroundColor = widget.foregroundColor
|
final Color foregroundColor = widget.foregroundColor
|
||||||
?? appBarTheme.foregroundColor
|
?? appBarTheme.foregroundColor
|
||||||
|
@ -651,7 +651,8 @@ class _PopupMenuRouteLayout extends SingleChildLayoutDelegate {
|
|||||||
// The menu can be at most the size of the overlay minus 8.0 pixels in each
|
// The menu can be at most the size of the overlay minus 8.0 pixels in each
|
||||||
// direction.
|
// direction.
|
||||||
return BoxConstraints.loose(constraints.biggest).deflate(
|
return BoxConstraints.loose(constraints.biggest).deflate(
|
||||||
const EdgeInsets.all(_kMenuScreenPadding) + EdgeInsets.only(top: topPadding, bottom: bottomPadding));
|
const EdgeInsets.all(_kMenuScreenPadding) + EdgeInsets.only(top: topPadding, bottom: bottomPadding),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -830,7 +830,7 @@ class TextStyle with Diagnosticable {
|
|||||||
decorationStyle: decorationStyle ?? this.decorationStyle,
|
decorationStyle: decorationStyle ?? this.decorationStyle,
|
||||||
decorationThickness: decorationThickness ?? this.decorationThickness,
|
decorationThickness: decorationThickness ?? this.decorationThickness,
|
||||||
debugLabel: newDebugLabel,
|
debugLabel: newDebugLabel,
|
||||||
overflow: overflow ?? this.overflow
|
overflow: overflow ?? this.overflow,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ mixin ServicesBinding on BindingBase, SchedulerBinding {
|
|||||||
List<int> bytes = licenseBytes.buffer.asUint8List();
|
List<int> bytes = licenseBytes.buffer.asUint8List();
|
||||||
bytes = gzip.decode(bytes);
|
bytes = gzip.decode(bytes);
|
||||||
return utf8.decode(bytes);
|
return utf8.decode(bytes);
|
||||||
}()
|
}(),
|
||||||
);
|
);
|
||||||
}, Priority.animation);
|
}, Priority.animation);
|
||||||
await rawLicenses.future;
|
await rawLicenses.future;
|
||||||
|
@ -148,8 +148,7 @@ class LogicalKeyboardKey extends KeyboardKey {
|
|||||||
|
|
||||||
// Equivalent to assert(divisorForValueMask == (1 << valueMaskWidth)).
|
// Equivalent to assert(divisorForValueMask == (1 << valueMaskWidth)).
|
||||||
const int _firstDivisorWidth = 28;
|
const int _firstDivisorWidth = 28;
|
||||||
assert(divisorForValueMask ==
|
assert(divisorForValueMask == (1 << _firstDivisorWidth) * (1 << (valueMaskWidth - _firstDivisorWidth)));
|
||||||
(1 << _firstDivisorWidth) * (1 << (valueMaskWidth - _firstDivisorWidth)));
|
|
||||||
|
|
||||||
// JS only supports up to 2^53 - 1, therefore non-value bits can only
|
// JS only supports up to 2^53 - 1, therefore non-value bits can only
|
||||||
// contain (maxSafeIntegerWidth - valueMaskWidth) bits.
|
// contain (maxSafeIntegerWidth - valueMaskWidth) bits.
|
||||||
|
@ -505,7 +505,7 @@ class RawAutocomplete<T extends Object> extends StatefulWidget {
|
|||||||
assert((focusNode == null) == (textEditingController == null)),
|
assert((focusNode == null) == (textEditingController == null)),
|
||||||
assert(
|
assert(
|
||||||
!(textEditingController != null && initialValue != null),
|
!(textEditingController != null && initialValue != null),
|
||||||
'textEditingController and initialValue cannot be simultaneously defined.'
|
'textEditingController and initialValue cannot be simultaneously defined.',
|
||||||
),
|
),
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
|
@ -153,10 +153,13 @@ class InteractiveViewer extends StatefulWidget {
|
|||||||
assert(scaleEnabled != null),
|
assert(scaleEnabled != null),
|
||||||
// boundaryMargin must be either fully infinite or fully finite, but not
|
// boundaryMargin must be either fully infinite or fully finite, but not
|
||||||
// a mix of both.
|
// a mix of both.
|
||||||
assert((boundaryMargin.horizontal.isInfinite
|
assert(
|
||||||
&& boundaryMargin.vertical.isInfinite) || (boundaryMargin.top.isFinite
|
(boundaryMargin.horizontal.isInfinite && boundaryMargin.vertical.isInfinite) ||
|
||||||
&& boundaryMargin.right.isFinite && boundaryMargin.bottom.isFinite
|
(boundaryMargin.top.isFinite &&
|
||||||
&& boundaryMargin.left.isFinite)),
|
boundaryMargin.right.isFinite &&
|
||||||
|
boundaryMargin.bottom.isFinite &&
|
||||||
|
boundaryMargin.left.isFinite),
|
||||||
|
),
|
||||||
constrained = false,
|
constrained = false,
|
||||||
child = null,
|
child = null,
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
@ -79,7 +79,7 @@ class ScrollBehavior {
|
|||||||
/// instead.
|
/// instead.
|
||||||
@Deprecated(
|
@Deprecated(
|
||||||
'Migrate to buildOverscrollIndicator. '
|
'Migrate to buildOverscrollIndicator. '
|
||||||
'This feature was deprecated after v2.1.0-11.0.pre.'
|
'This feature was deprecated after v2.1.0-11.0.pre.',
|
||||||
)
|
)
|
||||||
Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
|
Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
|
||||||
switch (getPlatform(context)) {
|
switch (getPlatform(context)) {
|
||||||
|
@ -298,7 +298,8 @@ class LogicalKeySet extends KeySet<LogicalKeyboardKey> with Diagnosticable
|
|||||||
@override
|
@override
|
||||||
Iterable<LogicalKeyboardKey> get triggers => _triggers;
|
Iterable<LogicalKeyboardKey> get triggers => _triggers;
|
||||||
late final Set<LogicalKeyboardKey> _triggers = keys.expand(
|
late final Set<LogicalKeyboardKey> _triggers = keys.expand(
|
||||||
(LogicalKeyboardKey key) => _unmapSynonyms[key] ?? <LogicalKeyboardKey>[key]).toSet();
|
(LogicalKeyboardKey key) => _unmapSynonyms[key] ?? <LogicalKeyboardKey>[key],
|
||||||
|
).toSet();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool accepts(RawKeyEvent event, RawKeyboard state) {
|
bool accepts(RawKeyEvent event, RawKeyboard state) {
|
||||||
@ -475,18 +476,20 @@ class SingleActivator with Diagnosticable implements ShortcutActivator {
|
|||||||
// since const constructors can not call functions such as `==` or
|
// since const constructors can not call functions such as `==` or
|
||||||
// `Set.contains`. Checking with `identical` is sufficient since
|
// `Set.contains`. Checking with `identical` is sufficient since
|
||||||
// `LogicalKeyboardKey` only provides cached values.
|
// `LogicalKeyboardKey` only provides cached values.
|
||||||
assert(!identical(trigger, LogicalKeyboardKey.control)
|
assert(
|
||||||
&& !identical(trigger, LogicalKeyboardKey.controlLeft)
|
!identical(trigger, LogicalKeyboardKey.control) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.controlRight)
|
!identical(trigger, LogicalKeyboardKey.controlLeft) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.shift)
|
!identical(trigger, LogicalKeyboardKey.controlRight) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.shiftLeft)
|
!identical(trigger, LogicalKeyboardKey.shift) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.shiftRight)
|
!identical(trigger, LogicalKeyboardKey.shiftLeft) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.alt)
|
!identical(trigger, LogicalKeyboardKey.shiftRight) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.altLeft)
|
!identical(trigger, LogicalKeyboardKey.alt) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.altRight)
|
!identical(trigger, LogicalKeyboardKey.altLeft) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.meta)
|
!identical(trigger, LogicalKeyboardKey.altRight) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.metaLeft)
|
!identical(trigger, LogicalKeyboardKey.meta) &&
|
||||||
&& !identical(trigger, LogicalKeyboardKey.metaRight));
|
!identical(trigger, LogicalKeyboardKey.metaLeft) &&
|
||||||
|
!identical(trigger, LogicalKeyboardKey.metaRight),
|
||||||
|
);
|
||||||
|
|
||||||
/// The non-modifier key of the shortcut that is pressed after all modifiers
|
/// The non-modifier key of the shortcut that is pressed after all modifiers
|
||||||
/// to activate the shortcut.
|
/// to activate the shortcut.
|
||||||
|
@ -84,5 +84,5 @@ const List<int> kBlueRectPng = <int> [
|
|||||||
99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18,
|
99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18,
|
||||||
99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18,
|
99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 140, 33, 49, 134, 196, 24, 18,
|
||||||
99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 204, 5, 234, 78, 2, 198, 180,
|
99, 72, 140, 33, 49, 134, 196, 24, 18, 99, 72, 204, 5, 234, 78, 2, 198, 180,
|
||||||
170, 48, 200, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130
|
170, 48, 200, 0, 0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130,
|
||||||
];
|
];
|
||||||
|
@ -842,8 +842,10 @@ void main() {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(0, 586, 154, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(0, 586, 154, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('No constraints by default for showBottomSheet', (WidgetTester tester) async {
|
testWidgets('No constraints by default for showBottomSheet', (WidgetTester tester) async {
|
||||||
@ -855,7 +857,7 @@ void main() {
|
|||||||
child: const Text('Press me'),
|
child: const Text('Press me'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Scaffold.of(context).showBottomSheet<void>(
|
Scaffold.of(context).showBottomSheet<void>(
|
||||||
(BuildContext context) => const Text('BottomSheet')
|
(BuildContext context) => const Text('BottomSheet'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -867,8 +869,10 @@ void main() {
|
|||||||
await tester.tap(find.text('Press me'));
|
await tester.tap(find.text('Press me'));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(0, 586, 154, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(0, 586, 154, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('No constraints by default for showModalBottomSheet', (WidgetTester tester) async {
|
testWidgets('No constraints by default for showModalBottomSheet', (WidgetTester tester) async {
|
||||||
@ -893,8 +897,10 @@ void main() {
|
|||||||
await tester.tap(find.text('Press me'));
|
await tester.tap(find.text('Press me'));
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(0, 586, 800, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(0, 586, 800, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Theme constraints used for bottomSheet property', (WidgetTester tester) async {
|
testWidgets('Theme constraints used for bottomSheet property', (WidgetTester tester) async {
|
||||||
@ -902,7 +908,7 @@ void main() {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
bottomSheetTheme: const BottomSheetThemeData(
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
constraints: BoxConstraints(maxWidth: 80),
|
constraints: BoxConstraints(maxWidth: 80),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
home: const Scaffold(
|
home: const Scaffold(
|
||||||
body: Center(child: Text('body')),
|
body: Center(child: Text('body')),
|
||||||
@ -911,8 +917,10 @@ void main() {
|
|||||||
));
|
));
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
// Should be centered and only 80dp wide
|
// Should be centered and only 80dp wide
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(360, 558, 440, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(360, 558, 440, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Theme constraints used for showBottomSheet', (WidgetTester tester) async {
|
testWidgets('Theme constraints used for showBottomSheet', (WidgetTester tester) async {
|
||||||
@ -920,7 +928,7 @@ void main() {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
bottomSheetTheme: const BottomSheetThemeData(
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
constraints: BoxConstraints(maxWidth: 80),
|
constraints: BoxConstraints(maxWidth: 80),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Builder(builder: (BuildContext context) {
|
body: Builder(builder: (BuildContext context) {
|
||||||
@ -929,7 +937,7 @@ void main() {
|
|||||||
child: const Text('Press me'),
|
child: const Text('Press me'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Scaffold.of(context).showBottomSheet<void>(
|
Scaffold.of(context).showBottomSheet<void>(
|
||||||
(BuildContext context) => const Text('BottomSheet')
|
(BuildContext context) => const Text('BottomSheet'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -942,8 +950,10 @@ void main() {
|
|||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
// Should be centered and only 80dp wide
|
// Should be centered and only 80dp wide
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(360, 558, 440, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(360, 558, 440, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('Theme constraints used for showModalBottomSheet', (WidgetTester tester) async {
|
testWidgets('Theme constraints used for showModalBottomSheet', (WidgetTester tester) async {
|
||||||
@ -951,7 +961,7 @@ void main() {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
bottomSheetTheme: const BottomSheetThemeData(
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
constraints: BoxConstraints(maxWidth: 80),
|
constraints: BoxConstraints(maxWidth: 80),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Builder(builder: (BuildContext context) {
|
body: Builder(builder: (BuildContext context) {
|
||||||
@ -974,8 +984,10 @@ void main() {
|
|||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
// Should be centered and only 80dp wide
|
// Should be centered and only 80dp wide
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(360, 558, 440, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(360, 558, 440, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('constraints param overrides theme for showBottomSheet', (WidgetTester tester) async {
|
testWidgets('constraints param overrides theme for showBottomSheet', (WidgetTester tester) async {
|
||||||
@ -983,7 +995,7 @@ void main() {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
bottomSheetTheme: const BottomSheetThemeData(
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
constraints: BoxConstraints(maxWidth: 80),
|
constraints: BoxConstraints(maxWidth: 80),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Builder(builder: (BuildContext context) {
|
body: Builder(builder: (BuildContext context) {
|
||||||
@ -1006,8 +1018,10 @@ void main() {
|
|||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
// Should be centered and only 100dp wide instead of 80dp wide
|
// Should be centered and only 100dp wide instead of 80dp wide
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(350, 572, 450, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(350, 572, 450, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('constraints param overrides theme for showModalBottomSheet', (WidgetTester tester) async {
|
testWidgets('constraints param overrides theme for showModalBottomSheet', (WidgetTester tester) async {
|
||||||
@ -1015,7 +1029,7 @@ void main() {
|
|||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
bottomSheetTheme: const BottomSheetThemeData(
|
bottomSheetTheme: const BottomSheetThemeData(
|
||||||
constraints: BoxConstraints(maxWidth: 80),
|
constraints: BoxConstraints(maxWidth: 80),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Builder(builder: (BuildContext context) {
|
body: Builder(builder: (BuildContext context) {
|
||||||
@ -1039,8 +1053,10 @@ void main() {
|
|||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('BottomSheet'), findsOneWidget);
|
expect(find.text('BottomSheet'), findsOneWidget);
|
||||||
// Should be centered and only 100dp instead of 80dp wide
|
// Should be centered and only 100dp instead of 80dp wide
|
||||||
expect(tester.getRect(find.text('BottomSheet')),
|
expect(
|
||||||
const Rect.fromLTRB(350, 572, 450, 600));
|
tester.getRect(find.text('BottomSheet')),
|
||||||
|
const Rect.fromLTRB(350, 572, 450, 600),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1744,7 +1744,7 @@ void main() {
|
|||||||
constraints: BoxConstraints(maxWidth: 300, maxHeight: 40),
|
constraints: BoxConstraints(maxWidth: 300, maxHeight: 40),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Theme settings should make it 300x40 pixels
|
// Theme settings should make it 300x40 pixels
|
||||||
@ -1762,7 +1762,7 @@ void main() {
|
|||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
constraints: BoxConstraints(maxWidth: 200, maxHeight: 32),
|
constraints: BoxConstraints(maxWidth: 200, maxHeight: 32),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
// InputDecoration.constraints should override the theme. It should be
|
// InputDecoration.constraints should override the theme. It should be
|
||||||
|
@ -475,7 +475,7 @@ void main() {
|
|||||||
expect(find.byType(RefreshProgressIndicator), paints..arc(color: blue));
|
expect(find.byType(RefreshProgressIndicator), paints..arc(color: blue));
|
||||||
final Material backgroundMaterial = tester.widget(find.descendant(
|
final Material backgroundMaterial = tester.widget(find.descendant(
|
||||||
of: find.byType(RefreshProgressIndicator),
|
of: find.byType(RefreshProgressIndicator),
|
||||||
matching: find.byType(Material)
|
matching: find.byType(Material),
|
||||||
));
|
));
|
||||||
expect(backgroundMaterial.type, MaterialType.circle);
|
expect(backgroundMaterial.type, MaterialType.circle);
|
||||||
expect(backgroundMaterial.color, green);
|
expect(backgroundMaterial.color, green);
|
||||||
@ -492,7 +492,7 @@ void main() {
|
|||||||
expect(find.byType(RefreshProgressIndicator), paints..arc(color: green));
|
expect(find.byType(RefreshProgressIndicator), paints..arc(color: green));
|
||||||
final Material themeBackgroundMaterial = tester.widget(find.descendant(
|
final Material themeBackgroundMaterial = tester.widget(find.descendant(
|
||||||
of: find.byType(RefreshProgressIndicator),
|
of: find.byType(RefreshProgressIndicator),
|
||||||
matching: find.byType(Material)
|
matching: find.byType(Material),
|
||||||
));
|
));
|
||||||
expect(themeBackgroundMaterial.type, MaterialType.circle);
|
expect(themeBackgroundMaterial.type, MaterialType.circle);
|
||||||
expect(themeBackgroundMaterial.color, blue);
|
expect(themeBackgroundMaterial.color, blue);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user