forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove deprecated
InteractiveViewer.alignPanAxis
(flutter#142500)
- Loading branch information
1 parent
59da873
commit fcd154b
Showing
4 changed files
with
145 additions
and
29 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
packages/flutter/lib/fix_data/fix_widgets/fix_interactive_viewer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# 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 for InteractiveViewer from the widgets library. * | ||
version: 1 | ||
transforms: | ||
# Change made in https://github.com/flutter/flutter/pull/109014 | ||
- title: "Migrate to 'panAxis'" | ||
date: 2024-02-22 | ||
element: | ||
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ] | ||
constructor: '' | ||
inClass: 'InteractiveViewer' | ||
variables: | ||
alignPanAxis: | ||
kind: 'fragment' | ||
value: 'arguments[alignPanAxis]' | ||
panAxis: | ||
kind: 'fragment' | ||
value: 'arguments[panAxis]' | ||
oneOf: | ||
- if: "panAxis == '' && alignPanAxis == 'true'" | ||
changes: | ||
- kind: 'addParameter' | ||
index: 0 | ||
name: 'panAxis' | ||
style: optional_named | ||
argumentValue: | ||
expression: 'PanAxis.aligned' | ||
requiredIf: "alignPanAxis == 'true'" | ||
- kind: 'removeParameter' | ||
name: 'alignPanAxis' | ||
- if: "panAxis == '' && alignPanAxis == 'false'" | ||
changes: | ||
- kind: 'addParameter' | ||
index: 0 | ||
name: 'panAxis' | ||
style: optional_named | ||
argumentValue: | ||
expression: 'PanAxis.free' | ||
requiredIf: "alignPanAxis == 'false'" | ||
- kind: 'removeParameter' | ||
name: 'alignPanAxis' | ||
- if: "alignPanAxis != ''" | ||
changes: | ||
- kind: 'removeParameter' | ||
name: 'alignPanAxis' | ||
|
||
# Change made in https://github.com/flutter/flutter/pull/109014 | ||
- title: "Migrate to 'panAxis'" | ||
date: 2024-02-22 | ||
element: | ||
uris: [ 'widgets.dart', 'material.dart', 'cupertino.dart' ] | ||
constructor: 'builder' | ||
inClass: 'InteractiveViewer' | ||
variables: | ||
alignPanAxis: | ||
kind: 'fragment' | ||
value: 'arguments[alignPanAxis]' | ||
panAxis: | ||
kind: 'fragment' | ||
value: 'arguments[panAxis]' | ||
oneOf: | ||
- if: "panAxis == '' && alignPanAxis == 'true'" | ||
changes: | ||
- kind: 'addParameter' | ||
index: 0 | ||
name: 'panAxis' | ||
style: optional_named | ||
argumentValue: | ||
expression: 'PanAxis.aligned' | ||
requiredIf: "alignPanAxis == 'true'" | ||
- kind: 'removeParameter' | ||
name: 'alignPanAxis' | ||
- if: "panAxis == '' && alignPanAxis == 'false'" | ||
changes: | ||
- kind: 'addParameter' | ||
index: 0 | ||
name: 'panAxis' | ||
style: optional_named | ||
argumentValue: | ||
expression: 'PanAxis.free' | ||
requiredIf: "alignPanAxis == 'false'" | ||
- kind: 'removeParameter' | ||
name: 'alignPanAxis' | ||
- if: "alignPanAxis != ''" | ||
changes: | ||
- kind: 'removeParameter' | ||
name: 'alignPanAxis' | ||
|
||
# Before adding a new fix: read instructions at the top of this file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/flutter/test_fixes/widgets/interactive_viewer.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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/widgets.dart'; | ||
|
||
void main() { | ||
// Change made in https://github.com/flutter/flutter/pull/109014 | ||
InteractiveViewer(alignPanAxis: false); | ||
InteractiveViewer.builder(alignPanAxis: false); | ||
|
||
InteractiveViewer(alignPanAxis: true); | ||
InteractiveViewer.builder(alignPanAxis: true); | ||
|
||
InteractiveViewer(alignPanAxis: false, panAxis: PanAxis.aligned,); | ||
InteractiveViewer.builder(alignPanAxis: false, panAxis: PanAxis.aligned,); | ||
|
||
InteractiveViewer(alignPanAxis: true, panAxis: PanAxis.aligned,); | ||
InteractiveViewer.builder(alignPanAxis: true, panAxis: PanAxis.aligned,); | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/flutter/test_fixes/widgets/interactive_viewer.dart.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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/widgets.dart'; | ||
|
||
void main() { | ||
// Change made in https://github.com/flutter/flutter/pull/109014 | ||
InteractiveViewer(panAxis: PanAxis.free); | ||
InteractiveViewer.builder(panAxis: PanAxis.free); | ||
|
||
InteractiveViewer(panAxis: PanAxis.aligned); | ||
InteractiveViewer.builder(panAxis: PanAxis.aligned); | ||
|
||
InteractiveViewer(panAxis: PanAxis.aligned,); | ||
InteractiveViewer.builder(panAxis: PanAxis.aligned,); | ||
|
||
InteractiveViewer(panAxis: PanAxis.aligned,); | ||
InteractiveViewer.builder(panAxis: PanAxis.aligned,); | ||
} |