From 2ca1b8bfd7030ad7609e4a59c49cd9c10855e7a0 Mon Sep 17 00:00:00 2001 From: lcy <2503978335@qq.com> Date: Wed, 7 Jun 2023 11:40:07 +0800 Subject: [PATCH] feat:更新适配 --- lib/login/login_page.dart | 258 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 128 insertions(+), 130 deletions(-) diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index e3f9f84..c587559 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -88,8 +88,8 @@ class LoginPage extends StatelessWidget { ), ), padding: const EdgeInsets.symmetric( - horizontal: 36.0, - vertical: 20.0 + horizontal: 28.0, + vertical: 14.0 ), child: const Text( '登录' @@ -112,41 +112,42 @@ class LoginPage extends StatelessWidget { Widget _buildSmsViewWidget()=> BlocBuilder( builder: (context,state){ final bloc = BlocProvider.of(context); - return Column( - children: [ - 15.verticalSpace, - Container( - padding: EdgeInsets.symmetric(horizontal: 135.w), - width: double.infinity, - height: 55, - alignment: Alignment.center, - decoration: BoxDecoration( + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 340), + child: Column( + children: [ + 15.verticalSpace, + Container( + height: 55, + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( image: DecorationImage( image: AssetImage( 'Input_layer_up'.assetPng - ) - ) - ), - child: TextField( - controller: bloc.phoneNumController, - textAlign: TextAlign.center, - textInputAction: TextInputAction.done, - keyboardType: TextInputType.phone, - decoration: const InputDecoration( - hintText: '请输入手机号', - border: InputBorder.none, + ), + fit: BoxFit.fitHeight + ), + color: Colors.red ), - onChanged: (String value) { - bloc.add(PhoneNumChangeEvent()); - }, - ) - ), - 6.5.verticalSpace, - const Text('未注册用户登录默认注册'), - 4.5.verticalSpace, - Container( - padding: EdgeInsets.symmetric(horizontal: 205.w), - child: Row( + child: TextField( + controller: bloc.phoneNumController, + textAlign: TextAlign.center, + textInputAction: TextInputAction.done, + keyboardType: TextInputType.phone, + decoration: const InputDecoration( + hintText: '请输入手机号', + border: InputBorder.none, + ), + onChanged: (String value) { + bloc.add(PhoneNumChangeEvent()); + }, + ) + ), + 6.5.verticalSpace, + const Text('未注册用户登录默认注册'), + 4.5.verticalSpace, + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( @@ -196,113 +197,110 @@ class LoginPage extends StatelessWidget { ), ) ], - ), - ) - ], + ) + ], + ), ); }); Widget _buildPwdViewWidget()=> BlocBuilder( builder: (context,state){ final bloc = BlocProvider.of(context); - return Container( - padding: EdgeInsets.symmetric(horizontal: 135.w), - child: Column( - children: [ - 15.verticalSpace, - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'phone'.assetPng, - height: 45, - width: 35, - ), - 10.5.horizontalSpace, - Container( - width: 397.5, - height: 55, - alignment: Alignment.center, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'Input_layer_up'.assetPng - ), - fit: BoxFit.fill, - ) + return Column( + children: [ + 15.verticalSpace, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'phone'.assetPng, + height: 45, + width: 35, + ), + 10.5.horizontalSpace, + Container( + height: 55, + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'Input_layer_up'.assetPng + ), + fit: BoxFit.fill, + ) + ), + child: TextField( + controller: bloc.phoneNumController, + textAlign: TextAlign.center, + textInputAction: TextInputAction.done, + decoration: const InputDecoration( + hintText: '请输入手机号', + border: InputBorder.none, ), - child: TextField( - controller: bloc.phoneNumController, - textAlign: TextAlign.center, - textInputAction: TextInputAction.done, - decoration: const InputDecoration( - hintText: '请输入手机号', - border: InputBorder.none, - ), - keyboardType: TextInputType.phone, - onChanged: (String value) { - bloc.add(PhoneNumChangeEvent()); - }, - ) - ), - 5.horizontalSpace, - const SizedBox( + keyboardType: TextInputType.phone, + onChanged: (String value) { + bloc.add(PhoneNumChangeEvent()); + }, + ) + ), + 5.horizontalSpace, + const SizedBox( + width: 100, + height: 55.0, + ) + ], + ), + 12.verticalSpace, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'lock'.assetPng, + height: 34, + width: 31, + ), + 10.5.horizontalSpace, + Container( + width: 397.5, + height: 55, + alignment: Alignment.center, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'Input_layer_down'.assetPng + ), + fit: BoxFit.fill, + ) + ), + child: TextField( + controller: bloc.checkNumController, + textAlign: TextAlign.center, + textInputAction: TextInputAction.done, + decoration: const InputDecoration( + hintText: '请输入密码', + border: InputBorder.none, + ), + onChanged: (String value) { + bloc.add(CheckFieldChangeEvent()); + }, + ) + ), + 5.horizontalSpace, + GestureDetector( + onTap: () => bloc.add(ForgetPasswordEvent()), + child: Container( width: 100, height: 55.0, - ) - ], - ), - 12.verticalSpace, - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'lock'.assetPng, - height: 34, - width: 31, - ), - 10.5.horizontalSpace, - Container( - width: 397.5, - height: 55, - alignment: Alignment.center, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'Input_layer_down'.assetPng - ), - fit: BoxFit.fill, - ) - ), - child: TextField( - controller: bloc.checkNumController, - textAlign: TextAlign.center, - textInputAction: TextInputAction.done, - decoration: const InputDecoration( - hintText: '请输入密码', - border: InputBorder.none, - ), - onChanged: (String value) { - bloc.add(CheckFieldChangeEvent()); - }, - ) - ), - 5.horizontalSpace, - GestureDetector( - onTap: () => bloc.add(ForgetPasswordEvent()), - child: Container( - width: 100, - height: 55.0, - alignment: Alignment.centerLeft, - child: const Text( - '忘记密码 ?' - ), + alignment: Alignment.centerLeft, + child: const Text( + '忘记密码 ?' ), - ) - ], - ) - ], - ), + ), + ) + ], + ) + ], ); }); -- libgit2 0.22.2