I wanted to put a textfield inside of an appbar and get data from it using the onChanged
property. I did it but onChanged
does not work.
new Container(
child: new Stack(
children: <Widget>[
new Container(
child: BuildSvg('assets/svg/backgroundSmall.svg'),
color: Colors.lightGreen,
),
new Scaffold(
appBar: new AppBar(
title: TextField(
onChanged: (text) {
print('text');
setState(() {});
},
),
backgroundColor: Colors.transparent,
elevation: 0.0,
),
)
],
),
);