-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestdevexp-dartfixIssues with the dartfix packageIssues with the dartfix packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
I wrote this transform:
version: 1
transforms:
# Changes made in https://github.com/flutter/flutter/pull/73352
- title: "Migrate to 'TextButton.icon'"
date: 2021-01-08
element:
uris: [ 'material.dart' ]
constructor: 'icon'
inClass: 'FlatButton'
changes:
- kind: 'removeParameter'
name: 'onHighlightChanged'
- kind: 'removeParameter'
name: 'textTheme'
- kind: 'removeParameter'
name: 'highlightColor'
- kind: 'removeParameter'
name: 'colorBrightness'
- kind: 'replacedBy'
newElement:
uris: [ 'material.dart' ]
constructor: 'icon'
inClass: 'TextButton'with the expectation that it would take this snippet of code:
var myIconButton = FlatButton.icon(
key: UniqueKey(),
icon: Icon(Icons.ten_k_outlined),
label: Text('FlatButton'),
onPressed: (){},
onLongPress: (){},
clipBehavior: Clip.hardEdge,
focusNode: FocusNode(),
autofocus: true,
onHighlightChanged: (_) {},
textTheme: ButtonTextTheme(),
highlightColor: Colors.blue,
colorBrightness: Brightness.dark,
);and transform it into this:
var myIconButton = TextButton.icon(
key: UniqueKey(),
icon: Icon(Icons.ten_k_outlined),
label: Text('FlatButton'),
onPressed: (){},
onLongPress: (){},
clipBehavior: Clip.hardEdge,
focusNode: FocusNode(),
autofocus: true,
);but none of the changes are being applied when it is run:
var myIconButton = FlatButton.icon(
key: UniqueKey(),
icon: Icon(Icons.ten_k_outlined),
label: Text('FlatButton'),
onPressed: (){},
onLongPress: (){},
clipBehavior: Clip.hardEdge,
focusNode: FocusNode(),
autofocus: true,
onHighlightChanged: (_) {},
textTheme: ButtonTextTheme(),
highlightColor: Colors.blue,
colorBrightness: Brightness.dark,
);
There are other FlatButton transforms defined in the file, not sure if they are related. See WIP PR: flutter/flutter#95641
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestdevexp-dartfixIssues with the dartfix packageIssues with the dartfix packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)