Unverified Commit 5ccb4d4b authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Rename WindowPadding to ViewPadding (#121152)

* Rename WindowPadding to ViewPadding

* dart fix

* typos
parent 7d85a585
......@@ -15,7 +15,7 @@
# For documentation about this file format, see
# https://dart.dev/go/data-driven-fixes.
# * Fixes in this file are [for CLASS] from the <XXX> library. *
# * Fixes in this file are from the Gestures library. *
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/28602
......
......@@ -15,7 +15,6 @@
# For documentation about this file format, see
# https://dart.dev/go/data-driven-fixes.
# * Fixes in this file are for the ThemeData class from the Material library. *
# For fixes to
# * AppBar: fix_app_bar.yaml
......
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# For details regarding the *Flutter Fix* feature, see
# https://flutter.dev/docs/development/tools/flutter-fix
# Please add new fixes to the top of the file, separated by one blank line
# from other fixes. In a comment, include a link to the PR where the change
# requiring the fix was made.
# Every fix must be tested. See the flutter/packages/flutter/test_fixes/README.md
# file for instructions on testing these data driven fixes.
# For documentation about this file format, see
# https://dart.dev/go/data-driven-fixes.
# * Fixes in this file are from the Painting library. *
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/121152
- title: "Rename to 'fromViewPadding'"
date: 2022-02-21
element:
uris: [ 'painting.dart' ]
constructor: 'fromWindowPadding'
inClass: 'EdgeInsets'
changes:
- kind: 'rename'
newName: 'fromViewPadding'
# Before adding a new fix: read instructions at the top of this file.
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' as ui show WindowPadding, lerpDouble;
import 'dart:ui' as ui show ViewPadding, lerpDouble;
import 'package:flutter/foundation.dart';
......@@ -397,18 +397,27 @@ class EdgeInsets extends EdgeInsetsGeometry {
right = horizontal,
bottom = vertical;
/// Creates insets that match the given window padding.
/// Creates insets that match the given view padding.
///
/// If you need the current system padding or view insets in the context of a
/// widget, consider using [MediaQuery.of] to obtain these values rather than
/// using the value from a [FlutterView] directly, so that you get notified of
/// changes.
EdgeInsets.fromWindowPadding(ui.WindowPadding padding, double devicePixelRatio)
EdgeInsets.fromViewPadding(ui.ViewPadding padding, double devicePixelRatio)
: left = padding.left / devicePixelRatio,
top = padding.top / devicePixelRatio,
right = padding.right / devicePixelRatio,
bottom = padding.bottom / devicePixelRatio;
/// Deprecated. Will be removed in a future version of Flutter.
///
/// Use [EdgeInsets.fromViewPadding] instead.
@Deprecated(
'Use EdgeInsets.fromViewPadding instead. '
'This feature was deprecated after v3.8.0-14.0.pre.',
)
factory EdgeInsets.fromWindowPadding(ui.ViewPadding padding, double devicePixelRatio) = EdgeInsets.fromViewPadding;
/// An [EdgeInsets] with zero offsets in each direction.
static const EdgeInsets zero = EdgeInsets.only();
......
......@@ -211,10 +211,10 @@ class MediaQueryData {
devicePixelRatio = view.devicePixelRatio,
textScaleFactor = platformData?.textScaleFactor ?? view.platformDispatcher.textScaleFactor,
platformBrightness = platformData?.platformBrightness ?? view.platformDispatcher.platformBrightness,
padding = EdgeInsets.fromWindowPadding(view.padding, view.devicePixelRatio),
viewPadding = EdgeInsets.fromWindowPadding(view.viewPadding, view.devicePixelRatio),
viewInsets = EdgeInsets.fromWindowPadding(view.viewInsets, view.devicePixelRatio),
systemGestureInsets = EdgeInsets.fromWindowPadding(view.systemGestureInsets, view.devicePixelRatio),
padding = EdgeInsets.fromViewPadding(view.padding, view.devicePixelRatio),
viewPadding = EdgeInsets.fromViewPadding(view.viewPadding, view.devicePixelRatio),
viewInsets = EdgeInsets.fromViewPadding(view.viewInsets, view.devicePixelRatio),
systemGestureInsets = EdgeInsets.fromViewPadding(view.systemGestureInsets, view.devicePixelRatio),
accessibleNavigation = platformData?.accessibleNavigation ?? view.platformDispatcher.accessibilityFeatures.accessibleNavigation,
invertColors = platformData?.invertColors ?? view.platformDispatcher.accessibilityFeatures.invertColors,
disableAnimations = platformData?.disableAnimations ?? view.platformDispatcher.accessibilityFeatures.disableAnimations,
......
......@@ -241,12 +241,12 @@ void main() {
testWidgets('test page transition (_ZoomPageTransition) with rasterization re-rasterizes when window insets', (WidgetTester tester) async {
late Size oldSize;
late ui.WindowPadding oldInsets;
late ui.ViewPadding oldInsets;
try {
oldSize = tester.binding.window.physicalSize;
oldInsets = tester.binding.window.viewInsets;
tester.binding.window.physicalSizeTestValue = const Size(1000, 1000);
tester.binding.window.viewInsetsTestValue = ui.WindowPadding.zero;
tester.binding.window.viewInsetsTestValue = ui.ViewPadding.zero;
// Intentionally use nested scaffolds to simulate the view insets being
// consumed.
......@@ -275,7 +275,7 @@ void main() {
await expectLater(find.byKey(key), matchesGoldenFile('zoom_page_transition.small.png'));
// Change the view insets
tester.binding.window.viewInsetsTestValue = const TestWindowPadding(left: 0, top: 0, right: 0, bottom: 500);
tester.binding.window.viewInsetsTestValue = const TestViewPadding(left: 0, top: 0, right: 0, bottom: 500);
await tester.pump();
await tester.pump(const Duration(milliseconds: 50));
......@@ -1330,8 +1330,8 @@ class TestDependencies extends StatelessWidget {
}
}
class TestWindowPadding implements ui.WindowPadding {
const TestWindowPadding({
class TestViewPadding implements ui.ViewPadding {
const TestViewPadding({
required this.left,
required this.top,
required this.right,
......
......@@ -14,7 +14,7 @@
library;
import 'dart:math' as math;
import 'dart:ui' as ui show BoxHeightStyle, BoxWidthStyle, WindowPadding;
import 'dart:ui' as ui show BoxHeightStyle, BoxWidthStyle, ViewPadding;
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
......@@ -142,8 +142,8 @@ class TestFormatter extends TextInputFormatter {
// Used to set window.viewInsets since the real ui.WindowPadding has only a
// private constructor.
class _TestWindowPadding implements ui.WindowPadding {
const _TestWindowPadding({
class _TestViewPadding implements ui.ViewPadding {
const _TestViewPadding({
required this.bottom,
});
......@@ -3384,7 +3384,7 @@ void main() {
// Add a viewInset tall enough to push the field to the top, where there
// is no room to display the toolbar above. This is similar to when the
// keyboard is shown.
tester.binding.window.viewInsetsTestValue = const _TestWindowPadding(
tester.binding.window.viewInsetsTestValue = const _TestViewPadding(
bottom: 500.0,
);
addTearDown(tester.binding.window.clearViewInsetsTestValue);
......
......@@ -18,7 +18,7 @@ void main() {
void setupTestDevice() {
final TestWidgetsFlutterBinding binding = TestWidgetsFlutterBinding.ensureInitialized();
const FakeWindowPadding padding = FakeWindowPadding(
const FakeViewPadding padding = FakeViewPadding(
top: statusBarHeight * devicePixelRatio,
bottom: navigationBarHeight * devicePixelRatio,
);
......@@ -297,8 +297,8 @@ void main() {
});
}
class FakeWindowPadding implements WindowPadding {
const FakeWindowPadding({
class FakeViewPadding implements ViewPadding {
const FakeViewPadding({
this.left = 0.0,
this.top = 0.0,
this.right = 0.0,
......
......@@ -46,8 +46,8 @@ class _MatchesMethodCall extends Matcher {
// Used to set window.viewInsets since the real ui.WindowPadding has only a
// private constructor.
class _TestWindowPadding implements ui.WindowPadding {
const _TestWindowPadding({
class _TestViewPadding implements ui.ViewPadding {
const _TestViewPadding({
required this.bottom,
});
......@@ -164,7 +164,7 @@ void main() {
await tester.pumpWidget(widget);
await tester.showKeyboard(find.byType(EditableText));
TestWidgetsFlutterBinding.instance.window.viewInsetsTestValue = const _TestWindowPadding(bottom: 500);
TestWidgetsFlutterBinding.instance.window.viewInsetsTestValue = const _TestViewPadding(bottom: 500);
addTearDown(TestWidgetsFlutterBinding.instance.window.clearViewInsetsTestValue);
textController.selection = TextSelection(
baseOffset: 0,
......@@ -215,7 +215,7 @@ void main() {
);
await tester.pumpWidget(widget);
await tester.showKeyboard(find.byType(EditableText));
TestWidgetsFlutterBinding.instance.window.viewInsetsTestValue = const _TestWindowPadding(bottom: 500);
TestWidgetsFlutterBinding.instance.window.viewInsetsTestValue = const _TestViewPadding(bottom: 500);
addTearDown(TestWidgetsFlutterBinding.instance.window.clearViewInsetsTestValue);
await tester.pump();
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
import 'dart:ui' as ui;
import 'dart:ui' show WindowPadding;
import 'dart:ui' show ViewPadding;
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
......@@ -184,8 +184,8 @@ class MyStatefulWidgetState extends State<MyStatefulWidget> {
Widget build(BuildContext context) => Text(widget.value);
}
class FakeWindowPadding implements WindowPadding {
const FakeWindowPadding({
class FakeViewPadding implements ViewPadding {
const FakeViewPadding({
this.left = 0.0,
this.top = 0.0,
this.right = 0.0,
......@@ -3097,7 +3097,7 @@ Future<void> main() async {
final TestImageProvider imageProvider = TestImageProvider(testImage);
final TestWidgetsFlutterBinding testBinding = tester.binding;
testBinding.window.paddingTestValue = const FakeWindowPadding(top: 50);
testBinding.window.paddingTestValue = const FakeViewPadding(top: 50);
await tester.pumpWidget(
MaterialApp(
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:ui' show Brightness, DisplayFeature, DisplayFeatureState, DisplayFeatureType, GestureSettings, PlatformDispatcher, ViewConfiguration, WindowPadding;
import 'dart:ui' show Brightness, DisplayFeature, DisplayFeatureState, DisplayFeatureType, GestureSettings, PlatformDispatcher, ViewConfiguration, ViewPadding;
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
......@@ -176,10 +176,10 @@ void main() {
final TestView view = TestView(
physicalSize: const Size(300, 600),
devicePixelRatio: 3.0,
padding: const TestWindowPadding(15),
viewPadding: const TestWindowPadding(75),
viewInsets: const TestWindowPadding(45),
systemGestureInsets: const TestWindowPadding(9),
padding: const TestViewPadding(15),
viewPadding: const TestViewPadding(75),
viewInsets: const TestViewPadding(45),
systemGestureInsets: const TestViewPadding(9),
);
final MediaQueryData data = MediaQueryData.fromView(view, platformData: platformData);
......@@ -189,10 +189,10 @@ void main() {
expect(data.devicePixelRatio, view.devicePixelRatio);
expect(data.textScaleFactor, platformData.textScaleFactor);
expect(data.platformBrightness, platformData.platformBrightness);
expect(data.padding, EdgeInsets.fromWindowPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromWindowPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromWindowPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromWindowPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.padding, EdgeInsets.fromViewPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromViewPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromViewPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromViewPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.accessibleNavigation, platformData.accessibleNavigation);
expect(data.invertColors, platformData.invertColors);
expect(data.disableAnimations, platformData.disableAnimations);
......@@ -216,10 +216,10 @@ void main() {
platformDispatcher: platformDispatcher,
physicalSize: const Size(300, 600),
devicePixelRatio: 3.0,
padding: const TestWindowPadding(15),
viewPadding: const TestWindowPadding(75),
viewInsets: const TestWindowPadding(45),
systemGestureInsets: const TestWindowPadding(9),
padding: const TestViewPadding(15),
viewPadding: const TestViewPadding(75),
viewInsets: const TestViewPadding(45),
systemGestureInsets: const TestViewPadding(9),
);
final MediaQueryData data = MediaQueryData.fromView(view);
......@@ -229,10 +229,10 @@ void main() {
expect(data.devicePixelRatio, view.devicePixelRatio);
expect(data.textScaleFactor, platformDispatcher.textScaleFactor);
expect(data.platformBrightness, platformDispatcher.platformBrightness);
expect(data.padding, EdgeInsets.fromWindowPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromWindowPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromWindowPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromWindowPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.padding, EdgeInsets.fromViewPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromViewPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromViewPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromViewPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.accessibleNavigation, platformDispatcher.accessibilityFeatures.accessibleNavigation);
expect(data.invertColors, platformDispatcher.accessibilityFeatures.invertColors);
expect(data.disableAnimations, platformDispatcher.accessibilityFeatures.disableAnimations);
......@@ -260,10 +260,10 @@ void main() {
final TestView view = TestView(
physicalSize: const Size(300, 600),
devicePixelRatio: 3.0,
padding: const TestWindowPadding(15),
viewPadding: const TestWindowPadding(75),
viewInsets: const TestWindowPadding(45),
systemGestureInsets: const TestWindowPadding(9),
padding: const TestViewPadding(15),
viewPadding: const TestViewPadding(75),
viewInsets: const TestViewPadding(45),
systemGestureInsets: const TestViewPadding(9),
);
late MediaQueryData data;
......@@ -285,10 +285,10 @@ void main() {
expect(data.devicePixelRatio, view.devicePixelRatio);
expect(data.textScaleFactor, platformData.textScaleFactor);
expect(data.platformBrightness, platformData.platformBrightness);
expect(data.padding, EdgeInsets.fromWindowPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromWindowPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromWindowPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromWindowPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.padding, EdgeInsets.fromViewPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromViewPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromViewPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromViewPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.accessibleNavigation, platformData.accessibleNavigation);
expect(data.invertColors, platformData.invertColors);
expect(data.disableAnimations, platformData.disableAnimations);
......@@ -312,10 +312,10 @@ void main() {
platformDispatcher: platformDispatcher,
physicalSize: const Size(300, 600),
devicePixelRatio: 3.0,
padding: const TestWindowPadding(15),
viewPadding: const TestWindowPadding(75),
viewInsets: const TestWindowPadding(45),
systemGestureInsets: const TestWindowPadding(9),
padding: const TestViewPadding(15),
viewPadding: const TestViewPadding(75),
viewInsets: const TestViewPadding(45),
systemGestureInsets: const TestViewPadding(9),
);
late MediaQueryData data;
......@@ -343,10 +343,10 @@ void main() {
expect(data.devicePixelRatio, view.devicePixelRatio);
expect(data.textScaleFactor, platformDispatcher.textScaleFactor);
expect(data.platformBrightness, platformDispatcher.platformBrightness);
expect(data.padding, EdgeInsets.fromWindowPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromWindowPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromWindowPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromWindowPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.padding, EdgeInsets.fromViewPadding(view.padding, view.devicePixelRatio));
expect(data.viewPadding, EdgeInsets.fromViewPadding(view.viewPadding, view.devicePixelRatio));
expect(data.viewInsets, EdgeInsets.fromViewPadding(view.viewInsets, view.devicePixelRatio));
expect(data.systemGestureInsets, EdgeInsets.fromViewPadding(view.systemGestureInsets, view.devicePixelRatio));
expect(data.accessibleNavigation, platformDispatcher.accessibilityFeatures.accessibleNavigation);
expect(data.invertColors, platformDispatcher.accessibilityFeatures.invertColors);
expect(data.disableAnimations, platformDispatcher.accessibilityFeatures.disableAnimations);
......@@ -1533,13 +1533,13 @@ class TestView implements FlutterView {
@override
final double devicePixelRatio;
@override
final WindowPadding padding;
final ViewPadding padding;
@override
final WindowPadding viewPadding;
final ViewPadding viewPadding;
@override
final WindowPadding viewInsets;
final ViewPadding viewInsets;
@override
final WindowPadding systemGestureInsets;
final ViewPadding systemGestureInsets;
@override
final ViewConfiguration viewConfiguration = const ViewConfiguration();
@override
......@@ -1549,8 +1549,8 @@ class TestView implements FlutterView {
dynamic noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
class TestWindowPadding implements WindowPadding {
const TestWindowPadding(this.value);
class TestViewPadding implements ViewPadding {
const TestViewPadding(this.value);
final double value;
@override
......
// Copyright 2014 The Flutter 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/painting.dart';
void main() {
// Change made in https://github.com/flutter/flutter/pull/121152
final EdgeInsets insets = EdgeInsets.fromWindowPadding(ViewPadding.zero, 3.0);
}
// Copyright 2014 The Flutter 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/painting.dart';
void main() {
// Change made in https://github.com/flutter/flutter/pull/121152
final EdgeInsets insets = EdgeInsets.fromViewPadding(ViewPadding.zero, 3.0);
}
......@@ -98,11 +98,11 @@ class TestWindow implements ui.SingletonFlutterWindow {
}
@override
ui.WindowPadding get viewInsets => _viewInsetsTestValue ?? _window.viewInsets;
ui.WindowPadding? _viewInsetsTestValue;
ui.ViewPadding get viewInsets => _viewInsetsTestValue ?? _window.viewInsets;
ui.ViewPadding? _viewInsetsTestValue;
/// Hides the real view insets and reports the given [viewInsetsTestValue]
/// instead.
set viewInsetsTestValue(ui.WindowPadding viewInsetsTestValue) { // ignore: avoid_setters_without_getters
set viewInsetsTestValue(ui.ViewPadding viewInsetsTestValue) { // ignore: avoid_setters_without_getters
_viewInsetsTestValue = viewInsetsTestValue;
onMetricsChanged?.call();
}
......@@ -114,11 +114,11 @@ class TestWindow implements ui.SingletonFlutterWindow {
}
@override
ui.WindowPadding get viewPadding => _viewPaddingTestValue ?? _window.padding;
ui.WindowPadding? _viewPaddingTestValue;
ui.ViewPadding get viewPadding => _viewPaddingTestValue ?? _window.padding;
ui.ViewPadding? _viewPaddingTestValue;
/// Hides the real view padding and reports the given [paddingTestValue]
/// instead.
set viewPaddingTestValue(ui.WindowPadding viewPaddingTestValue) { // ignore: avoid_setters_without_getters
set viewPaddingTestValue(ui.ViewPadding viewPaddingTestValue) { // ignore: avoid_setters_without_getters
_viewPaddingTestValue = viewPaddingTestValue;
onMetricsChanged?.call();
}
......@@ -130,10 +130,10 @@ class TestWindow implements ui.SingletonFlutterWindow {
}
@override
ui.WindowPadding get padding => _paddingTestValue ?? _window.padding;
ui.WindowPadding? _paddingTestValue;
ui.ViewPadding get padding => _paddingTestValue ?? _window.padding;
ui.ViewPadding? _paddingTestValue;
/// Hides the real padding and reports the given [paddingTestValue] instead.
set paddingTestValue(ui.WindowPadding paddingTestValue) { // ignore: avoid_setters_without_getters
set paddingTestValue(ui.ViewPadding paddingTestValue) { // ignore: avoid_setters_without_getters
_paddingTestValue = paddingTestValue;
onMetricsChanged?.call();
}
......@@ -158,10 +158,10 @@ class TestWindow implements ui.SingletonFlutterWindow {
}
@override
ui.WindowPadding get systemGestureInsets => _systemGestureInsetsTestValue ?? _window.systemGestureInsets;
ui.WindowPadding? _systemGestureInsetsTestValue;
ui.ViewPadding get systemGestureInsets => _systemGestureInsetsTestValue ?? _window.systemGestureInsets;
ui.ViewPadding? _systemGestureInsetsTestValue;
/// Hides the real system gesture insets and reports the given [systemGestureInsetsTestValue] instead.
set systemGestureInsetsTestValue(ui.WindowPadding systemGestureInsetsTestValue) { // ignore: avoid_setters_without_getters
set systemGestureInsetsTestValue(ui.ViewPadding systemGestureInsetsTestValue) { // ignore: avoid_setters_without_getters
_systemGestureInsetsTestValue = systemGestureInsetsTestValue;
onMetricsChanged?.call();
}
......
......@@ -3,7 +3,7 @@
// found in the LICENSE file.
import 'dart:ui' as ui show window;
import 'dart:ui' show AccessibilityFeatures, Brightness, Locale, PlatformDispatcher, SemanticsUpdate, SingletonFlutterWindow, Size, WindowPadding;
import 'dart:ui' show AccessibilityFeatures, Brightness, Locale, PlatformDispatcher, SemanticsUpdate, SingletonFlutterWindow, Size, ViewPadding;
import 'package:flutter/semantics.dart' show SemanticsUpdateBuilder;
import 'package:flutter/widgets.dart' show WidgetsBinding, WidgetsBindingObserver;
......@@ -45,28 +45,28 @@ void main() {
});
testWidgets('TestWindow can fake view insets', (WidgetTester tester) async {
verifyThatTestWindowCanFakeProperty<WindowPadding>(
verifyThatTestWindowCanFakeProperty<ViewPadding>(
tester: tester,
realValue: ui.window.viewInsets,
fakeValue: const FakeWindowPadding(),
fakeValue: const FakeViewPadding(),
propertyRetriever: () {
return WidgetsBinding.instance.window.viewInsets;
},
propertyFaker: (TestWidgetsFlutterBinding binding, WindowPadding fakeValue) {
propertyFaker: (TestWidgetsFlutterBinding binding, ViewPadding fakeValue) {
binding.window.viewInsetsTestValue = fakeValue;
},
);
});
testWidgets('TestWindow can fake padding', (WidgetTester tester) async {
verifyThatTestWindowCanFakeProperty<WindowPadding>(
verifyThatTestWindowCanFakeProperty<ViewPadding>(
tester: tester,
realValue: ui.window.padding,
fakeValue: const FakeWindowPadding(),
fakeValue: const FakeViewPadding(),
propertyRetriever: () {
return WidgetsBinding.instance.window.padding;
},
propertyFaker: (TestWidgetsFlutterBinding binding, WindowPadding fakeValue) {
propertyFaker: (TestWidgetsFlutterBinding binding, ViewPadding fakeValue) {
binding.window.paddingTestValue = fakeValue;
},
);
......@@ -245,8 +245,8 @@ TestWidgetsFlutterBinding retrieveTestBinding(WidgetTester tester) {
return testBinding;
}
class FakeWindowPadding implements WindowPadding {
const FakeWindowPadding({
class FakeViewPadding implements ViewPadding {
const FakeViewPadding({
this.left = 0.0,
this.top = 0.0,
this.right = 0.0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment