@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Builder(
builder: (context) => Scaffold(
appBar: AppBar(
title: Text('Click on the box below!'),
),
body: Container(
padding: EdgeInsets.only(left: 25.0, right: 25.0),
height: 45.0,
child: Center(
child: Row(
children: <Widget>[
Padding(
padding: EdgeInsets.only(right: 8.0),
child: Icon(
Icons.search,
color: Colors.black26,
size: 20.0,
),
),
Expanded(
child: TextField(
keyboardType: TextInputType.text,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '想喝点什么?',
hintStyle: TextStyle(color: Colors.black26)),
cursorColor: Theme.of(this.context).accentColor,
onChanged: (value) {
print('value');
},
)),
],
),
),
)),
),
);
}
}
Steps to Reproduce
1.Tap on the search field
Enter any character into the field
Tap on the search filed
Expected results: Nothing happens, maybe just voice what's currently in the textfield
Actual results: App Crashes
Logs