添加代办事项页面

hmxc
小赖 4 years ago
parent 5a33596b4f
commit e71514623c

@ -1,8 +1,10 @@
import 'dart:io';
class UserInfoModel {
String nickName;
String avatarPath;
File avatar;
UserInfoModel({
this.nickName,
this.avatarPath,
this.avatar,
});
}

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:flutter/material.dart';
@ -17,7 +19,7 @@ class UserProvider extends ChangeNotifier {
UserInfoModel _userInfoModel = UserInfoModel(
nickName: '李大海',
avatarPath: R.ASSETS_STATIC_TEMP_F3_WEBP,
avatar: null,
);
UserInfoModel get userInfoModel => _userInfoModel;
@ -26,4 +28,9 @@ class UserProvider extends ChangeNotifier {
_userInfoModel.nickName = name;
notifyListeners();
}
setAvatar(File file) {
_userInfoModel.avatar = file;
notifyListeners();
}
}

@ -0,0 +1,60 @@
import 'package:aku_community_manager/style/app_style.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 BusinessPage extends StatefulWidget {
///DEFAULT IS 0
final int initIndex;
BusinessPage({Key key, this.initIndex = 0}) : super(key: key);
@override
_BusinessPageState createState() => _BusinessPageState();
}
class _BusinessPageState extends State<BusinessPage>
with TickerProviderStateMixin {
List<String> tabs = ['待处理', '处理中', '已处理', '全部'];
TabController _tabController;
@override
void initState() {
super.initState();
_tabController = TabController(
length: 4,
vsync: this,
initialIndex: widget.initIndex,
);
}
@override
void dispose() {
_tabController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '全部事项',
appBarBottom: PreferredSize(
child: TabBar(
labelColor: AppStyle.primaryTextColor,
unselectedLabelColor: AppStyle.minorTextColor,
labelStyle: TextStyle(
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
unselectedLabelStyle: TextStyle(
fontWeight: FontWeight.normal,
),
indicatorColor: AppStyle.primaryColor,
indicatorSize: TabBarIndicatorSize.label,
controller: _tabController,
tabs: tabs.map((e) => Tab(text: e)).toList(),
),
preferredSize: Size.fromHeight(88.w),
),
);
}
}

@ -4,6 +4,7 @@ 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/announcement/All_anouncement.dart';
import 'package:aku_community_manager/ui/home/business/business_page.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';
@ -57,10 +58,17 @@ class _HomePageState extends State<HomePage> {
}
//
Widget _card(String number, String text, Color color) {
Widget _card(
String number,
String text,
Color color,
int index,
) {
return AkuButton(
radius: 8.w,
onPressed: () {},
onPressed: () {
Get.to(BusinessPage(initIndex: index));
},
color: Color(0xFFFFFFFF),
child: Container(
width: 342.5.w,
@ -151,8 +159,12 @@ class _HomePageState extends State<HomePage> {
},
child: CircleAvatar(
radius: 36.w,
backgroundColor: Colors.grey,
child: userProvider.isSigned ? null : null,
backgroundColor: Colors.white,
child: userProvider.isSigned
? userProvider.userInfoModel.avatar == null
? Icon(Icons.person_outline)
: null
: Icon(Icons.person),
),
);
},
@ -345,43 +357,42 @@ class _HomePageState extends State<HomePage> {
height: 172.w,
//TODO listview
),
SizedBox(height: 32.w),
SizedBox(height: 16.w),
//
Container(
width: double.infinity,
height: 45.w,
child: Row(
children: [
Text(
'待办事项',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
Row(
children: [
Text(
'待办事项',
style: TextStyle(
color: Color(0xFF4A4B51),
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
Spacer(),
AkuButton(
onPressed: () {},
child: Row(
children: [
Text(
'全部事项',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
),
],
),
),
Spacer(),
AkuButton(
padding: EdgeInsets.symmetric(vertical: 16.w),
onPressed: () {
Get.to(BusinessPage(initIndex: 3));
},
child: Row(
children: [
Text(
'全部事项',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold),
),
Icon(
Icons.arrow_forward_ios,
size: 22.w,
color: AppStyle.minorTextColor,
),
],
),
],
),
),
],
),
SizedBox(height: 16.w),
//
@ -402,9 +413,9 @@ class _HomePageState extends State<HomePage> {
children: [
Row(
children: [
_card('25', '未处理事项', Color(0xFFFF4E0D)),
_card('25', '未处理事项', Color(0xFFFF4E0D), 0),
AkuDiveder().verticalDivider(166.5.w),
_card('22', '处理中事项', Color(0xFFFFC40C)),
_card('22', '处理中事项', Color(0xFFFFC40C), 1),
],
),
Row(children: [
@ -413,11 +424,11 @@ class _HomePageState extends State<HomePage> {
]),
Row(
children: [
_card('25', '已处理事项', Color(0xFF3F8FFE)),
_card('25', '已处理事项', Color(0xFF3F8FFE), 2),
AkuDiveder(isReverse: true).verticalDivider(
166.5.w,
),
_card('72', '全部事项', Color(0xFF333333)),
_card('72', '全部事项', Color(0xFF333333), 3),
],
),
],

@ -5,7 +5,8 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
///Scaffold
class AkuScaffold extends StatefulWidget {
///AppBar 使 `title`,`titleStyle`,`leading`,`brightness`
///AppBar 使 `title`,`titleStyle`,`leading`,
///`brightness`,`appBarColor`,``
final PreferredSizeWidget appBar;
///title
@ -43,6 +44,8 @@ class AkuScaffold extends StatefulWidget {
final Color backgroundColor;
final Color appBarColor;
final PreferredSizeWidget appBarBottom;
AkuScaffold({
Key key,
this.appBar,
@ -54,6 +57,7 @@ class AkuScaffold extends StatefulWidget {
this.backgroundColor = const Color(0XFFF9F9F9),
this.bottom,
this.appBarColor = Colors.white,
this.appBarBottom,
}) : super(key: key);
@override
@ -81,6 +85,7 @@ class _AkuScaffoldState extends State<AkuScaffold> {
),
child: Text(widget.title ?? ''),
),
bottom: widget.appBarBottom,
),
body: widget.body,
bottomNavigationBar: widget.bottom,

@ -134,6 +134,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.6"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
name: flutter_plugin_android_lifecycle
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.11"
flutter_screenutil:
dependency: "direct main"
description:
@ -153,6 +160,34 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.15.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.2"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.4"
image_picker:
dependency: "direct main"
description:
name: image_picker
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.6.7+12"
image_picker_platform_interface:
dependency: transitive
description:
name: image_picker_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
matcher:
dependency: transitive
description:
@ -181,6 +216,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0-nullsafety.1"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.9.2"
pin_input_text_field:
dependency: "direct main"
description:
@ -188,6 +230,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "3.1.1"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.3"
provider:
dependency: "direct main"
description:

@ -48,6 +48,8 @@ dependencies:
#验证码
pin_input_text_field: ^3.1.1
image_picker: ^0.6.7+12
aku_ui:
git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git

Loading…
Cancel
Save