Commit 644751c6 authored by 关振斌's avatar 关振斌

update

parent 8fcf01e0
...@@ -60,18 +60,18 @@ class DoctorAppBar extends StatelessWidget { ...@@ -60,18 +60,18 @@ class DoctorAppBar extends StatelessWidget {
height: 60, height: 60,
width: 60, width: 60,
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
blurRadius: 3, // blurRadius: 3,
offset: Offset(0, 4), // offset: Offset(0, 4),
color: Colors.black54, // color: Colors.black54,
) // )
], // ],
color: Color(0xffA295FD), // color: Color(0xffA295FD),
borderRadius: BorderRadius.circular(5)), borderRadius: BorderRadius.circular(5)),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
child: Image.asset("assets/images/doctor_1.png")), child: Image.asset("assets/images/dingyue.png")),
), ),
) )
], ],
......
...@@ -2,6 +2,7 @@ import 'dart:async'; ...@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:chart/entity/user_entity.dart'; import 'package:chart/entity/user_entity.dart';
import 'package:chart/pages/dashboard/dashboard_page.dart'; import 'package:chart/pages/dashboard/dashboard_page.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -9,6 +10,7 @@ import 'package:url_launcher/link.dart'; ...@@ -9,6 +10,7 @@ import 'package:url_launcher/link.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:pinput/pinput.dart'; import 'package:pinput/pinput.dart';
import "package:chart/service/user_service.dart"; import "package:chart/service/user_service.dart";
import 'package:gradient_widgets/gradient_widgets.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
const LoginPage({super.key}); const LoginPage({super.key});
...@@ -54,6 +56,9 @@ class _MyHomePageState extends State<LoginPage> { ...@@ -54,6 +56,9 @@ class _MyHomePageState extends State<LoginPage> {
} }
_getCode() async { _getCode() async {
if (controller.text.length < 11) {
return EasyLoading.showError("手机号码输入有误!");
}
EasyLoading.show(status: "发送验证码..."); EasyLoading.show(status: "发送验证码...");
var phone = controller.text var phone = controller.text
.replaceAll("+", "") .replaceAll("+", "")
...@@ -104,49 +109,202 @@ class _MyHomePageState extends State<LoginPage> { ...@@ -104,49 +109,202 @@ class _MyHomePageState extends State<LoginPage> {
); );
return Scaffold( return Scaffold(
appBar: AppBar(), // appBar: AppBar(),
body: Container( body: SingleChildScrollView(
physics: const ClampingScrollPhysics(),
child: GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
// decoration: const BoxDecoration(
// gradient: LinearGradient(
// colors: <Color>[
// CustomTheme.loginGradientStart,
// CustomTheme.loginGradientEnd
// ],
// begin: FractionalOffset(0.0, 0.0),
// end: FractionalOffset(1.0, 1.0),
// stops: <double>[0.0, 1.0],
// tileMode: TileMode.clamp),
// ),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: Image.asset("assets/images/bg.png").image, image: Image.asset("assets/images/bg.png").image,
fit: BoxFit.cover), fit: BoxFit.cover),
), ),
// p
padding: EdgeInsets.symmetric(horizontal: 40), padding: EdgeInsets.symmetric(horizontal: 40),
// color: Colors.red, // color: Colors.red,
width: double.infinity, // width: double.infinity,
height: double.infinity, // height: double.infinity,
child: Center(
child: child:
Column(mainAxisAlignment: MainAxisAlignment.center, children: [ // Container(
// width: double.infinity,
// color: Colors.red,
// height: 300,
// child: Text(""),
// ),
Column(
children: [
Container(
padding:
EdgeInsets.symmetric(horizontal: 16, vertical: 80),
// height: 200,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"GPT大师傅",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 30,
),
)
]),
),
Center(
child: GlassmorphicContainer(
width: MediaQuery.of(context).size.width * .9,
height: 280.0,
borderRadius: 16,
padding: EdgeInsets.only(bottom: 16),
blur: 14,
alignment: Alignment.bottomCenter,
border: 2,
child: Container(
padding: EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextField( TextField(
autofocus: true, autofocus: true,
controller: controller, controller: controller,
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
style: const TextStyle(color: Colors.white, fontSize: 16), style: const TextStyle(
color: Colors.white, fontSize: 16),
decoration: InputDecoration( decoration: InputDecoration(
labelStyle: TextStyle(
color: Colors.white.withOpacity(1)),
hintStyle: TextStyle(
color: Colors.grey,
textBaseline: TextBaseline.ideographic,
),
labelText: '电话号码', labelText: '电话号码',
border: OutlineInputBorder( border: OutlineInputBorder(
borderSide: BorderSide(), borderSide: const BorderSide(),
),
enabledBorder: OutlineInputBorder(
///设置边框四个角的弧度
borderRadius:
BorderRadius.all(Radius.circular(20)),
///用来配置边框的样式
borderSide: BorderSide(
///设置边框的颜色
color: Colors.white.withOpacity(.2),
///设置边框的粗细
width: 2.0,
),
),
focusedBorder: OutlineInputBorder(
///设置边框四个角的弧度
borderRadius:
BorderRadius.all(Radius.circular(20)),
///用来配置边框的样式
borderSide: BorderSide(
///设置边框的颜色
color: Colors.white.withOpacity(1),
///设置边框的粗细
width: 2.0,
),
), ),
), ),
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(13) LengthLimitingTextInputFormatter(13)
], ],
// decoration: InputDecoration(
// filled: true,
// enabledBorder: OutlineInputBorder(
// borderSide: BorderSide(color: Color(0x00FF0000)),
// borderRadius: BorderRadius.all(
// Radius.circular(100),
// ),
// ),
// focusedBorder: OutlineInputBorder(
// borderSide: BorderSide(color: Color(0x00000000)),
// borderRadius: BorderRadius.all(
// Radius.circular(100),
// ),
// ),
// contentPadding: EdgeInsets.all(10),
// prefixIcon: Icon(Icons.lock),
// // fillColor: Colors.blue,
// hintText: "请输入密码",
// ),
// ),
onChanged: (v) => _splitPhoneNumber(v), onChanged: (v) => _splitPhoneNumber(v),
), ),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
MaterialButton( Container(
width: double.infinity,
margin: EdgeInsets.only(top: 30),
// col
// child: GradientButton(
// child: Text('Gradient'),
// callback: () {},
// gradient: Gradients.ali,
// shadowColor: Gradients.backToFuture.colors.last
// .withOpacity(0.25),
// ),
child: MaterialButton(
shape: RoundedRectangleBorder(
// 圆角矩形
borderRadius: BorderRadius.all(
Radius.circular(10)),
),
padding:
EdgeInsets.symmetric(vertical: 12),
child: Text('确定'), child: Text('确定'),
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
textColor: Colors.white, textColor: Colors.white,
onPressed: _getCode), onPressed: _getCode),
]), )
],
),
),
linearGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(0.2),
Color(0xFF0FFFF).withOpacity(0.2),
],
),
borderGradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [
Color(0xFF0FFFF).withOpacity(1),
Color(0xFFFFFFF),
Color(0xFF0FFFF).withOpacity(1),
],
), ),
)); ),
),
],
)),
)));
} }
int inputLength = 0; int inputLength = 0;
...@@ -175,3 +333,19 @@ class _MyHomePageState extends State<LoginPage> { ...@@ -175,3 +333,19 @@ class _MyHomePageState extends State<LoginPage> {
inputLength = text.length; inputLength = text.length;
} }
} }
class CustomTheme {
const CustomTheme();
static const Color loginGradientStart = Color(0xFFfbab66);
static const Color loginGradientEnd = Color(0xFFf7418c);
static const Color white = Color(0xFFFFFFFF);
static const Color black = Color(0xFF000000);
static const LinearGradient primaryGradient = LinearGradient(
colors: <Color>[loginGradientStart, loginGradientEnd],
stops: <double>[0.0, 1.0],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
);
}
...@@ -121,10 +121,10 @@ class UserPageState extends State<UserPage> { ...@@ -121,10 +121,10 @@ class UserPageState extends State<UserPage> {
items: [ items: [
SettingsItem( SettingsItem(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/ms-code'); Navigator.of(context).pushNamed('/login');
}, },
icons: Icons.exit_to_app_rounded, icons: Icons.exit_to_app_rounded,
title: "Sign Out", title: "${_userModel.isLogin}",
), ),
SettingsItem( SettingsItem(
onTap: () {}, onTap: () {},
......
...@@ -483,6 +483,13 @@ packages: ...@@ -483,6 +483,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "3.0.0"
gradient_widgets:
dependency: "direct main"
description:
name: gradient_widgets
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.0"
html: html:
dependency: transitive dependency: transitive
description: description:
......
...@@ -93,6 +93,7 @@ dependencies: ...@@ -93,6 +93,7 @@ dependencies:
easy_container: ^1.0.4 easy_container: ^1.0.4
intl_phone_field: ^3.1.0 intl_phone_field: ^3.1.0
extended_phone_number_input: ^1.0.2 extended_phone_number_input: ^1.0.2
gradient_widgets: ^0.6.0
# package:bubble/bubble.dart # package:bubble/bubble.dart
dev_dependencies: dev_dependencies:
......
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