# Conflicts:
#	lib/ui/home/home_page.dart
hmxc
张萌 4 years ago
commit b791b9aa7a

1
.gitignore vendored

@ -39,3 +39,4 @@ app.*.symbols
# Obfuscation related # Obfuscation related
app.*.map.json app.*.map.json
resource.dart

@ -4,13 +4,4 @@ A new Flutter application.
## Getting Started ## Getting Started
This project is a starting point for a Flutter application. ### 使用`fgen`生成图片
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,4 @@
class UserInfoModel {
String nickName;
String avatarPath;
}

@ -1,10 +1,18 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// //
class UserProvider extends ChangeNotifier{ class UserProvider extends ChangeNotifier{
bool _isSigned=false; bool _isSigned=false;
///
get isSigned=>_isSigned; get isSigned=>_isSigned;
///
setisSigned (bool state){ setisSigned (bool state){
_isSigned=state; _isSigned=state;
notifyListeners(); notifyListeners();
} }
} }

@ -0,0 +1,61 @@
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:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
class ApplicationPage extends StatefulWidget {
ApplicationPage({Key key}) : super(key: key);
@override
_ApplicationPageState createState() => _ApplicationPageState();
}
class _ApplicationPageState extends State<ApplicationPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
appBar: AppBar(
brightness: Brightness.light,
elevation: 0,
backgroundColor: Colors.white,
leading: SizedBox(
width: 89.w,
child: AkuBackButton(),
),
titleSpacing: 0,
title: Container(
margin: EdgeInsets.only(right: 37.w),
padding: EdgeInsets.symmetric(horizontal: 32.w),
height: 72.w,
child: Row(
children: [
Image.asset(
R.ASSETS_HOME_IC_SEARCH_PNG,
height: 40.w,
width: 40.w,
),
AkuBox.w(16),
Text(
'搜索应用',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
],
),
decoration: BoxDecoration(
color: Color(0xFFF9F9F9),
borderRadius: BorderRadius.circular(8.w),
),
),
),
body: Column(
children: [],
),
);
}
}

