【发布时间】:2021-09-26 09:58:03
【问题描述】:
我想在 Flutter 中制作一个这样的 Facebook 邮箱。 按下时,它将转到另一个页面。我怎样才能做到?
【问题讨论】:
标签: flutter user-interface flutter-layout
我想在 Flutter 中制作一个这样的 Facebook 邮箱。 按下时,它将转到另一个页面。我怎样才能做到?
【问题讨论】:
标签: flutter user-interface flutter-layout
嗨 :) 您应该使用 MaterialPageRoute 在页面之间导航,我们开始??:
请投票给 Yeasin Sheikh 的答案,但这是要投票的答案 ✅
GestureDetector(
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => SecondRoute()),
},
child: Container(
height: 50,
width: 300,
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 12),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(34),
border: Border.all(
color: Colors.grey,
width: 1.5,
),
),
child: Text(
"what's on your mind ?",
style: TextStyle(
color: Colors.white,
),
),
),
),
【讨论】:
更新了边框
GestureDetector(
onTap: () {
print("Nav to page");
},
child: Container(
height: 50,
width: 300,
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 12),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(34),
border: Border.all(
color: Colors.grey,
width: 1.5,
),
),
child: Text(
"what's on your mind ?",
style: TextStyle(
color: Colors.white,
),
),
),
),
【讨论】: