SingleChildScrollView(
child: Column(
children: [
ExpansionTile(
title: Text("Task Overview",
style:
TextStyle(fontWeight: FontWeight.bold)),
// key: PageStorageKey<Task>(Task),
maintainState: true,
children: <Widget>[
Task(),
],
),
],
),
)
下面的代码是Task部分
TextField(
controller: textcontroller,
style: const TextStyle(color: Colors.black),
cursorColor: Colors.black,
onChanged: (value) {
searchResult(value);
},
decoration: InputDecoration(
hintText: "Search",
hintStyle:
const TextStyle(fontSize: 14, color: Colors.black),
suffixIcon: const Icon(Icons.search, color: Colors.black),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(
color: Colors.black,
width: 2.0,
),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: const BorderSide(
style: BorderStyle.none,
),
),
// filled: true,
),
),
即使我使用 "maintainState: true" , 它的children 还是会一直刷新, 各位大大们有什么方法可以解决吗?