|
|
@ -15,6 +15,7 @@ import 'package:dio/dio.dart';
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
|
|
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:shimmer/shimmer.dart';
|
|
|
|
import 'package:shimmer/shimmer.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -61,6 +62,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
List _todoModelList;
|
|
|
|
List _todoModelList;
|
|
|
|
List _anounceMentList;
|
|
|
|
List _anounceMentList;
|
|
|
|
bool _onload = true;
|
|
|
|
bool _onload = true;
|
|
|
|
|
|
|
|
EasyRefreshController _refreshController;
|
|
|
|
|
|
|
|
|
|
|
|
///自定义bar的菜单按钮
|
|
|
|
///自定义bar的菜单按钮
|
|
|
|
Widget _menuButton(String assetPath, String text, Widget page) {
|
|
|
|
Widget _menuButton(String assetPath, String text, Widget page) {
|
|
|
@ -152,17 +154,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
|
|
|
statusBarColor: Colors.transparent,
|
|
|
|
statusBarColor: Colors.transparent,
|
|
|
|
));
|
|
|
|
));
|
|
|
|
Future.delayed(Duration(milliseconds: 300), () async {
|
|
|
|
_refreshController = EasyRefreshController();
|
|
|
|
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(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int _currentIndicator = 0;
|
|
|
|
int _currentIndicator = 0;
|
|
|
@ -407,7 +399,24 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
//需要重构
|
|
|
|
//需要重构
|
|
|
|
body: (!UserTool.userProvider.isLogin)
|
|
|
|
body: EasyRefresh(
|
|
|
|
|
|
|
|
firstRefresh: true,
|
|
|
|
|
|
|
|
header: MaterialHeader(),
|
|
|
|
|
|
|
|
controller: _refreshController,
|
|
|
|
|
|
|
|
onRefresh: () 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(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: (!UserTool.userProvider.isLogin)
|
|
|
|
? SizedBox()
|
|
|
|
? SizedBox()
|
|
|
|
: _onload
|
|
|
|
: _onload
|
|
|
|
? loadingWidget
|
|
|
|
? loadingWidget
|
|
|
@ -465,7 +474,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
child: Stack(children: [
|
|
|
|
child: Stack(children: [
|
|
|
|
CarouselSlider(
|
|
|
|
CarouselSlider(
|
|
|
|
items: _anounceMentList
|
|
|
|
items: _anounceMentList
|
|
|
|
.map((e) => AllAnouncementState.anounceCard(e))
|
|
|
|
.map(
|
|
|
|
|
|
|
|
(e) => AllAnouncementState.anounceCard(e))
|
|
|
|
.toList(),
|
|
|
|
.toList(),
|
|
|
|
options: CarouselOptions(
|
|
|
|
options: CarouselOptions(
|
|
|
|
viewportFraction: 1.0,
|
|
|
|
viewportFraction: 1.0,
|
|
|
@ -521,7 +531,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
AkuButton(
|
|
|
|
AkuButton(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.symmetric(vertical: 16.w),
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
Get.to(BusinessPage(initIndex: 3));
|
|
|
|
Get.to(BusinessPage(initIndex: 3));
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -607,7 +618,8 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(children: [
|
|
|
|
Row(children: [
|
|
|
|
GridientDiveder().horizontalDivider(343.w),
|
|
|
|
GridientDiveder()
|
|
|
|
|
|
|
|
.horizontalDivider(343.w),
|
|
|
|
GridientDiveder(isReverse: true)
|
|
|
|
GridientDiveder(isReverse: true)
|
|
|
|
.horizontalDivider(343.w)
|
|
|
|
.horizontalDivider(343.w)
|
|
|
|
]),
|
|
|
|
]),
|
|
|
@ -629,6 +641,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
value: SystemUiOverlayStyle.dark,
|
|
|
|
value: SystemUiOverlayStyle.dark,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|