Commit c70dc107 authored by skeyboy's avatar skeyboy

Android 登录页修改

parent c2930089
import 'dart:io'; import 'dart:io';
import 'package:bruno/bruno.dart';
import 'package:chart/common/routers/routes.dart'; import 'package:chart/common/routers/routes.dart';
import 'package:chart/pages/application/index.dart'; import 'package:chart/pages/application/index.dart';
import 'package:file_picker/file_picker.dart'; import 'package:file_picker/file_picker.dart';
...@@ -17,6 +18,11 @@ import 'package:social_login_buttons/social_login_buttons.dart'; ...@@ -17,6 +18,11 @@ import 'package:social_login_buttons/social_login_buttons.dart';
import 'index.dart'; import 'index.dart';
const kPrimaryColor = Color(0xFF6F35A5);
const kPrimaryLightColor = Color(0xFFF1E6FF);
const double defaultPadding = 16.0;
class SignInPage extends GetView<SignInController> { class SignInPage extends GetView<SignInController> {
// logo // logo
Widget _buildLogo() { Widget _buildLogo() {
...@@ -585,88 +591,221 @@ class SignInPage extends GetView<SignInController> { ...@@ -585,88 +591,221 @@ class SignInPage extends GetView<SignInController> {
Widget buildAndroidSigin(BuildContext buildContext) { Widget buildAndroidSigin(BuildContext buildContext) {
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.translucent, onTap: ()=> Focus.of(buildContext).unfocus(),
onTap: () => FocusScope.of(buildContext).unfocus(), child: Stack(
child: Container( alignment: Alignment.center,
padding: const EdgeInsets.symmetric(horizontal: 16), children: <Widget>[
Container(
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: Image.asset("assets/images/background.png").image, image: Image.asset("assets/images/background.png").image,
fit: BoxFit.cover), fit: BoxFit.cover),
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Column(
children: [ children: [
Row(
children: [
const Spacer(),
SizedBox( SizedBox(
height: 55.h, height: 145,
width: 145,
child: Image.asset("assets/images/logo.png"),
), ),
Row(children: [ const Spacer(),
GestureDetector( ],
onTap: () => Get.back(),
child: const Icon(
Icons.chevron_left,
color: Colors.white70,
size: 35,
)),
]),
SizedBox(
height: 65.h,
), ),
SizedBox(height: defaultPadding * 1.5),
const Text( ],
'欢迎登录',
style:
TextStyle(color: Colors.white70, fontWeight: FontWeight.bold),
), ),
SizedBox( Row(
height: 45.h, children: [
Spacer(),
Expanded(
flex: 8,
child: Form(
child: Column(
children: [
TextFormField(
controller: controller.mobileMemberController,
keyboardType: TextInputType.emailAddress,
textInputAction: TextInputAction.next,
cursorColor: kPrimaryColor,
onSaved: (email) {},
decoration: const InputDecoration(
hintText: "输入手机号",
prefixIcon: Padding(
padding: EdgeInsets.all(defaultPadding),
child: Icon(Icons.phone_android),
), ),
_buildSigMobileInput(),
const SizedBox(
height: 20,
), ),
_buildSigCodeInput(),
const Padding(
padding: EdgeInsets.only(top: 10),
child: Center(
child: Text(
'未注册的手机号验证通过后将自动通过',
style: TextStyle(fontSize: 12, color: Colors.white70),
), ),
Padding(
padding: const EdgeInsets.symmetric(
vertical: defaultPadding),
child: TextFormField(
controller: controller.codeController,
textInputAction: TextInputAction.done,
obscureText: true,
cursorColor: kPrimaryColor,
decoration: const InputDecoration(
hintText: "输入验证码",
prefixIcon: Padding(
padding: EdgeInsets.all(defaultPadding),
child: Icon(Icons.verified_sharp),
), ),
), ),
const SizedBox(
height: 55,
), ),
Container( ),
height: 44.h, Row(
margin: EdgeInsets.only(top: 15.h), children: [
child: btnFlatButtonWidget( Flexible(child: Container()),
GestureDetector(
onTap: () => controller.chageCodeStatus(),
child: const Text(
"获取验证码",
style: TextStyle(
color: Colors.white54, fontSize: 12),
),
)
],
),
const SizedBox(height: defaultPadding),
Hero(
tag: "login_btn",
child: Container(
width: Get.width - 40, width: Get.width - 40,
fontColor: Colors.black54, height: 45,
fontSize: 16, child: ElevatedButton(
gbColor: Colors.green.withOpacity(0.7), // style: ButtonStyle(backgroundColor: MaterialStateProperty.all(Color(0xFF6F35A5))),
onPressed: controller.handleSignIn, onPressed: () {
// controller.handleSignIn, controller.handleSignIn();
title: "登录"), },
child: Text(
"登录".toUpperCase(),
),
),
), ),
),
const SizedBox(height: defaultPadding),
],
),
),
),
Spacer(),
],
),
],
),
),
],
),
);
// return GestureDetector(
// behavior: HitTestBehavior.translucent,
// onTap: () => FocusScope.of(buildContext).unfocus(),
// child: Container(
// padding: const EdgeInsets.symmetric(horizontal: 16),
// decoration: BoxDecoration(
// image: DecorationImage(
// image: Image.asset("assets/images/background.png").image,
// fit: BoxFit.cover),
// ),
// child: Column(
// children: [
// SizedBox( // SizedBox(
// height: 55.h,
// ),
// Row(children: [
// GestureDetector(
// onTap: () => Get.back(),
// child: const Icon(
// Icons.chevron_left,
// color: Colors.white70,
// size: 35,
// )),
// ]),
// const SizedBox(
// height: 25, // height: 25,
// ), // ),
// Center( // Row(
// child: Column( // children: [
// mainAxisAlignment: MainAxisAlignment.center, // const SizedBox(
// children: <Widget>[ // width: 35,
// _buildInputForm(), // ),
// // _buildLogo(), // const Text(
// "短信验证码登录",
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.bold,
// color: Colors.white70),
// ),
// Flexible(child: Container())
// ],
// ),
// Row(
// children: [
// const SizedBox(
// width: 35,
// ),
// const Text(
// "未注册手机验证后自动登录",
// style: TextStyle(
// fontSize: 11,
// fontWeight: FontWeight.bold,
// color: Colors.white38),
// ),
// Flexible(child: Container())
// ],
// ),
// SizedBox(
// height: 65.h,
// ),
// _buildSigMobileInput(),
// const SizedBox(
// height: 25,
// ),
// _buildSigCodeInput(),
// const SizedBox(
// height: 100,
// ),
// Container(
// height: 44.h,
// margin: EdgeInsets.only(top: 15.h),
// child: btnFlatButtonWidget(
// width: Get.width - 40,
// fontColor: Colors.black54,
// fontSize: 16,
// gbColor: Colors.green.withOpacity(0.7),
// onPressed: controller.handleSignIn,
// // controller.handleSignIn,
// title: "登录"),
// ),
// // SizedBox(
// // height: 25,
// // ),
// // Center(
// // child: Column(
// // mainAxisAlignment: MainAxisAlignment.center,
// // children: <Widget>[
// // _buildInputForm(), // // _buildInputForm(),
// // Spacer(), // // // _buildLogo(),
// // _buildThirdPartyLogin(), // // // _buildInputForm(),
// // _buildSignupButton(), // // // Spacer(),
// // // _buildThirdPartyLogin(),
// // // _buildSignupButton(),
// // ],
// // ))
// ], // ],
// )) // ),
], // ),
), // );
),
);
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment