# Conflicts:
#	lib/style/app_style.dart
hmxc
张萌 4 years ago
commit 6f02b7d4fe

@ -1,30 +1,31 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class AppStyle {
//
static const primaryColor = Color(0xFFFDCF12);
static const minorColor = Color(0xFFFFDF5D);
static const secondaryColor = Color(0xFF3F8FFE);
//
///
static const primaryTextColor = Color(0xFF333333);
///
static const minorTextColor = Color(0xFF999999);
//
///
static const backgroundColor = Color(0xFFF9F9F9);
///
final barTitleStyle = TextStyle(
color: primaryTextColor,
fontSize: 36.sp,
fontWeight: FontWeight.bold,
);
final primaryStyle = TextStyle(
color: primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold
);
color: primaryTextColor, fontSize: 28.sp, fontWeight: FontWeight.bold);
final minorStyle = TextStyle(
color: minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.normal
);
color: minorTextColor, fontSize: 24.sp, fontWeight: FontWeight.normal);
}

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
//线
///线
class AkuDiveder {
final bool isReverse; //
const AkuDiveder({Key key, this.isReverse = false});
@ -23,6 +24,7 @@ class AkuDiveder {
])),
);
}
Widget horizontalDivider(double width) {
return Container(
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,
);
}
}

@ -184,7 +184,6 @@ class _HomePageState extends State<HomePage> {
Icons.access_alarm,
size: 48.w,
),
SizedBox(height: 2.w),
Text(
'扫一扫',
style: TextStyle(
@ -208,7 +207,6 @@ class _HomePageState extends State<HomePage> {
Icons.access_time,
size: 48.w,
),
SizedBox(height: 2.w),
Text(
'消息',
style: TextStyle(

@ -1,6 +1,8 @@
import 'package:aku_community_manager/provider/user_provider.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/user_info_page.dart';
import 'package:aku_ui/common_widgets/aku_button.dart';
import 'package:aku_ui/common_widgets/aku_round_button.dart';
import 'package:flutter/material.dart';
@ -54,7 +56,6 @@ class _PersonalDrawState extends State<PersonalDraw> {
Container(
margin: EdgeInsets.only(bottom: 80.w),
width: double.infinity,
height: 72.w,
child: Row(
children: [
SizedBox(width: 32.w),
@ -108,7 +109,15 @@ class _PersonalDrawState extends State<PersonalDraw> {
],
),
),
_myListTile(Icons.contact_page, '个人信息'),
_myListTile(
Icons.contact_page,
'个人信息',
onPressed: () {
userProvider.isSigned
? Get.to(UserInfoPage())
: Get.to(LoginPage());
},
),
_myListTile(Icons.supervised_user_circle, '联系客服'),
_myListTile(Icons.settings, '设置', onPressed: () {
Get.to(SettingsPage());

@ -0,0 +1,134 @@
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:extended_text/extended_text.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(
height: 110.w,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 40.w),
child: ExtendedText.rich(
TextSpan(
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 22.sp,
),
children: [
TextSpan(
text: '登录即代表您已同意我们的',
),
ExtendedWidgetSpan(
child: GestureDetector(
child: Text(
'《服务协议》',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 22.sp,
),
),
),
),
TextSpan(
text: '',
),
ExtendedWidgetSpan(
child: GestureDetector(
child: Text(
'《隐私政策》',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 22.sp,
),
),
),
),
TextSpan(
text: '',
),
],
),
),
),
);
}
}

@ -0,0 +1,64 @@
import 'package:aku_community_manager/style/app_style.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 SettingFeedBackPage extends StatefulWidget {
SettingFeedBackPage({Key key}) : super(key: key);
@override
_SettingFeedBackPageState createState() => _SettingFeedBackPageState();
}
class _SettingFeedBackPageState extends State<SettingFeedBackPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '意见反馈',
backgroundColor: Colors.white,
body: ListView(
children: [
Container(
height: 20.w,
color: AppStyle.backgroundColor,
),
Container(
margin: EdgeInsets.symmetric(
vertical: 24.w,
horizontal: 32.w,
),
padding: EdgeInsets.all(24.w),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TextField(
minLines: 5,
maxLines: 99,
decoration: InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.zero,
hintText: '请输入你的意见和建议',
hintStyle: TextStyle(
color: Color(0xFF999999),
fontSize: 28.sp,
),
),
),
],
),
decoration: BoxDecoration(
color: AppStyle.backgroundColor,
borderRadius: BorderRadius.circular(16.w),
),
),
],
),
bottom: AkuMaterialButton(
onPressed: () {},
child: Text('提交'),
color: AppStyle.minorColor,
),
);
}
}