@ -1,13 +1,16 @@
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/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/home/messages/message.dart'; import 'package:aku_community_manager/ui/home/messages/message.dart';
import 'package:aku_community_manager/ui/home/application/applications_page.dart';
import 'package:aku_community_manager/ui/home/personal_draw.dart'; import 'package:aku_community_manager/ui/home/personal_draw.dart';
import 'package:aku_community_manager/ui/tool_pages/scan_page.dart'; import 'package:aku_community_manager/ui/tool_pages/scan_page.dart';
import 'package:aku_ui/aku_ui.dart'; import 'package:aku_ui/aku_ui.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -19,374 +22,402 @@ class HomePage extends StatefulWidget {
_HomePageState createState() => _HomePageState(); _HomePageState createState() => _HomePageState();
} }
//bar class _HomePageState extends State<HomePage> {
Widget _menuButton(IconData iconData, String text, Widget page) { //bar
return AkuButton( Widget _menuButton(IconData iconData, String text, Widget page) {
height: 75.w + 8.w + 33.w, return Expanded(
onPressed: () { child: AkuButton(
Get.to(page); radius: 8.w,
}, height: 75.w + 8.w + 33.w,
child: Column( onPressed: () {
children: [ Get.to(page);
Icon( },
iconData,
size: 75.w,
),
SizedBox(height: 8.w),
Text(
text,
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
)
],
),
);
}
//
Widget _card(String number, String text, Color color) {
return AkuButton(
onPressed: () {},
color: Color(0xFFFFFFFF),
child: Container(
width: 342.5.w,
height: 166.w,
alignment: Alignment.center,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox( Icon(
height: 32.w, iconData,
size: 75.w,
), ),
SizedBox(height: 8.w),
Text( Text(
number, text,
style: TextStyle( style: TextStyle(
color: color, fontSize: 40.sp, fontStyle: FontStyle.italic), color: Color(0xFF4A4B51),
), fontSize: 24.sp,
SizedBox( fontWeight: FontWeight.bold,
height: 16.w, ),
), )
Text(text,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
Spacer(),
], ],
)), ),
); ),
} );
}
//
Widget _card(String number, String text, Color color) {
return AkuButton(
radius: 8.w,
onPressed: () {},
color: Color(0xFFFFFFFF),
child: Container(
width: 342.5.w,
height: 166.w,
alignment: Alignment.center,
child: Column(
children: [
SizedBox(
height: 32.w,
),
Text(
number,
style: TextStyle(
color: color,
fontSize: 40.sp,
fontFamily: 'Bebas',
),
),
SizedBox(
height: 16.w,
),
Text(text,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold)),
Spacer(),
],
)),
);
}
@override
void initState() {
super.initState();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
}
class _HomePageState extends State<HomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
ScreenUtil.init(context, ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: true); designSize: Size(750, 1334), allowFontScaling: true);
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
drawer: PersonalDraw(), child: Scaffold(
backgroundColor: Color(0xFFF9F9F9), drawer: PersonalDraw(),
//bar backgroundColor: Color(0xFFF9F9F9),
appBar: PreferredSize( //bar
preferredSize: Size(375.w, 430.w - 40.w + statusBarHeight), appBar: PreferredSize(
child: Container( preferredSize: Size(375.w, 430.w - 40.w + statusBarHeight),
height: 430.w - 40.w + ScreenUtil().statusBarHeight, child: Container(
width: double.infinity, height: 430.w - 40.w + ScreenUtil().statusBarHeight,
decoration: BoxDecoration( width: double.infinity,
gradient: LinearGradient( decoration: BoxDecoration(
begin: Alignment.topCenter, gradient: LinearGradient(
end: Alignment.bottomCenter, begin: Alignment.topCenter,
colors: [ end: Alignment.bottomCenter,
Color(0xFFFFDC6F), colors: [
Color(0xFFFFC40C), Color(0xFFFFDC6F),
], Color(0xFFFFC40C),
],
),
borderRadius:
BorderRadius.only(bottomRight: Radius.circular(32.w)),
), ),
borderRadius: BorderRadius.only(bottomRight: Radius.circular(32.w)), child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, SizedBox(height: ScreenUtil().statusBarHeight),
children: [ Container(
SizedBox(height: ScreenUtil().statusBarHeight), height: 88.w,
Container( child: Row(children: [
height: 88.w, SizedBox(
child: Row(children: [ width: 16.w,
SizedBox( ),
width: 16.w, Container(
),
Container(
margin: EdgeInsets.only(top: 8.w, bottom: 8.w), margin: EdgeInsets.only(top: 8.w, bottom: 8.w),
width: 72.w, width: 72.w,
height: 72.w, height: 72.w,
// //
child: Builder(builder: (BuildContext context) { child: Builder(
return AkuRoundButton( builder: (BuildContext context) {
height: 72.w, return GestureDetector(
onPressed: () { onTap: () {
Scaffold.of(context).openDrawer(); Scaffold.of(context).openDrawer();
}, },
child: CircleAvatar( child: CircleAvatar(
radius: 36.w, radius: 36.w,
backgroundColor: Colors.grey, backgroundColor: Colors.grey,
child: userProvider.isSigned ? null : null, child: userProvider.isSigned ? null : null,
),
);
},
),
),
SizedBox(width: 16.w),
Expanded(
child: Container(
margin: EdgeInsets.only(top: 8.w, bottom: 8.w),
alignment: Alignment.center,
height: 72.w,
child: AkuButton(
//
color: Color(0xFFFFFFFF),
onPressed: () {},
radius: 8.w,
child: Row(children: [
Container(
child: Column(
children: [
SizedBox(height: 18.w),
Icon(
Icons.zoom_in_sharp,
size: 38.w,
),
],
),
),
SizedBox(width: 19.w),
Text(
'搜索工单订单号、手机',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
]),
),
),
),
SizedBox(width: 15.w),
Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
//
height: double.infinity,
minWidth: 78.w,
padding: EdgeInsets.zero,
onPressed: () {
Get.to(ScanPage());
},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_SCAN_PNG,
height: 48.w,
width: 48.w,
), ),
); Text(
})), '扫一扫',
SizedBox(width: 16.w), style: TextStyle(
Expanded( color: AppStyle.primaryTextColor,
child: Container( fontSize: 20.sp,
margin: EdgeInsets.only(top: 8.w, bottom: 8.w), fontWeight: FontWeight.normal,
alignment: Alignment.center,
height: 72.w,
padding: EdgeInsets.only(left: 21.w),
child: AkuButton(
//
color: Color(0xFFFFFFFF),
onPressed: () {},
child: Row(children: [
Container(
child: Column(
children: [
SizedBox(height: 18.w),
Icon(
Icons.zoom_in_sharp,
size: 38.w,
),
],
), ),
), ),
SizedBox(width: 19.w), ]),
),
),
Container(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
child: AkuMaterialButton(
minWidth: 78.w,
//
height: double.infinity,
onPressed: () {},
child: Column(children: [
Image.asset(
R.ASSETS_HOME_IC_NEWS_PNG,
height: 48.w,
width: 48.w,
),
Text( Text(
'搜索工单订单号、手机', '消息',
style: TextStyle( style: TextStyle(
color: AppStyle.minorTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 20.sp,
), ),
), ),
]), ]),
), ),
), ),
SizedBox(width: 17.w),
]),
),
SizedBox(height: 24.w),
Container(
margin: EdgeInsets.only(
left: 32.w,
), ),
SizedBox(width: 15.w), height: 67.w,
Container( child: Text(
margin: EdgeInsets.only(top: 5.w, bottom: 5.w), 'HI李大海',
child: MaterialButton( style: TextStyle(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, color: AppStyle.primaryTextColor,
// fontWeight: FontWeight.bold,
height: double.infinity, fontSize: 48.sp),
minWidth: 78.w, ),
padding: EdgeInsets.zero, ),
onPressed: () { SizedBox(height: 16.w),
Get.to(ScanPage()); Container(
}, margin: EdgeInsets.only(left: 32.w, right: 32.w),
child: Column(children: [ width: double.infinity,
Icon( height: 163.w,
Icons.access_alarm, decoration: BoxDecoration(
size: 48.w, color: Color(0xFFFFFFFF),
), borderRadius: BorderRadius.circular(8.w),
Text( ),
'扫一扫', child: Row(
style: TextStyle( mainAxisAlignment: MainAxisAlignment.spaceAround,
color: AppStyle.primaryTextColor, children: [
fontSize: 20.sp, _menuButton(Icons.wysiwyg, '一键报警', HomePage()),
fontWeight: FontWeight.normal, _menuButton(Icons.work, '访客管理', HomePage()),
), _menuButton(Icons.accessibility, '报事报修', HomePage()),
), _menuButton(
]), Icons.account_balance, '全部应用', ApplicationPage()),
],
),
),
],
),
),
),
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
Container(
//
width: double.infinity,
height: 45.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'今日公告',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
), ),
), ),
Container( Spacer(),
margin: EdgeInsets.only(top: 5.w, bottom: 5.w), AkuButton(
child: AkuMaterialButton( //
minWidth: 78.w, onPressed: () {},
// child: Row(
height: double.infinity, children: [
onPressed: () {
Get.to(Message());
},
child: Column(children: [
Icon(
Icons.access_time,
size: 48.w,
),
Text( Text(
'消息', '全部公告',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.minorTextColor,
fontSize: 20.sp, fontSize: 24.sp,
fontWeight: FontWeight.bold,
), ),
), ),
]), Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
)
],
), ),
), ),
SizedBox(width: 17.w), ],
]),
), ),
SizedBox(height: 24.w), ),
Container( SizedBox(height: 16.w),
margin: EdgeInsets.only( //
left: 32.w, Container(
), color: Color(0xFFFFFFFF),
height: 67.w, //
child: Text( width: double.infinity,
'HI李大海', height: 172.w,
style: TextStyle( //TODO listview
color: AppStyle.primaryTextColor, ),
SizedBox(height: 32.w),
//
Container(
width: double.infinity,
height: 45.w,
child: Row(
children: [
Text(
'待办事项',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 48.sp), ),
),
),
SizedBox(height: 16.w),
Container(
margin: EdgeInsets.only(left: 32.w, right: 32.w),
padding: EdgeInsets.only(top: 24.w),
color: Color(0xFFFFFFFF),
width: double.infinity,
height: 163.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_menuButton(Icons.wysiwyg, '一键报警', HomePage()),
_menuButton(Icons.work, '访客管理', HomePage()),
_menuButton(Icons.accessibility, '报事报修', HomePage()),
_menuButton(Icons.account_balance, '全部应用', HomePage()),
],
),
),
],
),
),
),
body: ListView(
padding: EdgeInsets.all(32.w),
children: [
Container(
//
width: double.infinity,
height: 45.w,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'今日公告',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
), ),
), Spacer(),
Spacer(), AkuButton(
AkuButton( onPressed: () {},
// child: Row(
onPressed: () {}, children: [
child: Row( Text(
children: [ '全部事项',
Text( style: TextStyle(
'全部公告', color: AppStyle.minorTextColor,
style: TextStyle( fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor, color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
), ),
), ],
Icon( ),
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
)
],
), ),
), ],
], ),
), ),
), SizedBox(height: 16.w),
SizedBox(height: 16.w), //
// Container(
Container( width: double.infinity,
color: Color(0xFFFFFFFF), height: 449.w,
// //TODO listview
width: double.infinity, ),
height: 172.w, SizedBox(height: 24.w),
//TODO listview //
), Container(
SizedBox(height: 32.w), width: double.infinity,
// decoration: BoxDecoration(
Container( borderRadius: BorderRadius.circular(8.w),
width: double.infinity, color: Colors.white,
height: 45.w, ),
child: Row( child: Column(
children: [ children: [
Text( Row(
'待办事项', children: [
style: TextStyle( _card('25', '未处理事项', Color(0xFFFF4E0D)),
color: Color(0xFF4A4B51), AkuDiveder().verticalDivider(166.5.w),
fontSize: 32.sp, _card('22', '处理中事项', Color(0xFFFFC40C)),
fontWeight: FontWeight.bold, ],
), ),
), Row(children: [
Spacer(), AkuDiveder().horizontalDivider(343.w),
AkuButton( AkuDiveder(isReverse: true).horizontalDivider(343.w)
onPressed: () {}, ]),
child: Row( Row(
children: [ children: [
Text( _card('25', '已处理事项', Color(0xFF3F8FFE)),
'全部事项', AkuDiveder(isReverse: true).verticalDivider(
style: TextStyle( 166.5.w,
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
), ),
_card('72', '全部事项', Color(0xFF333333)),
], ],
), ),
), ],
], ),
),
),
SizedBox(height: 16.w),
//
Container(
width: double.infinity,
height: 449.w,
//TODO listview
),
SizedBox(height: 24.w),
//
Container(
width: double.infinity,
// height: 333.w,
child: Column(
children: [
Row(
children: [
_card('25', '未处理事项', Color(0xFFFF4E0D)),
AkuDiveder().verticalDivider(166.5.w),
_card('22', '处理中事项', Color(0xFFFFC40C)),
],
),
Row(children: [
AkuDiveder().horizontalDivider(343.w),
AkuDiveder(isReverse: true).horizontalDivider(343.w)
]),
Row(
children: [
_card('25', '已处理事项', Color(0xFF3F8FFE)),
AkuDiveder(isReverse: true).verticalDivider(
166.5.w,
),
_card('72', '全部事项', Color(0xFF333333)),
],
),
],
), ),
), ],
], ),
), ),
value: SystemUiOverlayStyle.dark,
); );
} }
} }

