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

1
.gitignore vendored

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

@ -4,13 +4,4 @@ A new Flutter application.
## Getting Started
This project is a starting point for a Flutter application.
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.
### 使用`fgen`生成图片

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';
//
class UserProvider extends ChangeNotifier{
bool _isSigned=false;
///
get isSigned=>_isSigned;
///
setisSigned (bool state){
_isSigned=state;
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/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_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/application/applications_page.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_ui/aku_ui.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
@ -19,14 +22,18 @@ class HomePage extends StatefulWidget {
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
//bar
Widget _menuButton(IconData iconData, String text, Widget page) {
return AkuButton(
return Expanded(
child: AkuButton(
radius: 8.w,
height: 75.w + 8.w + 33.w,
onPressed: () {
Get.to(page);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
iconData,
@ -43,12 +50,14 @@ Widget _menuButton(IconData iconData, String text, Widget page) {
)
],
),
),
);
}
//
Widget _card(String number, String text, Color color) {
return AkuButton(
radius: 8.w,
onPressed: () {},
color: Color(0xFFFFFFFF),
child: Container(
@ -63,7 +72,10 @@ Widget _card(String number, String text, Color color) {
Text(
number,
style: TextStyle(
color: color, fontSize: 40.sp, fontStyle: FontStyle.italic),
color: color,
fontSize: 40.sp,
fontFamily: 'Bebas',
),
),
SizedBox(
height: 16.w,
@ -79,13 +91,21 @@ Widget _card(String number, String text, Color color) {
);
}
class _HomePageState extends State<HomePage> {
@override
void initState() {
super.initState();
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
));
}
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
ScreenUtil.init(context,
designSize: Size(750, 1334), allowFontScaling: true);
return Scaffold(
return AnnotatedRegion<SystemUiOverlayStyle>(
child: Scaffold(
drawer: PersonalDraw(),
backgroundColor: Color(0xFFF9F9F9),
//bar
@ -103,7 +123,8 @@ class _HomePageState extends State<HomePage> {
Color(0xFFFFC40C),
],
),
borderRadius: BorderRadius.only(bottomRight: Radius.circular(32.w)),
borderRadius:
BorderRadius.only(bottomRight: Radius.circular(32.w)),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -120,10 +141,10 @@ class _HomePageState extends State<HomePage> {
width: 72.w,
height: 72.w,
//
child: Builder(builder: (BuildContext context) {
return AkuRoundButton(
height: 72.w,
onPressed: () {
child: Builder(
builder: (BuildContext context) {
return GestureDetector(
onTap: () {
Scaffold.of(context).openDrawer();
},
child: CircleAvatar(
@ -132,18 +153,20 @@ class _HomePageState extends State<HomePage> {
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,
padding: EdgeInsets.only(left: 21.w),
child: AkuButton(
//
color: Color(0xFFFFFFFF),
onPressed: () {},
radius: 8.w,
child: Row(children: [
Container(
child: Column(
@ -181,9 +204,10 @@ class _HomePageState extends State<HomePage> {
Get.to(ScanPage());
},
child: Column(children: [
Icon(
Icons.access_alarm,
size: 48.w,
Image.asset(
R.ASSETS_HOME_IC_SCAN_PNG,
height: 48.w,
width: 48.w,
),
Text(
'扫一扫',
@ -202,13 +226,12 @@ class _HomePageState extends State<HomePage> {
minWidth: 78.w,
//
height: double.infinity,
onPressed: () {
Get.to(Message());
},
onPressed: () {},
child: Column(children: [
Icon(
Icons.access_time,
size: 48.w,
Image.asset(
R.ASSETS_HOME_IC_NEWS_PNG,
height: 48.w,
width: 48.w,
),
Text(
'消息',
@ -240,17 +263,20 @@ class _HomePageState extends State<HomePage> {
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,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(8.w),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_menuButton(Icons.wysiwyg, '一键报警', HomePage()),
_menuButton(Icons.work, '访客管理', HomePage()),
_menuButton(Icons.accessibility, '报事报修', HomePage()),
_menuButton(Icons.account_balance, '全部应用', HomePage()),
_menuButton(
Icons.account_balance, '全部应用', ApplicationPage()),
],
),
),
@ -359,7 +385,10 @@ class _HomePageState extends State<HomePage> {
//
Container(
width: double.infinity,
// height: 333.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
),
child: Column(
children: [
Row(
@ -387,6 +416,8 @@ class _HomePageState extends State<HomePage> {
),
],
),
),
value: SystemUiOverlayStyle.dark,
);
}
}

@ -1,3 +1,4 @@
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';
@ -18,17 +19,19 @@ class PersonalDraw extends StatefulWidget {
}
class _PersonalDrawState extends State<PersonalDraw> {
Widget _myListTile(IconData iconData, String text, {VoidCallback onPressed}) {
Widget _myListTile(String path, String text, {VoidCallback onPressed}) {
return AkuButton(
onPressed: onPressed,
child: Container(
width: double.infinity,
height: 96.w,
padding: EdgeInsets.only(left: 32.w, top: 28.w, bottom: 28.w),
child: Row(children: [
Icon(
iconData,
size: 40.w,
padding: EdgeInsets.only(left: 32.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
path,
width: 40.w,
height: 40.w,
),
SizedBox(width: 16.w),
Text(
@ -38,7 +41,8 @@ class _PersonalDrawState extends State<PersonalDraw> {
fontSize: 28.sp,
),
),
]),
],
),
),
);
}
@ -46,7 +50,9 @@ class _PersonalDrawState extends State<PersonalDraw> {
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return Drawer(
return SizedBox(
width: 465.w,
child: Drawer(
child: ListView(
children: [
SizedBox(
@ -110,7 +116,7 @@ class _PersonalDrawState extends State<PersonalDraw> {
),
),
_myListTile(
Icons.contact_page,
R.ASSETS_USER_IC_PERSON_PNG,
'个人信息',
onPressed: () {
userProvider.isSigned
@ -118,12 +124,13 @@ class _PersonalDrawState extends State<PersonalDraw> {
: Get.to(LoginPage());
},
),
_myListTile(Icons.supervised_user_circle, '联系客服'),
_myListTile(Icons.settings, '设置', onPressed: () {
_myListTile(R.ASSETS_USER_IC_KEFU_PNG, '联系客服'),
_myListTile(R.ASSETS_USER_IC_SETUP_PNG, '设置', 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/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_scaffold.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/route_manager.dart';
class LoginPage extends StatefulWidget {
LoginPage({Key key}) : super(key: key);
@ -17,20 +21,34 @@ class LoginPage extends StatefulWidget {
}
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
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,
padding: EdgeInsets.symmetric(
vertical: 40.w,
horizontal: 32.w,
),
child: Text(
children: [
Text(
'欢迎登录小蜜蜂',
style: TextStyle(
color: AppStyle.primaryTextColor,
@ -38,24 +56,41 @@ class _LoginPageState extends State<LoginPage> {
fontSize: 48.sp,
),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Text(
AkuBox.h(184),
Text(
'手机号码',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 32.w),
width: double.infinity,
child: TextField(
autofocus: true,
controller: _textController,
onChanged: (text) {
setState(() {});
},
keyboardType: TextInputType.phone,
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(
borderSide: BorderSide(
color: Color(0xFFE8E8E8),
@ -75,10 +110,22 @@ class _LoginPageState extends State<LoginPage> {
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: AkuMaterialButton(
color: AppStyle.minorColor,
onPressed: () {},
color: AppStyle.primaryColor,
onPressed: phoneValid
? () => Get.off(LoginSMSPage(phone: _textController.text))
: null,
nullColor: Color(0xFFFFE67D),
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,7 +65,8 @@ class _AkuScaffoldState extends State<AkuScaffold> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: widget.backgroundColor,
appBar: AppBar(
appBar: widget.appBar ??
AppBar(
backgroundColor: widget.appBarColor,
leading: widget.leading ?? AkuBackButton(),
brightness: widget.brightness,

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

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

Loading…
Cancel
Save