add login page

hmxc
小赖 4 years ago
parent ae0bfe38b1
commit a30eecbdbb

@ -1,9 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
//线
class AkuDiveder { ///线
final bool isReverse;// class AkuDiveder {
const AkuDiveder({Key key,this.isReverse=false}); final bool isReverse; //
const AkuDiveder({Key key, this.isReverse = false});
Widget verticalDivider(double height) { Widget verticalDivider(double height) {
return Container( return Container(
width: 1.w, width: 1.w,
@ -23,6 +24,7 @@ class AkuDiveder {
])), ])),
); );
} }
Widget horizontalDivider(double width) { Widget horizontalDivider(double width) {
return Container( return Container(
width: width, width: width,
@ -43,3 +45,17 @@ class AkuDiveder {
); );
} }
} }
class AkuBox {
static h(double height) {
return SizedBox(
height: height.w,
);
}
static w(double width) {
return SizedBox(
width: width.w,
);
}
}

@ -1,5 +1,6 @@
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/login/login_page.dart';
import 'package:aku_community_manager/ui/settings/settings_page.dart'; import 'package:aku_community_manager/ui/settings/settings_page.dart';
import 'package:aku_community_manager/ui/settings/user_info_page.dart'; import 'package:aku_community_manager/ui/settings/user_info_page.dart';
import 'package:aku_ui/common_widgets/aku_button.dart'; import 'package:aku_ui/common_widgets/aku_button.dart';
@ -112,7 +113,9 @@ class _PersonalDrawState extends State<PersonalDraw> {
Icons.contact_page, Icons.contact_page,
'个人信息', '个人信息',
onPressed: () { onPressed: () {
Get.to(UserInfoPage()); userProvider.isSigned
? Get.to(UserInfoPage())
: Get.to(LoginPage());
}, },
), ),
_myListTile(Icons.supervised_user_circle, '联系客服'), _myListTile(Icons.supervised_user_circle, '联系客服'),

@ -0,0 +1,91 @@
import 'dart:ui';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
class LoginPage extends StatefulWidget {
LoginPage({Key key}) : super(key: key);
@override
_LoginPageState createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
backgroundColor: Colors.white,
leading: AkuBackButton.close(),
body: ListView(
children: [
Padding(
padding: EdgeInsets.only(
top: 40.w,
bottom: 184.w,
left: 32.w,
),
child: Text(
'欢迎登录小蜜蜂',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 48.sp,
),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text(
'手机号码',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 32.w),
width: double.infinity,
child: TextField(
autofocus: true,
keyboardType: TextInputType.phone,
decoration: InputDecoration(
border: UnderlineInputBorder(
borderSide: BorderSide(
color: Color(0xFFE8E8E8),
width: 1.w,
),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(
color: Color(0xFFE8E8E8),
width: 2.w,
),
),
),
),
),
AkuBox.h(80),
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: AkuMaterialButton(
color: AppStyle.minorColor,
onPressed: () {},
radius: 8.w,
child: Text('获取验证码'),
),
),
],
),
bottom: Container(
padding: EdgeInsets.all(40),
child: Text(''),
),
);
}
}

@ -3,9 +3,17 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
class AkuBackButton extends StatefulWidget { class AkuBackButton extends StatefulWidget {
final Brightness brightness; final Brightness brightness;
final IconData icon;
AkuBackButton({ AkuBackButton({
Key key, Key key,
this.brightness = Brightness.light, this.brightness = Brightness.light,
this.icon = Icons.arrow_back_ios,
}) : super(key: key);
AkuBackButton.close({
Key key,
this.brightness = Brightness.light,
this.icon = Icons.clear,
}) : super(key: key); }) : super(key: key);
@override @override
@ -18,7 +26,7 @@ class _AkuBackButtonState extends State<AkuBackButton> {
return Navigator.canPop(context) return Navigator.canPop(context)
? IconButton( ? IconButton(
icon: Icon( icon: Icon(
Icons.arrow_back_ios, widget.icon,
size: 32.w, size: 32.w,
color: widget.brightness == Brightness.light color: widget.brightness == Brightness.light
? Color(0xFF333333) ? Color(0xFF333333)

@ -41,6 +41,8 @@ class AkuScaffold extends StatefulWidget {
/// ///
///`0xFFF9F9F9` ///`0xFFF9F9F9`
final Color backgroundColor; final Color backgroundColor;
final Color appBarColor;
AkuScaffold({ AkuScaffold({
Key key, Key key,
this.appBar, this.appBar,
@ -51,6 +53,7 @@ class AkuScaffold extends StatefulWidget {
this.body, this.body,
this.backgroundColor = const Color(0XFFF9F9F9), this.backgroundColor = const Color(0XFFF9F9F9),
this.bottom, this.bottom,
this.appBarColor = Colors.white,
}) : super(key: key); }) : super(key: key);
@override @override
@ -63,7 +66,7 @@ class _AkuScaffoldState extends State<AkuScaffold> {
return Scaffold( return Scaffold(
backgroundColor: widget.backgroundColor, backgroundColor: widget.backgroundColor,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.white, backgroundColor: widget.appBarColor,
leading: widget.leading ?? AkuBackButton(), leading: widget.leading ?? AkuBackButton(),
brightness: widget.brightness, brightness: widget.brightness,
elevation: 0, elevation: 0,
@ -75,7 +78,7 @@ class _AkuScaffoldState extends State<AkuScaffold> {
color: Color(0xFF333333), color: Color(0xFF333333),
fontSize: 36.sp, fontSize: 36.sp,
), ),
child: Text(widget.title), child: Text(widget.title ?? ''),
), ),
), ),
body: widget.body, body: widget.body,

@ -73,6 +73,20 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
extended_text:
dependency: "direct main"
description:
name: extended_text
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.0"
extended_text_library:
dependency: transitive
description:
name: extended_text_library
url: "https://pub.flutter-io.cn"
source: hosted
version: "4.0.1"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
@ -216,4 +230,4 @@ packages:
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.3"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.17.0 <2.0.0" flutter: ">=1.20.0 <2.0.0"

@ -42,6 +42,8 @@ dependencies:
#toast #toast
bot_toast: ^3.0.4 bot_toast: ^3.0.4
extended_text: ^4.0.0
aku_ui: aku_ui:
git: git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git

Loading…
Cancel
Save