fix some formatting issues (#28809)
* fix some formatting issues * address review comments * fix indent
This commit is contained in:
committed by
GitHub
parent
01a29b85ef
commit
4c1f4d14e1
@@ -119,8 +119,10 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
final double maxHeight;
|
||||
final Widget child;
|
||||
|
||||
@override double get minExtent => minHeight;
|
||||
@override double get maxExtent => math.max(maxHeight, minHeight);
|
||||
@override
|
||||
double get minExtent => minHeight;
|
||||
@override
|
||||
double get maxExtent => math.max(maxHeight, minHeight);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
|
||||
|
||||
@@ -669,7 +669,7 @@ class Tab2ConversationRow extends StatelessWidget {
|
||||
}
|
||||
|
||||
List<Widget> buildTab2Conversation() {
|
||||
return <Widget>[
|
||||
return <Widget>[
|
||||
const Tab2ConversationRow(
|
||||
text: "My Xanadu doesn't look right",
|
||||
),
|
||||
|
||||
@@ -8,9 +8,13 @@ import '../demo/all.dart';
|
||||
import 'icons.dart';
|
||||
|
||||
class GalleryDemoCategory {
|
||||
const GalleryDemoCategory._({ this.name, this.icon });
|
||||
@required final String name;
|
||||
@required final IconData icon;
|
||||
const GalleryDemoCategory._({
|
||||
@required this.name,
|
||||
@required this.icon,
|
||||
});
|
||||
|
||||
final String name;
|
||||
final IconData icon;
|
||||
|
||||
@override
|
||||
bool operator ==(dynamic other) {
|
||||
|
||||
@@ -20,11 +20,11 @@ Future<void> endOfAnimation() async {
|
||||
int iteration = 0;
|
||||
|
||||
class LifecycleObserver extends WidgetsBindingObserver {
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
debugPrint('==== MEMORY BENCHMARK ==== $state ====');
|
||||
debugPrint('This was lifecycle event number $iteration in this instance');
|
||||
}
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
debugPrint('==== MEMORY BENCHMARK ==== $state ====');
|
||||
debugPrint('This was lifecycle event number $iteration in this instance');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> main() async {
|
||||
|
||||
@@ -281,15 +281,15 @@ class IsolateExampleState extends State<StatefulWidget> with SingleTickerProvide
|
||||
}
|
||||
|
||||
String _getStatus(CalculationState state) {
|
||||
switch (state) {
|
||||
case CalculationState.loading:
|
||||
return 'Loading...';
|
||||
case CalculationState.calculating:
|
||||
return 'In Progress';
|
||||
case CalculationState.idle:
|
||||
default:
|
||||
return 'Idle';
|
||||
}
|
||||
switch (state) {
|
||||
case CalculationState.loading:
|
||||
return 'Loading...';
|
||||
case CalculationState.calculating:
|
||||
return 'In Progress';
|
||||
case CalculationState.idle:
|
||||
default:
|
||||
return 'Idle';
|
||||
}
|
||||
}
|
||||
|
||||
void _updateState(String result, double progress) {
|
||||
|
||||
@@ -809,7 +809,7 @@ class _LargeTitleNavigationBarSliverDelegate
|
||||
|
||||
@override
|
||||
bool shouldRebuild(_LargeTitleNavigationBarSliverDelegate oldDelegate) {
|
||||
return components != oldDelegate.components
|
||||
return components != oldDelegate.components
|
||||
|| userMiddle != oldDelegate.userMiddle
|
||||
|| backgroundColor != oldDelegate.backgroundColor
|
||||
|| border != oldDelegate.border
|
||||
|
||||
@@ -254,10 +254,16 @@ class _NoDefaultCupertinoThemeData extends CupertinoThemeData {
|
||||
scaffoldBackgroundColor,
|
||||
);
|
||||
|
||||
@override final Brightness brightness;
|
||||
@override final Color primaryColor;
|
||||
@override final Color primaryContrastingColor;
|
||||
@override final CupertinoTextThemeData textTheme;
|
||||
@override final Color barBackgroundColor;
|
||||
@override final Color scaffoldBackgroundColor;
|
||||
@override
|
||||
final Brightness brightness;
|
||||
@override
|
||||
final Color primaryColor;
|
||||
@override
|
||||
final Color primaryContrastingColor;
|
||||
@override
|
||||
final CupertinoTextThemeData textTheme;
|
||||
@override
|
||||
final Color barBackgroundColor;
|
||||
@override
|
||||
final Color scaffoldBackgroundColor;
|
||||
}
|
||||
|
||||
@@ -64,4 +64,4 @@ class BitField<T extends dynamic> {
|
||||
void reset([ bool value = false ]) {
|
||||
_bits = value ? _allOnes : _allZeros;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1984,7 +1984,8 @@ class DiagnosticableNode<T extends Diagnosticable> extends DiagnosticsNode {
|
||||
return _cachedBuilder;
|
||||
}
|
||||
|
||||
@override DiagnosticsTreeStyle get style {
|
||||
@override
|
||||
DiagnosticsTreeStyle get style {
|
||||
return super.style ?? _builder.defaultDiagnosticsTreeStyle;
|
||||
}
|
||||
|
||||
|
||||
@@ -291,12 +291,12 @@ class ButtonThemeData extends Diagnosticable {
|
||||
EdgeInsetsGeometry get padding {
|
||||
if (_padding != null)
|
||||
return _padding;
|
||||
switch (textTheme) {
|
||||
switch (textTheme) {
|
||||
case ButtonTextTheme.normal:
|
||||
case ButtonTextTheme.accent:
|
||||
return const EdgeInsets.symmetric(horizontal: 16.0);
|
||||
case ButtonTextTheme.primary:
|
||||
return const EdgeInsets.symmetric(horizontal: 24.0);
|
||||
return const EdgeInsets.symmetric(horizontal: 24.0);
|
||||
}
|
||||
assert(false);
|
||||
return EdgeInsets.zero;
|
||||
|
||||
@@ -350,7 +350,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> {
|
||||
}
|
||||
|
||||
class _DropdownRoutePage<T> extends StatelessWidget {
|
||||
const _DropdownRoutePage({
|
||||
const _DropdownRoutePage({
|
||||
Key key,
|
||||
this.route,
|
||||
this.constraints,
|
||||
|
||||
@@ -1094,4 +1094,4 @@ class _RenderSlider extends RenderBox {
|
||||
onChanged((value - _semanticActionUnit).clamp(0.0, 1.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,4 +163,4 @@ class ContinuousRectangleBorder extends ShapeBorder {
|
||||
String toString() {
|
||||
return '$runtimeType($side, $borderRadius)';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3416,7 +3416,8 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
|
||||
}
|
||||
|
||||
/// A short, textual description of this element.
|
||||
@override String toStringShort() {
|
||||
@override
|
||||
String toStringShort() {
|
||||
return widget != null ? '${widget.toStringShort()}' : '[$runtimeType]';
|
||||
}
|
||||
|
||||
|
||||
@@ -1172,9 +1172,9 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
|
||||
|
||||
@override
|
||||
void visitChildren(ElementVisitor visitor) {
|
||||
// The toList() is to make a copy so that the underlying list can be modified by
|
||||
// the visitor:
|
||||
assert(!_childElements.values.any((Element child) => child == null));
|
||||
// The toList() is to make a copy so that the underlying list can be modified by
|
||||
// the visitor:
|
||||
assert(!_childElements.values.any((Element child) => child == null));
|
||||
_childElements.values.toList().forEach(visitor);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ void main() {
|
||||
expect(await result, equals('all done'));
|
||||
});
|
||||
|
||||
testWidgets('Two-step initial route', (WidgetTester tester) async {
|
||||
testWidgets('Two-step initial route', (WidgetTester tester) async {
|
||||
final Map<String, WidgetBuilder> routes = <String, WidgetBuilder>{
|
||||
'/': (BuildContext context) => const Text('route "/"'),
|
||||
'/a': (BuildContext context) => const Text('route "/a"'),
|
||||
|
||||
@@ -238,4 +238,4 @@ void main() {
|
||||
final RenderParagraph content = _getTextRenderObjectFromDialog(tester, contentText);
|
||||
expect(content.text.style.color, contentTextStyle.color);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1114,7 +1114,7 @@ void main() {
|
||||
expect(tester.getRect(find.text('test')).left, 12.0);
|
||||
});
|
||||
|
||||
testWidgets('counter text has correct right margin - LTR, dense', (WidgetTester tester) async {
|
||||
testWidgets('counter text has correct right margin - LTR, dense', (WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
buildInputDecorator(
|
||||
// isEmpty: false (default)
|
||||
|
||||
@@ -1422,4 +1422,4 @@ void main() {
|
||||
expect(await tester.pumpAndSettle(const Duration(milliseconds: 100)), equals(1));
|
||||
await gesture.up();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -760,4 +760,4 @@ Widget _buildApp(
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ void main() {
|
||||
testWidgets('SwitchListTile.adaptive delegates to', (WidgetTester tester) async {
|
||||
bool value = false;
|
||||
|
||||
Widget buildFrame(TargetPlatform platform) {
|
||||
Widget buildFrame(TargetPlatform platform) {
|
||||
return MaterialApp(
|
||||
theme: ThemeData(platform: platform),
|
||||
home: StatefulBuilder(
|
||||
|
||||
@@ -665,26 +665,46 @@ class _TextStyleProxy implements TextStyle {
|
||||
final TextStyle _delegate;
|
||||
|
||||
// Do make sure that all the properties correctly forward to the _delegate.
|
||||
@override Color get color => _delegate.color;
|
||||
@override Color get backgroundColor => _delegate.backgroundColor;
|
||||
@override String get debugLabel => _delegate.debugLabel;
|
||||
@override TextDecoration get decoration => _delegate.decoration;
|
||||
@override Color get decorationColor => _delegate.decorationColor;
|
||||
@override TextDecorationStyle get decorationStyle => _delegate.decorationStyle;
|
||||
@override String get fontFamily => _delegate.fontFamily;
|
||||
@override List<String> get fontFamilyFallback => _delegate.fontFamilyFallback;
|
||||
@override double get fontSize => _delegate.fontSize;
|
||||
@override FontStyle get fontStyle => _delegate.fontStyle;
|
||||
@override FontWeight get fontWeight => _delegate.fontWeight;
|
||||
@override double get height => _delegate.height;
|
||||
@override Locale get locale => _delegate.locale;
|
||||
@override ui.Paint get foreground => _delegate.foreground;
|
||||
@override ui.Paint get background => _delegate.background;
|
||||
@override bool get inherit => _delegate.inherit;
|
||||
@override double get letterSpacing => _delegate.letterSpacing;
|
||||
@override TextBaseline get textBaseline => _delegate.textBaseline;
|
||||
@override double get wordSpacing => _delegate.wordSpacing;
|
||||
@override List<Shadow> get shadows => _delegate.shadows;
|
||||
@override
|
||||
Color get color => _delegate.color;
|
||||
@override
|
||||
Color get backgroundColor => _delegate.backgroundColor;
|
||||
@override
|
||||
String get debugLabel => _delegate.debugLabel;
|
||||
@override
|
||||
TextDecoration get decoration => _delegate.decoration;
|
||||
@override
|
||||
Color get decorationColor => _delegate.decorationColor;
|
||||
@override
|
||||
TextDecorationStyle get decorationStyle => _delegate.decorationStyle;
|
||||
@override
|
||||
String get fontFamily => _delegate.fontFamily;
|
||||
@override
|
||||
List<String> get fontFamilyFallback => _delegate.fontFamilyFallback;
|
||||
@override
|
||||
double get fontSize => _delegate.fontSize;
|
||||
@override
|
||||
FontStyle get fontStyle => _delegate.fontStyle;
|
||||
@override
|
||||
FontWeight get fontWeight => _delegate.fontWeight;
|
||||
@override
|
||||
double get height => _delegate.height;
|
||||
@override
|
||||
Locale get locale => _delegate.locale;
|
||||
@override
|
||||
ui.Paint get foreground => _delegate.foreground;
|
||||
@override
|
||||
ui.Paint get background => _delegate.background;
|
||||
@override
|
||||
bool get inherit => _delegate.inherit;
|
||||
@override
|
||||
double get letterSpacing => _delegate.letterSpacing;
|
||||
@override
|
||||
TextBaseline get textBaseline => _delegate.textBaseline;
|
||||
@override
|
||||
double get wordSpacing => _delegate.wordSpacing;
|
||||
@override
|
||||
List<Shadow> get shadows => _delegate.shadows;
|
||||
|
||||
@override
|
||||
String toString({ DiagnosticLevel minLevel = DiagnosticLevel.debug }) =>
|
||||
|
||||
@@ -37,37 +37,37 @@ void main() {
|
||||
}
|
||||
|
||||
void _testZeroAndNegativeSizes(BoxFit fit) {
|
||||
FittedSizes result;
|
||||
FittedSizes result;
|
||||
|
||||
result = applyBoxFit(fit, const Size(-400.0, 2000.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(-400.0, 2000.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(400.0, -2000.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(400.0, -2000.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(-100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(-100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(100.0, -1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(100.0, -1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(0.0, 2000.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(0.0, 2000.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(400.0, 0.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(400.0, 0.0), const Size(100.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(0.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(0.0, 1000.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(100.0, 0.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
result = applyBoxFit(fit, const Size(400.0, 2000.0), const Size(100.0, 0.0));
|
||||
expect(result.source, equals(Size.zero));
|
||||
expect(result.destination, equals(Size.zero));
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void main() {
|
||||
expect(mockCodec.numFramesAsked, 1);
|
||||
});
|
||||
|
||||
testWidgets('getNextFrame future fails', (WidgetTester tester) async {
|
||||
testWidgets('getNextFrame future fails', (WidgetTester tester) async {
|
||||
final MockCodec mockCodec = MockCodec();
|
||||
mockCodec.frameCount = 1;
|
||||
final Completer<Codec> codecCompleter = Completer<Codec>();
|
||||
|
||||
@@ -8,10 +8,14 @@ import '../flutter_test_alternative.dart';
|
||||
class RenderTestBox extends RenderBox {
|
||||
double value = 0.0;
|
||||
double next() { value += 1.0; return value; }
|
||||
@override double computeMinIntrinsicWidth(double height) => next();
|
||||
@override double computeMaxIntrinsicWidth(double height) => next();
|
||||
@override double computeMinIntrinsicHeight(double width) => next();
|
||||
@override double computeMaxIntrinsicHeight(double width) => next();
|
||||
@override
|
||||
double computeMinIntrinsicWidth(double height) => next();
|
||||
@override
|
||||
double computeMaxIntrinsicWidth(double height) => next();
|
||||
@override
|
||||
double computeMinIntrinsicHeight(double width) => next();
|
||||
@override
|
||||
double computeMaxIntrinsicHeight(double width) => next();
|
||||
}
|
||||
|
||||
void main() {
|
||||
|
||||
@@ -15,10 +15,14 @@ class RenderFixedSize extends RenderBox {
|
||||
markNeedsLayout();
|
||||
}
|
||||
|
||||
@override double computeMinIntrinsicWidth(double height) => dimension;
|
||||
@override double computeMaxIntrinsicWidth(double height) => dimension;
|
||||
@override double computeMinIntrinsicHeight(double width) => dimension;
|
||||
@override double computeMaxIntrinsicHeight(double width) => dimension;
|
||||
@override
|
||||
double computeMinIntrinsicWidth(double height) => dimension;
|
||||
@override
|
||||
double computeMaxIntrinsicWidth(double height) => dimension;
|
||||
@override
|
||||
double computeMinIntrinsicHeight(double width) => dimension;
|
||||
@override
|
||||
double computeMaxIntrinsicHeight(double width) => dimension;
|
||||
|
||||
@override
|
||||
void performLayout() {
|
||||
|
||||
@@ -51,4 +51,4 @@ void main() {
|
||||
expect(key1, equals(key2));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,58 +93,58 @@ void main() {
|
||||
expect(copied.platformBrightness, Brightness.dark);
|
||||
});
|
||||
|
||||
testWidgets('MediaQuery.removePadding removes specified padding', (WidgetTester tester) async {
|
||||
const Size size = Size(2.0, 4.0);
|
||||
const double devicePixelRatio = 2.0;
|
||||
const double textScaleFactor = 1.2;
|
||||
const EdgeInsets padding = EdgeInsets.only(top: 1.0, right: 2.0, left: 3.0, bottom: 4.0);
|
||||
const EdgeInsets viewInsets = EdgeInsets.only(top: 5.0, right: 6.0, left: 7.0, bottom: 8.0);
|
||||
testWidgets('MediaQuery.removePadding removes specified padding', (WidgetTester tester) async {
|
||||
const Size size = Size(2.0, 4.0);
|
||||
const double devicePixelRatio = 2.0;
|
||||
const double textScaleFactor = 1.2;
|
||||
const EdgeInsets padding = EdgeInsets.only(top: 1.0, right: 2.0, left: 3.0, bottom: 4.0);
|
||||
const EdgeInsets viewInsets = EdgeInsets.only(top: 5.0, right: 6.0, left: 7.0, bottom: 8.0);
|
||||
|
||||
MediaQueryData unpadded;
|
||||
await tester.pumpWidget(
|
||||
MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
size: size,
|
||||
devicePixelRatio: devicePixelRatio,
|
||||
textScaleFactor: textScaleFactor,
|
||||
padding: padding,
|
||||
viewInsets: viewInsets,
|
||||
alwaysUse24HourFormat: true,
|
||||
accessibleNavigation: true,
|
||||
invertColors: true,
|
||||
disableAnimations: true,
|
||||
boldText: true,
|
||||
),
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeLeft: true,
|
||||
removeTop: true,
|
||||
removeRight: true,
|
||||
removeBottom: true,
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
unpadded = MediaQuery.of(context);
|
||||
return Container();
|
||||
}
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
);
|
||||
MediaQueryData unpadded;
|
||||
await tester.pumpWidget(
|
||||
MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
size: size,
|
||||
devicePixelRatio: devicePixelRatio,
|
||||
textScaleFactor: textScaleFactor,
|
||||
padding: padding,
|
||||
viewInsets: viewInsets,
|
||||
alwaysUse24HourFormat: true,
|
||||
accessibleNavigation: true,
|
||||
invertColors: true,
|
||||
disableAnimations: true,
|
||||
boldText: true,
|
||||
),
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
return MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeLeft: true,
|
||||
removeTop: true,
|
||||
removeRight: true,
|
||||
removeBottom: true,
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
unpadded = MediaQuery.of(context);
|
||||
return Container();
|
||||
}
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
expect(unpadded.size, size);
|
||||
expect(unpadded.devicePixelRatio, devicePixelRatio);
|
||||
expect(unpadded.textScaleFactor, textScaleFactor);
|
||||
expect(unpadded.padding, EdgeInsets.zero);
|
||||
expect(unpadded.viewInsets, viewInsets);
|
||||
expect(unpadded.alwaysUse24HourFormat, true);
|
||||
expect(unpadded.accessibleNavigation, true);
|
||||
expect(unpadded.invertColors, true);
|
||||
expect(unpadded.disableAnimations, true);
|
||||
expect(unpadded.boldText, true);
|
||||
expect(unpadded.size, size);
|
||||
expect(unpadded.devicePixelRatio, devicePixelRatio);
|
||||
expect(unpadded.textScaleFactor, textScaleFactor);
|
||||
expect(unpadded.padding, EdgeInsets.zero);
|
||||
expect(unpadded.viewInsets, viewInsets);
|
||||
expect(unpadded.alwaysUse24HourFormat, true);
|
||||
expect(unpadded.accessibleNavigation, true);
|
||||
expect(unpadded.invertColors, true);
|
||||
expect(unpadded.disableAnimations, true);
|
||||
expect(unpadded.boldText, true);
|
||||
});
|
||||
|
||||
testWidgets('MediaQuery.removeViewInsets removes specified viewInsets', (WidgetTester tester) async {
|
||||
@@ -201,32 +201,32 @@ void main() {
|
||||
expect(unpadded.boldText, true);
|
||||
});
|
||||
|
||||
testWidgets('MediaQuery.textScaleFactorOf', (WidgetTester tester) async {
|
||||
double outsideTextScaleFactor;
|
||||
double insideTextScaleFactor;
|
||||
testWidgets('MediaQuery.textScaleFactorOf', (WidgetTester tester) async {
|
||||
double outsideTextScaleFactor;
|
||||
double insideTextScaleFactor;
|
||||
|
||||
await tester.pumpWidget(
|
||||
Builder(
|
||||
builder: (BuildContext context) {
|
||||
outsideTextScaleFactor = MediaQuery.textScaleFactorOf(context);
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
textScaleFactor: 4.0,
|
||||
),
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
insideTextScaleFactor = MediaQuery.textScaleFactorOf(context);
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
await tester.pumpWidget(
|
||||
Builder(
|
||||
builder: (BuildContext context) {
|
||||
outsideTextScaleFactor = MediaQuery.textScaleFactorOf(context);
|
||||
return MediaQuery(
|
||||
data: const MediaQueryData(
|
||||
textScaleFactor: 4.0,
|
||||
),
|
||||
child: Builder(
|
||||
builder: (BuildContext context) {
|
||||
insideTextScaleFactor = MediaQuery.textScaleFactorOf(context);
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
expect(outsideTextScaleFactor, 1.0);
|
||||
expect(insideTextScaleFactor, 4.0);
|
||||
});
|
||||
expect(outsideTextScaleFactor, 1.0);
|
||||
expect(insideTextScaleFactor, 4.0);
|
||||
});
|
||||
|
||||
testWidgets('MediaQuery.platformBrightnessOf', (WidgetTester tester) async {
|
||||
Brightness outsideBrightness;
|
||||
|
||||
@@ -217,23 +217,23 @@ void main() {
|
||||
class FirstWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/modal');
|
||||
},
|
||||
child: Container(
|
||||
child: const Text('X'),
|
||||
),
|
||||
);
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, '/modal');
|
||||
},
|
||||
child: Container(
|
||||
child: const Text('X'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class SecondWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const ModalBarrier(
|
||||
key: ValueKey<String>('barrier'),
|
||||
dismissible: true,
|
||||
);
|
||||
return const ModalBarrier(
|
||||
key: ValueKey<String>('barrier'),
|
||||
dismissible: true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,4 +40,4 @@ void main() {
|
||||
final RenderSliver lastRenderSliver = renderViewport.lastChild;
|
||||
expect(lastRenderSliver.constraints.precedingScrollExtent, double.infinity);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ class TestDelegateThatCanThrow extends SliverPersistentHeaderDelegate {
|
||||
|
||||
@override
|
||||
double get minExtent {
|
||||
return shouldThrow ? throw FlutterError('Unavailable minExtent') : 100.0;
|
||||
return shouldThrow ? throw FlutterError('Unavailable minExtent') : 100.0;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -247,7 +247,7 @@ void main() {
|
||||
expect(localizations is MaterialLocalizationZh, true);
|
||||
});
|
||||
|
||||
testWidgets('Serbian resolution', (WidgetTester tester) async {
|
||||
testWidgets('Serbian resolution', (WidgetTester tester) async {
|
||||
Locale locale = const Locale.fromSubtags(languageCode: 'sr', scriptCode: null, countryCode: null);
|
||||
expect(GlobalMaterialLocalizations.delegate.isSupported(locale), isTrue);
|
||||
MaterialLocalizations localizations = await GlobalMaterialLocalizations.delegate.load(locale);
|
||||
|
||||
@@ -137,7 +137,7 @@ class LabeledTapTargetGuideline extends AccessibilityGuideline {
|
||||
|
||||
@override
|
||||
FutureOr<Evaluation> evaluate(WidgetTester tester) {
|
||||
final SemanticsNode root = tester.binding.pipelineOwner.semanticsOwner.rootSemanticsNode;
|
||||
final SemanticsNode root = tester.binding.pipelineOwner.semanticsOwner.rootSemanticsNode;
|
||||
Evaluation traverse(SemanticsNode node) {
|
||||
Evaluation result = const Evaluation.pass();
|
||||
node.visitChildren((SemanticsNode child) {
|
||||
@@ -262,8 +262,8 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
|
||||
return result;
|
||||
final List<int> subset = _subsetToRect(byteData, paintBounds, image.width, image.height);
|
||||
// Node was too far off screen.
|
||||
if (subset.isEmpty)
|
||||
return result;
|
||||
if (subset.isEmpty)
|
||||
return result;
|
||||
final _ContrastReport report = _ContrastReport(subset);
|
||||
final double contrastRatio = report.contrastRatio();
|
||||
const double delta = -0.01;
|
||||
|
||||
@@ -1742,4 +1742,4 @@ class _MockHttpHeaders extends HttpHeaders {
|
||||
|
||||
@override
|
||||
String value(String name) => null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1327,18 +1327,18 @@ class _RendersOnPhysicalModel extends _MatchRenderObject<RenderPhysicalShape, Re
|
||||
}
|
||||
|
||||
bool assertRoundedRectangle(ShapeBorderClipper shapeClipper, BorderRadius borderRadius, Map<dynamic, dynamic> matchState) {
|
||||
if (shapeClipper.shape.runtimeType != RoundedRectangleBorder)
|
||||
return failWithDescription(matchState, 'had shape border: ${shapeClipper.shape}');
|
||||
final RoundedRectangleBorder border = shapeClipper.shape;
|
||||
if (border.borderRadius != borderRadius)
|
||||
return failWithDescription(matchState, 'had borderRadius: ${border.borderRadius}');
|
||||
return true;
|
||||
if (shapeClipper.shape.runtimeType != RoundedRectangleBorder)
|
||||
return failWithDescription(matchState, 'had shape border: ${shapeClipper.shape}');
|
||||
final RoundedRectangleBorder border = shapeClipper.shape;
|
||||
if (border.borderRadius != borderRadius)
|
||||
return failWithDescription(matchState, 'had borderRadius: ${border.borderRadius}');
|
||||
return true;
|
||||
}
|
||||
|
||||
bool assertCircle(ShapeBorderClipper shapeClipper, Map<dynamic, dynamic> matchState) {
|
||||
if (shapeClipper.shape.runtimeType != CircleBorder)
|
||||
return failWithDescription(matchState, 'had shape border: ${shapeClipper.shape}');
|
||||
return true;
|
||||
if (shapeClipper.shape.runtimeType != CircleBorder)
|
||||
return failWithDescription(matchState, 'had shape border: ${shapeClipper.shape}');
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -339,4 +339,4 @@ class TestWindow implements Window {
|
||||
clearTextScaleFactorTestValue();
|
||||
clearViewInsetsTestValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('Labeled tappable node guideline', () {
|
||||
group('Labeled tappable node guideline', () {
|
||||
testWidgets('Passes when node is labeled', (WidgetTester tester) async {
|
||||
final SemanticsHandle handle = tester.ensureSemantics();
|
||||
await tester.pumpWidget(_boilerplate(Semantics(
|
||||
|
||||
@@ -253,4 +253,4 @@ class FakeAccessibilityFeatures implements AccessibilityFeatures {
|
||||
|
||||
@override
|
||||
final bool reduceMotion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ class AndroidApk extends ApplicationPackage {
|
||||
return null;
|
||||
}
|
||||
|
||||
final List<String> aaptArgs = <String>[
|
||||
final List<String> aaptArgs = <String>[
|
||||
aaptPath,
|
||||
'dump',
|
||||
'xmltree',
|
||||
|
||||
@@ -279,4 +279,4 @@ class BuildScriptGenerator {
|
||||
|
||||
/// Whether [child] specifies that it wants to run before [parent].
|
||||
bool _mustRunBefore(BuilderDefinition parent, BuilderDefinition child) => child.runsBefore.contains(parent.key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,4 +27,4 @@ class GenerateCommand extends FlutterCommand {
|
||||
await codeGenerator.generate(mainPath: argResults['target']);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@ class Utf8Decoder extends cnv.Utf8Decoder {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,20 +386,16 @@ class DevFS {
|
||||
this.rootDirectory, {
|
||||
String packagesFilePath,
|
||||
}) : _operations = ServiceProtocolDevFSOperations(serviceProtocol),
|
||||
_httpWriter = _DevFSHttpWriter(fsName, serviceProtocol) {
|
||||
_packagesFilePath =
|
||||
packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
|
||||
}
|
||||
_httpWriter = _DevFSHttpWriter(fsName, serviceProtocol),
|
||||
_packagesFilePath = packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
|
||||
|
||||
DevFS.operations(
|
||||
this._operations,
|
||||
this.fsName,
|
||||
this.rootDirectory, {
|
||||
String packagesFilePath,
|
||||
}) : _httpWriter = null {
|
||||
_packagesFilePath =
|
||||
packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
|
||||
}
|
||||
}) : _httpWriter = null,
|
||||
_packagesFilePath = packagesFilePath ?? fs.path.join(rootDirectory.path, kPackagesFileName);
|
||||
|
||||
final DevFSOperations _operations;
|
||||
final _DevFSHttpWriter _httpWriter;
|
||||
|
||||
@@ -435,4 +435,4 @@ void _validateFonts(YamlList fonts, List<String> errors) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,8 @@ class _FuchsiaLogReader extends DeviceLogReader {
|
||||
FuchsiaDevice _device;
|
||||
ApplicationPackage _app;
|
||||
|
||||
@override String get name => _device.name;
|
||||
@override
|
||||
String get name => _device.name;
|
||||
|
||||
Stream<String> _logLines;
|
||||
@override
|
||||
|
||||
@@ -16,13 +16,13 @@ bool _isBundleDirectory(FileSystemEntity entity) =>
|
||||
abstract class MacOSApp extends ApplicationPackage {
|
||||
MacOSApp({@required String projectBundleId}) : super(id: projectBundleId);
|
||||
|
||||
/// Creates a new [MacOSApp] from an existing app bundle.
|
||||
///
|
||||
/// `applicationBinary` is the path to the framework directory created by an
|
||||
/// Xcode build. By default, this is located under
|
||||
/// "~/Library/Developer/Xcode/DerivedData/" and contains an executable
|
||||
/// which is expected to start the application and send the observatory
|
||||
/// port over stdout.
|
||||
/// Creates a new [MacOSApp] from an existing app bundle.
|
||||
///
|
||||
/// `applicationBinary` is the path to the framework directory created by an
|
||||
/// Xcode build. By default, this is located under
|
||||
/// "~/Library/Developer/Xcode/DerivedData/" and contains an executable
|
||||
/// which is expected to start the application and send the observatory
|
||||
/// port over stdout.
|
||||
factory MacOSApp.fromPrebuiltApp(FileSystemEntity applicationBinary) {
|
||||
final FileSystemEntityType entityType = fs.typeSync(applicationBinary.path);
|
||||
if (entityType == FileSystemEntityType.notFound) {
|
||||
@@ -71,7 +71,7 @@ abstract class MacOSApp extends ApplicationPackage {
|
||||
String get executable;
|
||||
}
|
||||
|
||||
class PrebuiltMacOSApp extends MacOSApp {
|
||||
class PrebuiltMacOSApp extends MacOSApp {
|
||||
PrebuiltMacOSApp({
|
||||
@required this.bundleDir,
|
||||
@required this.bundleName,
|
||||
|
||||
@@ -467,7 +467,7 @@ class WebProject {
|
||||
|
||||
final FlutterProject parent;
|
||||
|
||||
Future<void> ensureReadyForPlatformSpecificTooling() async {
|
||||
Future<void> ensureReadyForPlatformSpecificTooling() async {
|
||||
/// Generate index.html in build/web. Eventually we could support
|
||||
/// a custom html under the web sub directory.
|
||||
final Directory outputDir = fs.directory(getWebBuildDirectory());
|
||||
|
||||
@@ -33,4 +33,4 @@ void main() {
|
||||
});
|
||||
}
|
||||
|
||||
class MockPlatform extends Mock implements Platform {}
|
||||
class MockPlatform extends Mock implements Platform {}
|
||||
|
||||
@@ -162,4 +162,4 @@ class MockFile extends Mock implements File {
|
||||
class MockRandomAccessFile extends Mock implements RandomAccessFile {}
|
||||
class MockCachedArtifact extends Mock implements CachedArtifact {}
|
||||
class MockInternetAddress extends Mock implements InternetAddress {}
|
||||
class MockCache extends Mock implements Cache {}
|
||||
class MockCache extends Mock implements Cache {}
|
||||
|
||||
@@ -212,7 +212,7 @@ void main() {
|
||||
});
|
||||
|
||||
|
||||
group('doctor with fake validators', () {
|
||||
group('doctor with fake validators', () {
|
||||
testUsingContext('validate non-verbose output format for run without issues', () async {
|
||||
expect(await FakeQuietDoctor().diagnose(verbose: false), isTrue);
|
||||
expect(testLogger.statusText, equals(
|
||||
|
||||
@@ -144,17 +144,16 @@ Future<void> evaluateTrivialExpressions(FlutterTestDriver flutter) async {
|
||||
|
||||
Future<void> evaluateComplexExpressions(FlutterTestDriver flutter) async {
|
||||
final InstanceRef res = await flutter.evaluateInFrame('new DateTime.now().year');
|
||||
expect(res.kind == InstanceKind.kInt && res.valueAsString == DateTime.now().year.toString(), isTrue);
|
||||
expect(res.kind == InstanceKind.kInt && res.valueAsString == DateTime.now().year.toString(), isTrue);
|
||||
}
|
||||
|
||||
Future<void> evaluateComplexReturningExpressions(FlutterTestDriver flutter) async {
|
||||
final DateTime now = DateTime.now();
|
||||
final InstanceRef resp = await flutter.evaluateInFrame('new DateTime.now()');
|
||||
expect(resp.classRef.name, equals('DateTime'));
|
||||
// Ensure we got a reasonable approximation. The more accurate we try to
|
||||
// make this, the more likely it'll fail due to differences in the time
|
||||
// in the remote VM and the local VM at the time the code runs.
|
||||
final InstanceRef res = await flutter.evaluate(resp.id, r'"$year-$month-$day"');
|
||||
expect(res.valueAsString,
|
||||
equals('${now.year}-${now.month}-${now.day}'));
|
||||
final InstanceRef resp = await flutter.evaluateInFrame('new DateTime.now()');
|
||||
expect(resp.classRef.name, equals('DateTime'));
|
||||
// Ensure we got a reasonable approximation. The more accurate we try to
|
||||
// make this, the more likely it'll fail due to differences in the time
|
||||
// in the remote VM and the local VM at the time the code runs.
|
||||
final InstanceRef res = await flutter.evaluate(resp.id, r'"$year-$month-$day"');
|
||||
expect(res.valueAsString, equals('${now.year}-${now.month}-${now.day}'));
|
||||
}
|
||||
|
||||
@@ -51,4 +51,4 @@ void main() {
|
||||
}
|
||||
|
||||
class MockProcessManager extends Mock implements ProcessManager {}
|
||||
class MockProcess extends Mock implements Process {}
|
||||
class MockProcess extends Mock implements Process {}
|
||||
|
||||
Reference in New Issue
Block a user