Add dart fix for DragAnchor deprecation (#80587)

This commit is contained in:
Kate Lovett 2021-04-16 16:24:02 -05:00 committed by GitHub
parent c3a15bf985
commit a0f7694db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 164 additions and 0 deletions

View File

@ -15,6 +15,98 @@
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/79160
- title: "Migrate to 'dragAnchorStrategy'"
date: 2021-04-05
element:
uris: [ 'material.dart', 'widgets.dart', 'cupertino.dart' ]
field: 'dragAnchor'
inClass: 'Draggable'
changes:
- kind: 'rename'
newName: 'dragAnchorStrategy'
# Changes made in https://github.com/flutter/flutter/pull/79160
- title: "Migrate to 'dragAnchorStrategy'"
date: 2021-04-05
element:
uris: [ 'material.dart', 'widgets.dart', 'cupertino.dart' ]
constructor: ''
inClass: 'Draggable'
oneOf:
- if: "dragAnchor == 'DragAnchor.child'"
changes:
- kind: 'addParameter'
index: 9
name: 'dragAnchorStrategy'
style: optional_named
argumentValue:
expression: 'childDragAnchorStrategy'
requiredIf: "dragAnchor == 'DragAnchor.child'"
- kind: 'removeParameter'
name: 'dragAnchor'
- if: "dragAnchor == 'DragAnchor.pointer'"
changes:
- kind: 'addParameter'
index: 9
name: 'dragAnchorStrategy'
style: optional_named
argumentValue:
expression: 'pointerDragAnchorStrategy'
requiredIf: "dragAnchor == 'DragAnchor.pointer'"
- kind: 'removeParameter'
name: 'dragAnchor'
variables:
dragAnchor:
kind: 'fragment'
value: 'arguments[dragAnchor]'
# Changes made in https://github.com/flutter/flutter/pull/79160
- title: "Migrate to 'dragAnchorStrategy'"
date: 2021-04-05
element:
uris: [ 'material.dart', 'widgets.dart', 'cupertino.dart' ]
field: 'dragAnchor'
inClass: 'LongPressDraggable'
changes:
- kind: 'rename'
newName: 'dragAnchorStrategy'
# Changes made in https://github.com/flutter/flutter/pull/79160
- title: "Migrate to 'dragAnchorStrategy'"
date: 2021-04-05
element:
uris: [ 'material.dart', 'widgets.dart', 'cupertino.dart' ]
constructor: ''
inClass: 'LongPressDraggable'
oneOf:
- if: "dragAnchor == 'DragAnchor.child'"
changes:
- kind: 'addParameter'
index: 9
name: 'dragAnchorStrategy'
style: optional_named
argumentValue:
expression: 'childDragAnchorStrategy'
requiredIf: "dragAnchor == 'DragAnchor.child'"
- kind: 'removeParameter'
name: 'dragAnchor'
- if: "dragAnchor == 'DragAnchor.pointer'"
changes:
- kind: 'addParameter'
index: 9
name: 'dragAnchorStrategy'
style: optional_named
argumentValue:
expression: 'pointerDragAnchorStrategy'
requiredIf: "dragAnchor == 'DragAnchor.pointer'"
- kind: 'removeParameter'
name: 'dragAnchor'
variables:
dragAnchor:
kind: 'fragment'
value: 'arguments[dragAnchor]'
# Changes made in https://github.com/flutter/flutter/pull/66482
- title: "Migrate to 'TextSelectionThemeData'"
date: 2020-09-24

View File

@ -127,4 +127,16 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/59127
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(title: myTitle);
bottomNavigationBarItem.title;
// Changes made in https://github.com/flutter/flutter/pull/79160
Draggable draggable = Draggable();
draggable = Draggable(dragAnchor: DragAnchor.child);
draggable = Draggable(dragAnchor: DragAnchor.pointer);
draggable.dragAnchor;
// Changes made in https://github.com/flutter/flutter/pull/79160
LongPressDraggable longPressDraggable = LongPressDraggable();
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.child);
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.pointer);
longPressDraggable.dragAnchor;
}