@ -1,5 +1,11 @@
import 'package:aku_community_manager/ui/settings/setting_feedback_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/get.dart';
class SettingsPage extends StatefulWidget {
SettingsPage({Key key}) : super(key: key);
@ -13,7 +19,38 @@ class _SettingsPageState extends State<SettingsPage> {
Widget build(BuildContext context) {
return AkuScaffold(
title: '设置',
body: Text('test'),
body: ListView(
padding: EdgeInsets.symmetric(
vertical: 16.w,
),
children: [
AkuTile(
title: Text('是否接受信息通知'),
arrow: false,
suffix: CupertinoSwitch(
value: false,
onChanged: (value) {},
),
),
Divider(height: 1.w),
AkuTile(
title: Text('关于我们'),
arrow: true,
),
Divider(height: 1.w),
AkuTile(
title: Text('意见反馈'),
arrow: true,
onTap: () => Get.to(SettingFeedBackPage()),
),
Divider(height: 1.w),
AkuTile(
title: Text('清理缓存'),
arrow: true,
onTap: () => BotToast.showText(text: '缓存清理完成'),
),
],
),
);
}
}

@ -0,0 +1,40 @@
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/get.dart';
class UserInfoPage extends StatefulWidget {
UserInfoPage({Key key}) : super(key: key);
@override
_UserInfoPageState createState() => _UserInfoPageState();
}
class _UserInfoPageState extends State<UserInfoPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '个人信息',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w),
children: [
AkuTile(
onTap: () {},
title: Text('头像'),
height: 168.w,
suffix: CircleAvatar(radius: 60.w),
),
AkuTile(
onTap: () {},
title: Text('昵称'),
),
AkuTile(
onTap: () {},
title: Text('手机'),
),
],
),
);
}
}

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

@ -35,10 +35,14 @@ class AkuScaffold extends StatefulWidget {
///body
final Widget body;
final Widget bottom;
///
///
///`0xFFF9F9F9`
final Color backgroundColor;
final Color appBarColor;
AkuScaffold({
Key key,
this.appBar,
@ -48,6 +52,8 @@ class AkuScaffold extends StatefulWidget {
this.brightness = Brightness.light,
this.body,
this.backgroundColor = const Color(0XFFF9F9F9),
this.bottom,
this.appBarColor = Colors.white,
}) : super(key: key);
@override
@ -60,7 +66,7 @@ class _AkuScaffoldState extends State<AkuScaffold> {
return Scaffold(
backgroundColor: widget.backgroundColor,
appBar: AppBar(
backgroundColor: Colors.white,
backgroundColor: widget.appBarColor,
leading: widget.leading ?? AkuBackButton(),
brightness: widget.brightness,
elevation: 0,
@ -72,10 +78,11 @@ class _AkuScaffoldState extends State<AkuScaffold> {
color: Color(0xFF333333),
fontSize: 36.sp,
),
child: Text(widget.title),
child: Text(widget.title ?? ''),
),
),
body: widget.body,
bottomNavigationBar: widget.bottom,
);
}
}

@ -0,0 +1,70 @@
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 AkuTile extends StatefulWidget {
final Widget prefix;
final Widget suffix;
final Widget title;
final bool arrow;
final Color color;
final double height;
final VoidCallback onTap;
AkuTile({
Key key,
this.prefix,
this.suffix,
this.title,
this.arrow = true,
this.onTap,
this.color = Colors.white,
this.height,
}) : super(key: key);
@override
_AkuTileState createState() => _AkuTileState();
}
class _AkuTileState extends State<AkuTile> {
double get height => widget.height ?? 96.w;
@override
Widget build(BuildContext context) {
return SizedBox(
height: height,
child: Material(
color: widget.color,
child: InkWell(
onTap: widget.onTap,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Row(
children: [
widget.prefix ?? SizedBox(),
DefaultTextStyle(
style: TextStyle(
color: Color(0xFF333333),
fontSize: 28.sp,
),
child: widget.title,
),
Spacer(),
widget.suffix ?? SizedBox(),
widget.suffix != null && widget.arrow
? SizedBox(width: 24.w)
: SizedBox(),
widget.arrow
? Icon(
Icons.arrow_forward_ios,
size: 24.w,
color: Color(0xFF999999),
)
: SizedBox(),
],
),
),
),
),
);
}
}

@ -73,6 +73,20 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
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:
dependency: transitive
description:
@ -216,4 +230,4 @@ packages:
version: "2.1.0-nullsafety.3"
sdks:
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
bot_toast: ^3.0.4
extended_text: ^4.0.0
aku_ui:
git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git

Loading…
Cancel
Save