Dart Fix for InputDecoration (#78672)
This commit is contained in:
parent
c2d12ea448
commit
0105c8f377
@ -12,6 +12,211 @@
|
|||||||
version: 1
|
version: 1
|
||||||
transforms:
|
transforms:
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
- title: "Migrate to 'floatingLabelBehavior'"
|
||||||
|
date: 2020-01-15
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
field: 'hasFloatingPlaceholder'
|
||||||
|
inClass: 'InputDecorationTheme'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'floatingLabelBehavior'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
- title: "Migrate to 'floatingLabelBehavior'"
|
||||||
|
date: 2020-01-15
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
constructor: ''
|
||||||
|
inClass: 'InputDecorationTheme'
|
||||||
|
oneOf:
|
||||||
|
- if: "hasFloatingPlaceholder == 'true'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% FloatingLabelBehavior %}.auto'
|
||||||
|
requiredIf: "hasFloatingPlaceholder == 'true'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
- if: "hasFloatingPlaceholder == 'false'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% FloatingLabelBehavior %}.never'
|
||||||
|
requiredIf: "hasFloatingPlaceholder == 'false'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
- if: "hasFloatingPlaceholder != 'true' && hasFloatingPlaceholder != 'false'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% hasFloatingPlaceholder %} ? {% FloatingLabelBehavior %}.auto : {% FloatingLabelBehavior %}.never'
|
||||||
|
requiredIf: "hasFloatingPlaceholder != 'true' && hasFloatingPlaceholder != 'false'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
variables:
|
||||||
|
hasFloatingPlaceholder:
|
||||||
|
kind: 'fragment'
|
||||||
|
value: 'arguments[hasFloatingPlaceholder]'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
- title: "Migrate to 'floatingLabelBehavior'"
|
||||||
|
date: 2020-01-15
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
field: 'hasFloatingPlaceholder'
|
||||||
|
inClass: 'InputDecoration'
|
||||||
|
changes:
|
||||||
|
- kind: 'rename'
|
||||||
|
newName: 'floatingLabelBehavior'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
- title: "Rename to 'floatingLabelBehavior'"
|
||||||
|
date: 2020-01-15
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
constructor: 'collapsed'
|
||||||
|
inClass: 'InputDecoration'
|
||||||
|
oneOf:
|
||||||
|
- if: "hasFloatingPlaceholder == 'true'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% FloatingLabelBehavior %}.auto'
|
||||||
|
requiredIf: "hasFloatingPlaceholder == 'true'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
- if: "hasFloatingPlaceholder == 'false'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% FloatingLabelBehavior %}.never'
|
||||||
|
requiredIf: "hasFloatingPlaceholder == 'false'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
- if: "hasFloatingPlaceholder != 'true' && hasFloatingPlaceholder != 'false'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% hasFloatingPlaceholder %} ? {% FloatingLabelBehavior %}.auto : {% FloatingLabelBehavior %}.never'
|
||||||
|
requiredIf: "hasFloatingPlaceholder != 'true' && hasFloatingPlaceholder != 'false'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
variables:
|
||||||
|
hasFloatingPlaceholder:
|
||||||
|
kind: 'fragment'
|
||||||
|
value: 'arguments[hasFloatingPlaceholder]'
|
||||||
|
|
||||||
|
# Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
- title: "Rename to 'floatingLabelBehavior'"
|
||||||
|
date: 2020-01-15
|
||||||
|
element:
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
constructor: ''
|
||||||
|
inClass: 'InputDecoration'
|
||||||
|
oneOf:
|
||||||
|
- if: "hasFloatingPlaceholder == 'true'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% FloatingLabelBehavior %}.auto'
|
||||||
|
requiredIf: "hasFloatingPlaceholder == 'true'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
- if: "hasFloatingPlaceholder == 'false'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% FloatingLabelBehavior %}.never'
|
||||||
|
requiredIf: "hasFloatingPlaceholder == 'false'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
- if: "hasFloatingPlaceholder != 'true' && hasFloatingPlaceholder != 'false'"
|
||||||
|
changes:
|
||||||
|
- kind: 'addParameter'
|
||||||
|
index: 14
|
||||||
|
name: 'floatingLabelBehavior'
|
||||||
|
style: optional_named
|
||||||
|
argumentValue:
|
||||||
|
expression: '{% hasFloatingPlaceholder %} ? {% FloatingLabelBehavior %}.auto : {% FloatingLabelBehavior %}.never'
|
||||||
|
requiredIf: "hasFloatingPlaceholder != 'true' && hasFloatingPlaceholder != 'false'"
|
||||||
|
variables:
|
||||||
|
FloatingLabelBehavior:
|
||||||
|
kind: 'import'
|
||||||
|
uris: [ 'material.dart' ]
|
||||||
|
name: 'FloatingLabelBehavior'
|
||||||
|
- kind: 'removeParameter'
|
||||||
|
name: 'hasFloatingPlaceholder'
|
||||||
|
variables:
|
||||||
|
hasFloatingPlaceholder:
|
||||||
|
kind: 'fragment'
|
||||||
|
value: 'arguments[hasFloatingPlaceholder]'
|
||||||
|
|
||||||
# Changes made in https://github.com/flutter/flutter/pull/59127
|
# Changes made in https://github.com/flutter/flutter/pull/59127
|
||||||
- title: "Migrate to 'label'"
|
- title: "Migrate to 'label'"
|
||||||
date: 2020-07-09
|
date: 2020-07-09
|
||||||
|
@ -178,4 +178,19 @@ void main() {
|
|||||||
// Changes made in https://github.com/flutter/flutter/pull/59127
|
// Changes made in https://github.com/flutter/flutter/pull/59127
|
||||||
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(title: myTitle);
|
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(title: myTitle);
|
||||||
bottomNavigationBarItem.title;
|
bottomNavigationBarItem.title;
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
const InputDecoration inputDecoration = InputDecoration(hasFloatingPlaceholder: true);
|
||||||
|
InputDecoration(hasFloatingPlaceholder: false);
|
||||||
|
InputDecoration();
|
||||||
|
InputDecoration.collapsed(hasFloatingPlaceholder: true);
|
||||||
|
InputDecoration.collapsed(hasFloatingPlaceholder: false);
|
||||||
|
InputDecoration.collapsed();
|
||||||
|
inputDecoration.hasFloatingPlaceholder;
|
||||||
|
const InputDecorationTheme inputDecorationTheme = InputDecorationTheme(hasFloatingPlaceholder: true);
|
||||||
|
InputDecorationTheme(hasFloatingPlaceholder: false);
|
||||||
|
InputDecorationTheme();
|
||||||
|
inputDecorationTheme.hasFloatingPlaceholder;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -178,4 +178,17 @@ void main() {
|
|||||||
// Changes made in https://github.com/flutter/flutter/pull/59127
|
// Changes made in https://github.com/flutter/flutter/pull/59127
|
||||||
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(label: myTitle);
|
const BottomNavigationBarItem bottomNavigationBarItem = BottomNavigationBarItem(label: myTitle);
|
||||||
bottomNavigationBarItem.label;
|
bottomNavigationBarItem.label;
|
||||||
|
|
||||||
|
// Changes made in https://github.com/flutter/flutter/pull/46115
|
||||||
|
const InputDecoration inputDecoration = InputDecoration(floatingLabelBehavior: FloatingLabelBehavior.auto);
|
||||||
|
InputDecoration(floatingLabelBehavior: FloatingLabelBehavior.never);
|
||||||
|
InputDecoration();
|
||||||
|
InputDecoration.collapsed(floatingLabelBehavior: FloatingLabelBehavior.auto);
|
||||||
|
InputDecoration.collapsed(floatingLabelBehavior: FloatingLabelBehavior.never);
|
||||||
|
InputDecoration.collapsed();
|
||||||
|
inputDecoration.floatingLabelBehavior;
|
||||||
|
const InputDecorationTheme inputDecorationTheme = InputDecorationTheme(floatingLabelBehavior: FloatingLabelBehavior.auto);
|
||||||
|
InputDecorationTheme(floatingLabelBehavior: FloatingLabelBehavior.never);
|
||||||
|
InputDecorationTheme();
|
||||||
|
inputDecorationTheme.floatingLabelBehavior;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user