我該如何解決這個問題?
問題是 RenderFlex 在底部溢位了 49 個像素。當我在代碼中單擊名為“navigator_before”的圖示按鈕時會發生這種情況。
為什么會出現錯誤?我該如何解決?
// This is Second Page
class SearchOnScreen extends StatelessWidget {
const SearchOnScreen ({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return DefaultLayout(
child: SafeArea(
top: true,
bottom: false,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 0.0),
child: Column(
children: [
Hero(
tag: 'Searching',
child: Material(
type: MaterialType.transparency,
child: CupertinoSearchTextField(
autofocus: true,
prefixIcon: IconButton( // <---------------------------- button
icon: Icon(Icons.navigate_before,
size: 30.0,),
onPressed: (){
Navigator.pop(context);
},
),
suffixInsets: EdgeInsets.only(right: 20),
prefixInsets: EdgeInsets.only(left: 10),
padding: EdgeInsets.only(left: 5,top: 15, bottom: 15),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(width: 0.5, color: Color(0xff868686)))
),
),
),
),
],
),
),
),
);
}
}
// This is first Page
...
child: Column(
children: [
const SizedBox(height: 250.0,),
InkWell(
splashColor: Colors.transparent, // ????? ?, ???? ????,
highlightColor: Colors.transparent, // ????? ?, ???? ????,
onTap: (){
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context){
return SearchOnScreen();
}
),
);
},
child: IgnorePointer(
child: Hero(
tag: 'Searching',
child: MainSearchTextFormField()),
),
),
]
)
我試圖將前綴圖示包裝在列中。但是錯誤也發生了。所以我洗掉了列。
uj5u.com熱心網友回復:
嘗試將 包裝Column在一個SingleChildScrollView小部件中。這可能會解決您的問題。它將允許頁面在頁面導航影片發生時滾動。
然后,如果您不希望用戶手動滾動此列,請將 的physics屬性設定SingleChildScrollView為const NeverScrollableScrollPhysics()。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/524353.html
標籤:扑颤振布局颤动动画
