Commit 2ca1b8bfd7030ad7609e4a59c49cd9c10855e7a0

Authored by liangchengyou
1 parent 3990c978

feat:更新适配

Showing 1 changed file with 128 additions and 130 deletions
lib/login/login_page.dart
@@ -88,8 +88,8 @@ class LoginPage extends StatelessWidget { @@ -88,8 +88,8 @@ class LoginPage extends StatelessWidget {
88 ), 88 ),
89 ), 89 ),
90 padding: const EdgeInsets.symmetric( 90 padding: const EdgeInsets.symmetric(
91 - horizontal: 36.0,  
92 - vertical: 20.0 91 + horizontal: 28.0,
  92 + vertical: 14.0
93 ), 93 ),
94 child: const Text( 94 child: const Text(
95 '登录' 95 '登录'
@@ -112,41 +112,42 @@ class LoginPage extends StatelessWidget { @@ -112,41 +112,42 @@ class LoginPage extends StatelessWidget {
112 Widget _buildSmsViewWidget()=> BlocBuilder<LoginBloc,LoginState>( 112 Widget _buildSmsViewWidget()=> BlocBuilder<LoginBloc,LoginState>(
113 builder: (context,state){ 113 builder: (context,state){
114 final bloc = BlocProvider.of<LoginBloc>(context); 114 final bloc = BlocProvider.of<LoginBloc>(context);
115 - return Column(  
116 - children: [  
117 - 15.verticalSpace,  
118 - Container(  
119 - padding: EdgeInsets.symmetric(horizontal: 135.w),  
120 - width: double.infinity,  
121 - height: 55,  
122 - alignment: Alignment.center,  
123 - decoration: BoxDecoration( 115 + return Padding(
  116 + padding: const EdgeInsets.symmetric(horizontal: 340),
  117 + child: Column(
  118 + children: [
  119 + 15.verticalSpace,
  120 + Container(
  121 + height: 55,
  122 + width: double.infinity,
  123 + alignment: Alignment.center,
  124 + decoration: BoxDecoration(
124 image: DecorationImage( 125 image: DecorationImage(
125 image: AssetImage( 126 image: AssetImage(
126 'Input_layer_up'.assetPng 127 'Input_layer_up'.assetPng
127 - )  
128 - )  
129 - ),  
130 - child: TextField(  
131 - controller: bloc.phoneNumController,  
132 - textAlign: TextAlign.center,  
133 - textInputAction: TextInputAction.done,  
134 - keyboardType: TextInputType.phone,  
135 - decoration: const InputDecoration(  
136 - hintText: '请输入手机号',  
137 - border: InputBorder.none, 128 + ),
  129 + fit: BoxFit.fitHeight
  130 + ),
  131 + color: Colors.red
138 ), 132 ),
139 - onChanged: (String value) {  
140 - bloc.add(PhoneNumChangeEvent());  
141 - },  
142 - )  
143 - ),  
144 - 6.5.verticalSpace,  
145 - const Text('未注册用户登录默认注册'),  
146 - 4.5.verticalSpace,  
147 - Container(  
148 - padding: EdgeInsets.symmetric(horizontal: 205.w),  
149 - child: Row( 133 + child: TextField(
  134 + controller: bloc.phoneNumController,
  135 + textAlign: TextAlign.center,
  136 + textInputAction: TextInputAction.done,
  137 + keyboardType: TextInputType.phone,
  138 + decoration: const InputDecoration(
  139 + hintText: '请输入手机号',
  140 + border: InputBorder.none,
  141 + ),
  142 + onChanged: (String value) {
  143 + bloc.add(PhoneNumChangeEvent());
  144 + },
  145 + )
  146 + ),
  147 + 6.5.verticalSpace,
  148 + const Text('未注册用户登录默认注册'),
  149 + 4.5.verticalSpace,
  150 + Row(
150 mainAxisAlignment: MainAxisAlignment.spaceBetween, 151 mainAxisAlignment: MainAxisAlignment.spaceBetween,
151 children: [ 152 children: [
152 Container( 153 Container(
@@ -196,113 +197,110 @@ class LoginPage extends StatelessWidget { @@ -196,113 +197,110 @@ class LoginPage extends StatelessWidget {
196 ), 197 ),
197 ) 198 )
198 ], 199 ],
199 - ),  
200 - )  
201 - ], 200 + )
  201 + ],
  202 + ),
202 ); 203 );
203 }); 204 });
204 205
205 Widget _buildPwdViewWidget()=> BlocBuilder<LoginBloc,LoginState>( 206 Widget _buildPwdViewWidget()=> BlocBuilder<LoginBloc,LoginState>(
206 builder: (context,state){ 207 builder: (context,state){
207 final bloc = BlocProvider.of<LoginBloc>(context); 208 final bloc = BlocProvider.of<LoginBloc>(context);
208 - return Container(  
209 - padding: EdgeInsets.symmetric(horizontal: 135.w),  
210 - child: Column(  
211 - children: [  
212 - 15.verticalSpace,  
213 - Row(  
214 - mainAxisAlignment: MainAxisAlignment.center,  
215 - children: [  
216 - Image.asset(  
217 - 'phone'.assetPng,  
218 - height: 45,  
219 - width: 35,  
220 - ),  
221 - 10.5.horizontalSpace,  
222 - Container(  
223 - width: 397.5,  
224 - height: 55,  
225 - alignment: Alignment.center,  
226 - decoration: BoxDecoration(  
227 - image: DecorationImage(  
228 - image: AssetImage(  
229 - 'Input_layer_up'.assetPng  
230 - ),  
231 - fit: BoxFit.fill,  
232 - ) 209 + return Column(
  210 + children: [
  211 + 15.verticalSpace,
  212 + Row(
  213 + mainAxisAlignment: MainAxisAlignment.center,
  214 + children: [
  215 + Image.asset(
  216 + 'phone'.assetPng,
  217 + height: 45,
  218 + width: 35,
  219 + ),
  220 + 10.5.horizontalSpace,
  221 + Container(
  222 + height: 55,
  223 + width: double.infinity,
  224 + alignment: Alignment.center,
  225 + decoration: BoxDecoration(
  226 + image: DecorationImage(
  227 + image: AssetImage(
  228 + 'Input_layer_up'.assetPng
  229 + ),
  230 + fit: BoxFit.fill,
  231 + )
  232 + ),
  233 + child: TextField(
  234 + controller: bloc.phoneNumController,
  235 + textAlign: TextAlign.center,
  236 + textInputAction: TextInputAction.done,
  237 + decoration: const InputDecoration(
  238 + hintText: '请输入手机号',
  239 + border: InputBorder.none,
233 ), 240 ),
234 - child: TextField(  
235 - controller: bloc.phoneNumController,  
236 - textAlign: TextAlign.center,  
237 - textInputAction: TextInputAction.done,  
238 - decoration: const InputDecoration(  
239 - hintText: '请输入手机号',  
240 - border: InputBorder.none,  
241 - ),  
242 - keyboardType: TextInputType.phone,  
243 - onChanged: (String value) {  
244 - bloc.add(PhoneNumChangeEvent());  
245 - },  
246 - )  
247 - ),  
248 - 5.horizontalSpace,  
249 - const SizedBox( 241 + keyboardType: TextInputType.phone,
  242 + onChanged: (String value) {
  243 + bloc.add(PhoneNumChangeEvent());
  244 + },
  245 + )
  246 + ),
  247 + 5.horizontalSpace,
  248 + const SizedBox(
  249 + width: 100,
  250 + height: 55.0,
  251 + )
  252 + ],
  253 + ),
  254 + 12.verticalSpace,
  255 + Row(
  256 + mainAxisAlignment: MainAxisAlignment.center,
  257 + children: [
  258 + Image.asset(
  259 + 'lock'.assetPng,
  260 + height: 34,
  261 + width: 31,
  262 + ),
  263 + 10.5.horizontalSpace,
  264 + Container(
  265 + width: 397.5,
  266 + height: 55,
  267 + alignment: Alignment.center,
  268 + decoration: BoxDecoration(
  269 + image: DecorationImage(
  270 + image: AssetImage(
  271 + 'Input_layer_down'.assetPng
  272 + ),
  273 + fit: BoxFit.fill,
  274 + )
  275 + ),
  276 + child: TextField(
  277 + controller: bloc.checkNumController,
  278 + textAlign: TextAlign.center,
  279 + textInputAction: TextInputAction.done,
  280 + decoration: const InputDecoration(
  281 + hintText: '请输入密码',
  282 + border: InputBorder.none,
  283 + ),
  284 + onChanged: (String value) {
  285 + bloc.add(CheckFieldChangeEvent());
  286 + },
  287 + )
  288 + ),
  289 + 5.horizontalSpace,
  290 + GestureDetector(
  291 + onTap: () => bloc.add(ForgetPasswordEvent()),
  292 + child: Container(
250 width: 100, 293 width: 100,
251 height: 55.0, 294 height: 55.0,
252 - )  
253 - ],  
254 - ),  
255 - 12.verticalSpace,  
256 - Row(  
257 - mainAxisAlignment: MainAxisAlignment.center,  
258 - children: [  
259 - Image.asset(  
260 - 'lock'.assetPng,  
261 - height: 34,  
262 - width: 31,  
263 - ),  
264 - 10.5.horizontalSpace,  
265 - Container(  
266 - width: 397.5,  
267 - height: 55,  
268 - alignment: Alignment.center,  
269 - decoration: BoxDecoration(  
270 - image: DecorationImage(  
271 - image: AssetImage(  
272 - 'Input_layer_down'.assetPng  
273 - ),  
274 - fit: BoxFit.fill,  
275 - )  
276 - ),  
277 - child: TextField(  
278 - controller: bloc.checkNumController,  
279 - textAlign: TextAlign.center,  
280 - textInputAction: TextInputAction.done,  
281 - decoration: const InputDecoration(  
282 - hintText: '请输入密码',  
283 - border: InputBorder.none,  
284 - ),  
285 - onChanged: (String value) {  
286 - bloc.add(CheckFieldChangeEvent());  
287 - },  
288 - )  
289 - ),  
290 - 5.horizontalSpace,  
291 - GestureDetector(  
292 - onTap: () => bloc.add(ForgetPasswordEvent()),  
293 - child: Container(  
294 - width: 100,  
295 - height: 55.0,  
296 - alignment: Alignment.centerLeft,  
297 - child: const Text(  
298 - '忘记密码 ?'  
299 - ), 295 + alignment: Alignment.centerLeft,
  296 + child: const Text(
  297 + '忘记密码 ?'
300 ), 298 ),
301 - )  
302 - ],  
303 - )  
304 - ],  
305 - ), 299 + ),
  300 + )
  301 + ],
  302 + )
  303 + ],
306 ); 304 );
307 }); 305 });
308 306