@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Appcolors.white,
appBar: AppBar(
backgroundColor: Appcolors.white,
elevation: 0,
),
body: SingleChildScrollView(
child: SafeArea(
child: Column(
children: [
const Padding(
padding: EdgeInsets.fromLTRB(0, 30,0,0),
child: Center(child: Text('Welcome Back!',style: TextStyle(fontSize: 30,fontWeight: FontWeight.w700),)),
),
const SizedBox(height: 8),
const Text('Please enter your account here',style: TextStyle(fontSize: 15,fontWeight: FontWeight.w400),),
const SizedBox(height: 59,),
//Email textfield
Padding(
padding: const EdgeInsets.only(left: 31, right: 31),
child: TextField(
cursorColor: Appcolors.black,
decoration: InputDecoration(
fillColor: Appcolors.white,
filled: true,
prefixIcon: const Icon(Icons.email_outlined,color: Appcolors.black),
label: Text('Email'),
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Appcolors.textfieldborder),
borderRadius: BorderRadius.circular(32)),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Appcolors.buttonColor),
borderRadius: BorderRadius.circular(32)),
),
),
),
const SizedBox(height: 30,),
//Password textfield
Padding(
padding: const EdgeInsets.only(left: 31, right: 31),
child: TextField(
cursorColor: Appcolors.black,
decoration: InputDecoration(
prefixIcon: const Icon(Icons.lock,color: Appcolors.black),
label: const Text('Password'),
labelStyle: TextStyle(color: Appcolors.buttonColor),
suffixIcon: IconButton(onPressed: (){},
icon: const Icon(Icons.remove_red_eye_outlined,color: Appcolors.black)
),
enabledBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Appcolors.textfieldborder),
borderRadius: BorderRadius.circular(32)),
focusedBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Appcolors.buttonColor),
borderRadius: BorderRadius.circular(32)),
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(150, 10, 0, 0),
child: TextButton(onPressed: (){},
child: const Text('Forgot password?',style: TextStyle(color: Appcolors.forgotpassword, fontSize: 15,fontWeight: FontWeight.w500),)
),
),
const SizedBox(height: 30,),
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(300, 56),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(32)),
elevation: 0,primary: Appcolors.buttonColor),
onPressed: (){},
child: const Text('Login',
style: TextStyle(shadows: [
Shadow(offset: Offset(5.0, 5.0),
blurRadius: 12.0)
],
fontSize: 16,
fontWeight: FontWeight.w700),
)
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Don\'t have any accont?',style: TextStyle(fontSize: 15,fontWeight: FontWeight.w500)),
TextButton(onPressed: (){},
child: const Text('Sign Up',style: TextStyle(fontSize: 15,fontWeight: FontWeight.w700, color: Appcolors.buttonColor),))
],
),
const SizedBox(height: 15,),
Row(
children: const [
Expanded(
child: Divider(thickness: 1.5,indent: 30,endIndent: 10,)),
Text('Sign in with',style: TextStyle(fontSize: 15),),
Expanded(
child: Divider(thickness: 1.5,indent: 10,endIndent: 30))
],
),
const SizedBox(height: 40,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
onTap: () {
},
child: const Image(
image:
AssetImage('assets/images/Facebook_Logo.png'),height: 30,),
),
const SizedBox(width: 50,),
InkWell(
onTap: () {
},
child: const Image(
image:
AssetImage('assets/images/Google__Logo.png'),height: 30,),
)
],
)
],
),
),
),
);
}
}
4条答案
按热度按时间j5fpnvbx1#
您可以在获取屏幕大小的生成上下文中创建一个局部变量。
之后,您可以始终使用相对于上下文的大小。
例如:
rvpgvaaj2#
为了补充另一个答案,您还可以创建一个包含维度的抽象类
然后,如果您希望在超过某个阈值时更改布局,则可以选中此类以获取当前维度
sq1bmfud3#
请尝试以下代码:
wqnecbli4#
在小型/标签/桌面和可折叠屏幕上的高级处理中,使用以下代码:对于双屏幕使用软件包https://pub.dev/packages/dual_screen,只需相应地调整您的小部件。