@ -1,3 +1,4 @@
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/login/login_page.dart';
@ -18,27 +19,30 @@ class PersonalDraw extends StatefulWidget {
} }
class _PersonalDrawState extends State<PersonalDraw> { class _PersonalDrawState extends State<PersonalDraw> {
Widget _myListTile(IconData iconData, String text, {VoidCallback onPressed}) { Widget _myListTile(String path, String text, {VoidCallback onPressed}) {
return AkuButton( return AkuButton(
onPressed: onPressed, onPressed: onPressed,
child: Container( child: Container(
width: double.infinity,
height: 96.w, height: 96.w,
padding: EdgeInsets.only(left: 32.w, top: 28.w, bottom: 28.w), padding: EdgeInsets.only(left: 32.w),
child: Row(children: [ child: Row(
Icon( crossAxisAlignment: CrossAxisAlignment.center,
iconData, children: [
size: 40.w, Image.asset(
), path,
SizedBox(width: 16.w), width: 40.w,
Text( height: 40.w,
text, ),
style: TextStyle( SizedBox(width: 16.w),
color: AppStyle.primaryTextColor, Text(
fontSize: 28.sp, text,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
),
), ),
), ],
]), ),
), ),
); );
} }
@ -46,83 +50,86 @@ class _PersonalDrawState extends State<PersonalDraw> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
return Drawer( return SizedBox(
child: ListView( width: 465.w,
children: [ child: Drawer(
SizedBox( child: ListView(
height: 80.w - 40.w + ScreenUtil().statusBarHeight, children: [
), SizedBox(
//leading height: 80.w - 40.w + ScreenUtil().statusBarHeight,
Container( ),
margin: EdgeInsets.only(bottom: 80.w), //leading
width: double.infinity, Container(
child: Row( margin: EdgeInsets.only(bottom: 80.w),
children: [ width: double.infinity,
SizedBox(width: 32.w), child: Row(
// children: [
AkuRoundButton( SizedBox(width: 32.w),
height: 72.w, //
onPressed: () {}, AkuRoundButton(
child: CircleAvatar( height: 72.w,
radius: 36.w, onPressed: () {},
backgroundColor: Colors.grey, child: CircleAvatar(
child: userProvider.isSigned ? null : null, radius: 36.w,
backgroundColor: Colors.grey,
child: userProvider.isSigned ? null : null,
),
), ),
), SizedBox(width: 24.w),
SizedBox(width: 24.w), Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ //
// InkWell(
InkWell( onTap: () {},
onTap: () {}, child: userProvider.isSigned
child: userProvider.isSigned ? Text(
? Text( '李大海',
'李大海', style: TextStyle(
style: TextStyle( color: AppStyle.primaryTextColor,
color: AppStyle.primaryTextColor, fontSize: 28.sp,
fontSize: 28.sp, fontWeight: FontWeight.bold),
fontWeight: FontWeight.bold), )
) : Text('登录',
: Text('登录', style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold)),
),
InkWell(
onTap: () {},
child: Row(
children: [
Icon(Icons.location_on_outlined, size: 33.w),
Text(
'深圳华悦茂峰',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 24.sp),
fontWeight: FontWeight.bold)), ),
), ],
InkWell( ),
onTap: () {},
child: Row(
children: [
Icon(Icons.location_on_outlined, size: 33.w),
Text(
'深圳华悦茂峰',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp),
),
],
), ),
), ],
], ),
), ],
], ),
),
_myListTile(
R.ASSETS_USER_IC_PERSON_PNG,
'个人信息',
onPressed: () {
userProvider.isSigned
? Get.to(UserInfoPage())
: Get.to(LoginPage());
},
), ),
), _myListTile(R.ASSETS_USER_IC_KEFU_PNG, '联系客服'),
_myListTile( _myListTile(R.ASSETS_USER_IC_SETUP_PNG, '设置', onPressed: () {
Icons.contact_page, Get.to(SettingsPage());
'个人信息', }),
onPressed: () { ],
userProvider.isSigned ),
? Get.to(UserInfoPage())
: Get.to(LoginPage());
},
),
_myListTile(Icons.supervised_user_circle, '联系客服'),
_myListTile(Icons.settings, '设置', onPressed: () {
Get.to(SettingsPage());
}),
],
), ),
); );
} }