View File

@ -127,4 +127,16 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/59127
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(label: myTitle);
bottomNavigationBarItem.label;
// Changes made in https://github.com/flutter/flutter/pull/79160
Draggable draggable = Draggable();
draggable = Draggable(dragAnchorStrategy: childDragAnchorStrategy);
draggable = Draggable(dragAnchorStrategy: pointerDragAnchorStrategy);
draggable.dragAnchorStrategy;
// Changes made in https://github.com/flutter/flutter/pull/79160
LongPressDraggable longPressDraggable = LongPressDraggable();
longPressDraggable = LongPressDraggable(dragAnchorStrategy: childDragAnchorStrategy);
longPressDraggable = LongPressDraggable(dragAnchorStrategy: pointerDragAnchorStrategy);
longPressDraggable.dragAnchorStrategy;
}

View File

@ -286,4 +286,16 @@ void main() {
textSelectionHandleColor: Colors.yellow,
useTextSelectionTheme: false,
);
// Changes made in https://github.com/flutter/flutter/pull/79160
Draggable draggable = Draggable();
draggable = Draggable(dragAnchor: DragAnchor.child);
draggable = Draggable(dragAnchor: DragAnchor.pointer);
draggable.dragAnchor;
// Changes made in https://github.com/flutter/flutter/pull/79160
LongPressDraggable longPressDraggable = LongPressDraggable();
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.child);
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.pointer);
longPressDraggable.dragAnchor;
}

View File

@ -258,4 +258,16 @@ void main() {
ThemeData.raw(
textSelectionTheme: TextSelectionThemeData(cursorColor: Colors.blue, selectionColor: Colors.red, selectionHandleColor: Colors.yellow,),
);
// Changes made in https://github.com/flutter/flutter/pull/79160
Draggable draggable = Draggable();
draggable = Draggable(dragAnchorStrategy: childDragAnchorStrategy);
draggable = Draggable(dragAnchorStrategy: pointerDragAnchorStrategy);
draggable.dragAnchorStrategy;
// Changes made in https://github.com/flutter/flutter/pull/79160
LongPressDraggable longPressDraggable = LongPressDraggable();
longPressDraggable = LongPressDraggable(dragAnchorStrategy: childDragAnchorStrategy);
longPressDraggable = LongPressDraggable(dragAnchorStrategy: pointerDragAnchorStrategy);
longPressDraggable.dragAnchorStrategy;
}

View File

@ -95,4 +95,16 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/59127
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(title: myTitle);
bottomNavigationBarItem.title;
// Changes made in https://github.com/flutter/flutter/pull/79160
Draggable draggable = Draggable();
draggable = Draggable(dragAnchor: DragAnchor.child);
draggable = Draggable(dragAnchor: DragAnchor.pointer);
draggable.dragAnchor;
// Changes made in https://github.com/flutter/flutter/pull/79160
LongPressDraggable longPressDraggable = LongPressDraggable();
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.child);
longPressDraggable = LongPressDraggable(dragAnchor: DragAnchor.pointer);
longPressDraggable.dragAnchor;
}

View File

@ -95,4 +95,16 @@ void main() {
// Changes made in https://github.com/flutter/flutter/pull/59127
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(label: myTitle);
bottomNavigationBarItem.label;
// Changes made in https://github.com/flutter/flutter/pull/79160
Draggable draggable = Draggable();
draggable = Draggable(dragAnchorStrategy: childDragAnchorStrategy);
draggable = Draggable(dragAnchorStrategy: pointerDragAnchorStrategy);
draggable.dragAnchorStrategy;
// Changes made in https://github.com/flutter/flutter/pull/79160
LongPressDraggable longPressDraggable = LongPressDraggable();
longPressDraggable = LongPressDraggable(dragAnchorStrategy: childDragAnchorStrategy);
longPressDraggable = LongPressDraggable(dragAnchorStrategy: pointerDragAnchorStrategy);
longPressDraggable.dragAnchorStrategy;
}