Rename State.config to widget everywhere (#9273)

Rename State.config to State.widget
Rename State.didUpdateConfig to State.didUpdateWidget
Renamed all State subclasses' local variables named config to something else
This commit is contained in:
xster
2017-04-10 18:32:24 -07:00
committed by GitHub
parent a5593b1678
commit 89a7fdfc56
111 changed files with 1154 additions and 1140 deletions

View File

@@ -58,16 +58,16 @@ class DotState extends State<Dot> {
@override
Widget build(BuildContext context) {
return new GestureDetector(
onTap: config.tappable ? () { setState(() { taps += 1; }); } : null,
onTap: widget.tappable ? () { setState(() { taps += 1; }); } : null,
child: new Container(
width: config.size,
height: config.size,
width: widget.size,
height: widget.size,
decoration: new BoxDecoration(
backgroundColor: config.color,
backgroundColor: widget.color,
border: new Border.all(width: taps.toDouble()),
shape: BoxShape.circle
),
child: config.child
child: widget.child
)
);
}

View File

@@ -123,12 +123,12 @@ class _PointDemoState extends State<_PointDemo> {
@override
void initState() {
super.initState();
_animation = new CurvedAnimation(parent: config.controller, curve: Curves.fastOutSlowIn);
_animation = new CurvedAnimation(parent: widget.controller, curve: Curves.fastOutSlowIn);
}
@override
void dispose() {
config.controller.value = 0.0;
widget.controller.value = 0.0;
super.dispose();
}
@@ -169,7 +169,7 @@ class _PointDemoState extends State<_PointDemo> {
void _handleDragCancel() {
_dragTarget = null;
config.controller.value = 0.0;
widget.controller.value = 0.0;
}
void _handleDragEnd(DragEndDetails details) {
@@ -288,12 +288,12 @@ class _RectangleDemoState extends State<_RectangleDemo> {
@override
void initState() {
super.initState();
_animation = new CurvedAnimation(parent: config.controller, curve: Curves.fastOutSlowIn);
_animation = new CurvedAnimation(parent: widget.controller, curve: Curves.fastOutSlowIn);
}
@override
void dispose() {
config.controller.value = 0.0;
widget.controller.value = 0.0;
super.dispose();
}
@@ -333,7 +333,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
void _handleDragCancel() {
_dragTarget = null;
config.controller.value = 0.0;
widget.controller.value = 0.0;
}
void _handleDragEnd(DragEndDetails details) {