mod: 搜索页面样式

This commit is contained in:
guozhigq
2023-08-06 14:55:13 +08:00
parent c83f70c08a
commit f5f1ffb2be
7 changed files with 284 additions and 202 deletions

View File

@ -17,6 +17,13 @@ class SearchPage extends StatefulWidget {
class _SearchPageState extends State<SearchPage> with RouteAware {
final SSearchController _searchController = Get.put(SSearchController());
late Future? _futureBuilderFuture;
@override
void initState() {
super.initState();
_futureBuilderFuture = _searchController.queryHotSearchList();
}
@override
// 返回当前页面时
@ -159,7 +166,7 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
builder: (context, boxConstraints) {
final double width = boxConstraints.maxWidth;
return FutureBuilder(
future: _searchController.queryHotSearchList(),
future: _futureBuilderFuture,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
Map data = snapshot.data as Map;