|
|
|
@ -5,10 +5,12 @@ import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness
|
|
|
|
|
import 'package:aku_community_manager/models/manager/item_num_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/models/todo_bussiness/todo_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/models/todo_bussiness/todo_outdoor_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/tools/user_tool.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/home/business/bussiness_func.dart';
|
|
|
|
|
import 'package:aku_community_manager/ui/home/business/todo_outdoor_card.dart';
|
|
|
|
|
import 'package:aku_community_manager/utils/network/base_list_model.dart';
|
|
|
|
|
import 'package:aku_community_manager/utils/network/net_util.dart';
|
|
|
|
|
import 'package:badges/badges.dart';
|
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
@ -151,12 +153,15 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
statusBarColor: Colors.transparent,
|
|
|
|
|
));
|
|
|
|
|
Future.delayed(Duration(milliseconds: 300), () async {
|
|
|
|
|
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
|
if (userProvider.isLogin) {
|
|
|
|
|
_itemNumModel = await _getItemNum();
|
|
|
|
|
var dataList = await BussinessFunc.getBussinessModelList(1);
|
|
|
|
|
_todoModelList = dataList.map((e) => ToDoModel.fromJson(e)).toList();
|
|
|
|
|
_anounceMentList = await _getAnouncement();
|
|
|
|
|
_onload = false;
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -182,6 +187,10 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final userProvider = Provider.of<UserProvider>(context);
|
|
|
|
|
final appProvider = Provider.of<AppProvider>(context);
|
|
|
|
|
var loadingWidget = Center(
|
|
|
|
|
child: CircularProgressIndicator(),
|
|
|
|
|
);
|
|
|
|
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
drawer: PersonalDraw(),
|
|
|
|
@ -261,7 +270,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 19.w),
|
|
|
|
|
Text(
|
|
|
|
|
'搜索工单订单号、手机',
|
|
|
|
|
'搜索应用',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppStyle.minorTextColor,
|
|
|
|
|
fontSize: 28.sp,
|
|
|
|
@ -300,7 +309,14 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
// ]),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
Container(
|
|
|
|
|
Badge(
|
|
|
|
|
elevation: 0,
|
|
|
|
|
position: BadgePosition.topEnd(
|
|
|
|
|
top: 4,
|
|
|
|
|
end: 4,
|
|
|
|
|
),
|
|
|
|
|
showBadge: appProvider.hasMessage,
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 5.w, bottom: 5.w),
|
|
|
|
|
child: AkuMaterialButton(
|
|
|
|
|
minWidth: 78.w,
|
|
|
|
@ -328,6 +344,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 17.w),
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
@ -389,13 +406,11 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
body: _onload
|
|
|
|
|
? Center(
|
|
|
|
|
child: Shimmer.fromColors(
|
|
|
|
|
child: 'LOADING······'.text.black.size(50.sp).make(),
|
|
|
|
|
baseColor: Colors.white,
|
|
|
|
|
highlightColor: kPrimaryColor),
|
|
|
|
|
)
|
|
|
|
|
//需要重构
|
|
|
|
|
body: (!UserTool.userProvider.isLogin)
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: _onload
|
|
|
|
|
? loadingWidget
|
|
|
|
|
: ListView(
|
|
|
|
|
padding: EdgeInsets.all(32.w),
|
|
|
|
|
children: [
|
|
|
|
@ -476,7 +491,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
return Container(
|
|
|
|
|
width: 12.w,
|
|
|
|
|
height: 12.w,
|
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.symmetric(horizontal: 12.w),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
color: _currentIndicator == index
|
|
|
|
@ -556,8 +572,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
.runtimeType ==
|
|
|
|
|
ToDoOutDoorModel) {
|
|
|
|
|
return ToDoOutDoorCard(
|
|
|
|
|
model:
|
|
|
|
|
_todoModelList[index].dynamicModel,
|
|
|
|
|
model: _todoModelList[index]
|
|
|
|
|
.dynamicModel,
|
|
|
|
|
);
|
|
|
|
|
} else
|
|
|
|
|
return SizedBox();
|
|
|
|
@ -584,7 +600,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
|
children: [
|
|
|
|
|
_card(_itemNumModel.unProcessedNum ?? 0,
|
|
|
|
|
'未处理事项', Color(0xFFFF4E0D), 0),
|
|
|
|
|
GridientDiveder().verticalDivider(166.5.w),
|
|
|
|
|
GridientDiveder()
|
|
|
|
|
.verticalDivider(166.5.w),
|
|
|
|
|
_card(_itemNumModel.processingNum ?? 0,
|
|
|
|
|
'处理中事项', Color(0xFFFFC40C), 1),
|
|
|
|
|
],
|
|
|
|
|