如何滚动我在登录屏幕上创建的位置


Positioned(
top: 0,
left: 0,
right: 0,
child: Container(
height: 500,
decoration: const BoxDecoration(
color: Color(0xff0A7FD3),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(80),
bottomLeft: Radius.circular(80),
),
),
),
),
Positioned(
top: 80,
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
child: Container(
padding: EdgeInsets.all(20),
width: MediaQuery.of(context).size.width - 40,
// height: MediaQuery.of(context).size.height * 0.75,
margin: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 15,
spreadRadius: 5),
],
),
child: Column(
children: [
Center(
child: Image(
image: AssetImage('imagedirectory/image/encap.png'),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 30),
child: Text(
'ENCAPSULATOR',
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 26,
color: Color(0xff266089),
fontFamily: 'Lato',
fontWeight: FontWeight.w900),
),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 10),
child: Text(
'Digital Time Capsules',
style: const TextStyle(
fontSize: 18,
color: Color(0xff898787),
fontFamily: 'Lato',
fontWeight: FontWeight.w700),
),
),
),
Padding(
padding: EdgeInsets.only(top: 30),
child: TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(0xff979393),
),
borderRadius: BorderRadius.circular(50),
),
labelText: 'Email',
hintStyle: TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
style: TextStyle(fontSize: 20),
),
),
Padding(
padding: EdgeInsets.only(top: 30),
child: TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(0xff979393),
),
borderRadius: BorderRadius.circular(50),
),
labelText: 'Password',
hintStyle: TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
style: TextStyle(fontSize: 20),
),
),
Padding(
padding: EdgeInsets.only(top: 40),
child: Center(
child: InkWell(
onTap: () {
// Navigator.push(
//   context,
//   MaterialPageRoute(builder: (context) => Submit()),
// );
},
child: Text(
'Forget password?',
style: TextStyle(
fontSize: 18,
color: Color(0xff716B6B),
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
),
),
),
),
),
Container(
margin: const EdgeInsets.only(top: 25),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Color(0xff0A7FD3),
onPrimary: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(32.0)),
minimumSize: Size(400, 60), //////// HERE
),
onPressed: () {
Get.toNamed('dashboard');
},
child: const Text(
'SIGN IN',
style: TextStyle(
fontSize: 22,
fontFamily: 'Lato',
fontWeight: FontWeight.w700,
color: Color(0xffffffff),
),
),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 40),
child: Text(
'Don’t have account',
style: const TextStyle(
fontSize: 18,
color: Color(0xff474444),
fontFamily: 'Lato',
fontWeight: FontWeight.w700),
),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 10),
child: InkWell(
onTap: () {
Get.toNamed('signup');
},
child: Text(
'Request to register',
style: const TextStyle(
fontSize: 18,
color: Color(0xff529C00),
fontFamily: 'Lato',
fontWeight: FontWeight.w700,
decoration: TextDecoration.underline,
),
),
),
),
),
],
),
),
),
),

我想在登录屏幕的另一个位置上滚动位置

如果我没有弄错你的问题应该像下面
如何使堆栈定位可滚动

只定义bottom: 0,

Positioned(
top: 280,
bottom: 0,
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.all(20),
width: MediaQuery.of(context).size.width - 40,
// height: MediaQuery.of(context).size.height * 0.75,
margin: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(15),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 15,
spreadRadius: 5),
],
),
child: SingleChildScrollView(
child: Column(
children: [
const Center(
child: Image(
image: AssetImage('imagedirectory/image/encap.png'),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 30),
child: Text(
'ENCAPSULATOR',
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 26,
color: Color(0xff266089),
fontFamily: 'Lato',
fontWeight: FontWeight.w900),
),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 10),
child: Text(
'Digital Time Capsules',
style: const TextStyle(
fontSize: 18,
color: Color(0xff898787),
fontFamily: 'Lato',
fontWeight: FontWeight.w700),
),
),
),
Padding(
padding: EdgeInsets.only(top: 30),
child: TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(0xff979393),
),
borderRadius: BorderRadius.circular(50),
),
labelText: 'Email',
hintStyle: TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
style: TextStyle(fontSize: 20),
),
),
Padding(
padding: EdgeInsets.only(top: 30),
child: TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(0xff979393),
),
borderRadius: BorderRadius.circular(50),
),
labelText: 'Password',
hintStyle: TextStyle(
fontSize: 20, fontWeight: FontWeight.bold),
),
style: TextStyle(fontSize: 20),
),
),
Padding(
padding: EdgeInsets.only(top: 40),
child: Center(
child: InkWell(
onTap: () {
// Navigator.push(
//   context,
//   MaterialPageRoute(builder: (context) => Submit()),
// );
},
child: Text(
'Forget password?',
style: TextStyle(
fontSize: 18,
color: Color(0xff716B6B),
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
),
),
),
),
),
Container(
margin: const EdgeInsets.only(top: 25),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Color(0xff0A7FD3),
onPrimary: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(32.0)),
minimumSize: Size(400, 60), //////// HERE
),
onPressed: () {},
child: const Text(
'SIGN IN',
style: TextStyle(
fontSize: 22,
fontFamily: 'Lato',
fontWeight: FontWeight.w700,
color: Color(0xffffffff),
),
),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 40),
child: Text(
'Don’t have account',
style: const TextStyle(
fontSize: 18,
color: Color(0xff474444),
fontFamily: 'Lato',
fontWeight: FontWeight.w700),
),
),
),
Center(
child: Padding(
padding: EdgeInsets.only(top: 10),
child: InkWell(
onTap: () {},
child: Text(
'Request to register',
style: const TextStyle(
fontSize: 18,
color: Color(0xff529C00),
fontFamily: 'Lato',
fontWeight: FontWeight.w700,
decoration: TextDecoration.underline,
),
),
),
),
),
],
),
),
),
),
),

最新更新