@ -2,12 +2,16 @@ import 'dart:ui';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/login/login_sms_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.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_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:extended_text/extended_text.dart'; import 'package:extended_text/extended_text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/route_manager.dart';
class LoginPage extends StatefulWidget { class LoginPage extends StatefulWidget {
LoginPage({Key key}) : super(key: key); LoginPage({Key key}) : super(key: key);
@ -17,45 +21,76 @@ class LoginPage extends StatefulWidget {
} }
class _LoginPageState extends State<LoginPage> { class _LoginPageState extends State<LoginPage> {
TextEditingController _textController = TextEditingController();
bool get phoneValid {
return RegexUtil.isMobileSimple(_textController.text);
}
bool get emptyText {
return TextUtil.isEmpty(_textController.text);
}
@override
void dispose() {
_textController?.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
backgroundColor: Colors.white, backgroundColor: Colors.white,
leading: AkuBackButton.close(), leading: AkuBackButton.close(),
body: ListView( body: ListView(
padding: EdgeInsets.symmetric(
vertical: 40.w,
horizontal: 32.w,
),
children: [ children: [
Padding( Text(
padding: EdgeInsets.only( '欢迎登录小蜜蜂',
top: 40.w, style: TextStyle(
bottom: 184.w, color: AppStyle.primaryTextColor,
left: 32.w, fontWeight: FontWeight.bold,
), fontSize: 48.sp,
child: Text(
'欢迎登录小蜜蜂',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 48.sp,
),
), ),
), ),
Padding( AkuBox.h(184),
padding: EdgeInsets.symmetric(horizontal: 32.w), Text(
child: Text( '手机号码',
'手机号码', style: TextStyle(
style: TextStyle( color: AppStyle.primaryTextColor,
color: AppStyle.primaryTextColor, fontSize: 24.sp,
fontSize: 24.sp,
),
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric(horizontal: 32.w),
width: double.infinity, width: double.infinity,
child: TextField( child: TextField(
autofocus: true, autofocus: true,
controller: _textController,
onChanged: (text) {
setState(() {});
},
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
decoration: InputDecoration( decoration: InputDecoration(
suffixIconConstraints: BoxConstraints(
minHeight: 0,
minWidth: 0,
),
suffixIcon: emptyText
? SizedBox()
: GestureDetector(
onTap: () {
_textController.clear();
setState(() {});
},
child: Icon(
CupertinoIcons.clear_circled_solid,
size: 30.w,
color: Color(0xFF999999),
),
),
border: UnderlineInputBorder( border: UnderlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: Color(0xFFE8E8E8), color: Color(0xFFE8E8E8),
@ -75,10 +110,22 @@ class _LoginPageState extends State<LoginPage> {
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w), padding: EdgeInsets.symmetric(horizontal: 32.w),
child: AkuMaterialButton( child: AkuMaterialButton(
color: AppStyle.minorColor, color: AppStyle.primaryColor,
onPressed: () {}, onPressed: phoneValid
? () => Get.off(LoginSMSPage(phone: _textController.text))
: null,
nullColor: Color(0xFFFFE67D),
radius: 8.w, radius: 8.w,
child: Text('获取验证码'), child: Text(
'获取验证码',
style: TextStyle(
color: phoneValid
? AppStyle.primaryTextColor
: AppStyle.minorTextColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
), ),
), ),
], ],

@ -0,0 +1,126 @@
import 'dart:async';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/home/home_page.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';
import 'package:get/get.dart';
import 'package:pin_input_text_field/pin_input_text_field.dart';
import 'package:provider/provider.dart';
class LoginSMSPage extends StatefulWidget {
final String phone;
LoginSMSPage({Key key, this.phone}) : super(key: key);
@override
_LoginSMSPageState createState() => _LoginSMSPageState();
}
class _LoginSMSPageState extends State<LoginSMSPage> {
TextEditingController _textEditingController = TextEditingController();
int _count = 60;
Timer _countTimer;
bool get canResend => _count <= 0;
String get countString {
if (_count <= 0)
return '';
else
return '$_count\s';
}
startTick() {
_count = 60;
_countTimer = Timer.periodic(Duration(seconds: 1), (timer) {
if (_count >= 0)
_count--;
else {
_countTimer?.cancel();
}
setState(() {});
});
}
@override
void initState() {
super.initState();
startTick();
}
@override
void dispose() {
_textEditingController?.dispose();
_countTimer?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
backgroundColor: Colors.white,
leading: AkuBackButton(),
body: ListView(
padding: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 40.w,
),
children: [
Text(
'请输入短信验证码',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 48.sp,
),
),
AkuBox.h(16),
Text(
'已向${widget.phone}发送了一个验证码',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
AkuBox.h(160),
PinInputTextField(
controller: _textEditingController,
autoFocus: true,
decoration: UnderlineDecoration(
lineHeight: 1.w,
colorBuilder: FixedColorBuilder(Color(0xFFE8E8E8)),
),
onChanged: (text) {
final userProvider =
Provider.of<UserProvider>(context, listen: false);
if (text == '000000') {
userProvider.setisSigned(true);
Get.offAll(HomePage());
}
},
),
AkuBox.h(40),
Row(
children: [
AkuMaterialButton(
onPressed: canResend ? () => startTick() : null,
child: Text(
'重新发送 $countString',
style: TextStyle(
color: canResend
? AppStyle.secondaryColor
: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
),
],
),
],
),
);
}
}

@ -65,22 +65,23 @@ class _AkuScaffoldState extends State<AkuScaffold> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: widget.backgroundColor, backgroundColor: widget.backgroundColor,
appBar: AppBar( appBar: widget.appBar ??
backgroundColor: widget.appBarColor, AppBar(
leading: widget.leading ?? AkuBackButton(), backgroundColor: widget.appBarColor,
brightness: widget.brightness, leading: widget.leading ?? AkuBackButton(),
elevation: 0, brightness: widget.brightness,
centerTitle: true, elevation: 0,
title: DefaultTextStyle( centerTitle: true,
style: widget.titleStyle ?? title: DefaultTextStyle(
TextStyle( style: widget.titleStyle ??
fontWeight: FontWeight.bold, TextStyle(
color: Color(0xFF333333), fontWeight: FontWeight.bold,
fontSize: 36.sp, color: Color(0xFF333333),
), fontSize: 36.sp,
child: Text(widget.title ?? ''), ),
), child: Text(widget.title ?? ''),
), ),
),
body: widget.body, body: widget.body,
bottomNavigationBar: widget.bottom, bottomNavigationBar: widget.bottom,
); );

@ -6,7 +6,7 @@ packages:
description: description:
path: "." path: "."
ref: HEAD ref: HEAD
resolved-ref: e57b6920e49f325c041fac955e1f3297dc9f1d09 resolved-ref: "89d1e665c372461ed87be46c9227377b305050b2"
url: "http://test.akuhotel.com:8099/aku_fe/aku_ui.git" url: "http://test.akuhotel.com:8099/aku_fe/aku_ui.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
@ -66,6 +66,27 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0-nullsafety.3" version: "1.15.0-nullsafety.3"
common_utils:
dependency: "direct main"
description:
name: common_utils
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.1"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.5"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -73,6 +94,13 @@ 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"
decimal:
dependency: transitive
description:
name: decimal
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.5"
extended_text: extended_text:
dependency: "direct main" dependency: "direct main"
description: description:
@ -153,6 +181,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.1"
pin_input_text_field:
dependency: "direct main"
description:
name: pin_input_text_field
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.1"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
@ -167,6 +202,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.0.13" version: "0.0.13"
rational:
dependency: transitive
description:
name: rational
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.8"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter

@ -44,6 +44,10 @@ dependencies:
extended_text: ^4.0.0 extended_text: ^4.0.0
common_utils: ^1.2.1
#验证码
pin_input_text_field: ^3.1.1
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
@ -61,6 +65,10 @@ flutter:
# included with your application, so that you can use the icons in # included with your application, so that you can use the icons in
# the material Icons class. # the material Icons class.
uses-material-design: true uses-material-design: true
assets:
- assets/
- assets/home/
- assets/user/
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg
@ -74,12 +82,10 @@ flutter:
# "family" key with the font family name, and a "fonts" key with a # "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For # list giving the asset and other descriptors for the font. For
# example: # example:
# fonts: fonts:
# - family: Schyler - family: Bebas
# fonts: fonts:
# - asset: fonts/Schyler-Regular.ttf - asset: assets/fonts/BebasNeue-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro # - family: Trajan Pro
# fonts: # fonts:
# - asset: fonts/TrajanPro.ttf # - asset: fonts/TrajanPro.ttf

Loading…
Cancel
Save