init
This commit is contained in:
41
lib/pages/auth/agreement.dart
Normal file
41
lib/pages/auth/agreement.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AgreementPages extends StatefulWidget {
|
||||
const AgreementPages({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
@override
|
||||
State<AgreementPages> createState() => _AgreementPagesState();
|
||||
}
|
||||
|
||||
class _AgreementPagesState extends State<AgreementPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('隐私协议'),
|
||||
),
|
||||
body: const UserAgreement(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 用户协议
|
||||
class UserAgreement extends StatelessWidget {
|
||||
const UserAgreement({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('用户协议');
|
||||
}
|
||||
}
|
||||
|
||||
/// 隐私协议
|
||||
class PrivacyAgreement extends StatelessWidget {
|
||||
const PrivacyAgreement({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('隐私协议');
|
||||
}
|
||||
}
|
||||
135
lib/pages/auth/auth.dart
Normal file
135
lib/pages/auth/auth.dart
Normal file
@@ -0,0 +1,135 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main_color.dart';
|
||||
import './agreement.dart';
|
||||
|
||||
///widget
|
||||
import './widget/auth_input.dart';
|
||||
import './widget/auth_title.dart';
|
||||
|
||||
/// 登录
|
||||
class AuthPages extends StatefulWidget {
|
||||
const AuthPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AuthPages> createState() => _AuthPagesState();
|
||||
}
|
||||
|
||||
class _AuthPagesState extends State<AuthPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(30.0, 40.0, 30.0, 50.0),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
image: AssetImage('assets/login/auth_bg.png'),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const AuthTitle(title: '共力生态'),
|
||||
const AuthTitle(title: '即可开始你的共力人生'),
|
||||
const SizedBox(height: 40.0),
|
||||
const AuthInput(hint: '输入手机号码'),
|
||||
const SizedBox(height: 20.0),
|
||||
const AuthInput(hint: '输入验证码'),
|
||||
const SizedBox(height: 40.0),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50.0,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all(tMainColor),
|
||||
),
|
||||
onPressed: null,
|
||||
child: const Text(
|
||||
'登录',
|
||||
style: TextStyle(
|
||||
fontSize: 16.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15.0),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'登录即表示同意',
|
||||
style: TextStyle(
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
const EdgeInsets.all(0.00),
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
),
|
||||
child: const Text(
|
||||
'用户协议',
|
||||
style: TextStyle(
|
||||
color: tMainColor,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const AgreementPages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'和',
|
||||
style: TextStyle(
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(
|
||||
const EdgeInsets.all(0.00),
|
||||
),
|
||||
overlayColor: MaterialStateProperty.all(Colors.transparent),
|
||||
),
|
||||
child: const Text(
|
||||
'隐私保护',
|
||||
style: TextStyle(
|
||||
color: tMainColor,
|
||||
),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const AgreementPages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
const Text(
|
||||
'协议',
|
||||
style: TextStyle(
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
42
lib/pages/auth/role.dart
Normal file
42
lib/pages/auth/role.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../store/store.dart';
|
||||
|
||||
class RolePages extends StatefulWidget {
|
||||
const RolePages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<RolePages> createState() => _RolePagesState();
|
||||
}
|
||||
|
||||
class _RolePagesState extends State<RolePages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('创建角色'),
|
||||
shadowColor: Colors.transparent,
|
||||
backgroundColor: Colors.white,
|
||||
leading: const BackButton(
|
||||
color: Colors.black,
|
||||
),
|
||||
titleTextStyle: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 16.0,
|
||||
),
|
||||
),
|
||||
body: Center(
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) {
|
||||
return const StorePages();
|
||||
}),
|
||||
);
|
||||
},
|
||||
child: const Text('创建角色'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
49
lib/pages/auth/widget/auth_input.dart
Normal file
49
lib/pages/auth/widget/auth_input.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 输入框
|
||||
class AuthInput extends StatelessWidget {
|
||||
final String hint;
|
||||
final bool password;
|
||||
|
||||
const AuthInput({
|
||||
Key? key,
|
||||
this.hint = '',
|
||||
this.password = false,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: 50.0,
|
||||
alignment: Alignment.center,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(25.0),
|
||||
child: TextField(
|
||||
obscureText: password,
|
||||
style: const TextStyle(
|
||||
fontSize: 15.0,
|
||||
color: Color(0xff000000),
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: hint,
|
||||
fillColor: Colors.white,
|
||||
filled: true,
|
||||
contentPadding: const EdgeInsets.fromLTRB(20.0, 0, 20.0, 0),
|
||||
enabledBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(5.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
18
lib/pages/auth/widget/auth_title.dart
Normal file
18
lib/pages/auth/widget/auth_title.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 文字标题
|
||||
class AuthTitle extends StatelessWidget {
|
||||
final String title;
|
||||
const AuthTitle({Key? key, this.title = ''}) : super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 25.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xffffffff),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user