|
|
@ -1,13 +1,11 @@
|
|
|
|
// Dart imports:
|
|
|
|
// Dart imports:
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:aku_new_community/const/resource.dart';
|
|
|
|
|
|
|
|
import 'package:aku_new_community/constants/api.dart';
|
|
|
|
import 'package:aku_new_community/constants/api.dart';
|
|
|
|
import 'package:aku_new_community/constants/application_objects.dart';
|
|
|
|
import 'package:aku_new_community/constants/application_objects.dart';
|
|
|
|
import 'package:aku_new_community/model/common/img_model.dart';
|
|
|
|
import 'package:aku_new_community/model/common/img_model.dart';
|
|
|
|
import 'package:aku_new_community/model/community/activity_item_model.dart';
|
|
|
|
import 'package:aku_new_community/model/community/activity_item_model.dart';
|
|
|
|
import 'package:aku_new_community/model/community/board_model.dart';
|
|
|
|
import 'package:aku_new_community/model/community/board_model.dart';
|
|
|
|
import 'package:aku_new_community/model/community/swiper_model.dart';
|
|
|
|
import 'package:aku_new_community/model/community/swiper_model.dart';
|
|
|
|
import 'package:aku_new_community/pages/home/widget/animate_app_bar.dart';
|
|
|
|
|
|
|
|
import 'package:aku_new_community/pages/message_center_page/message_center_page.dart';
|
|
|
|
import 'package:aku_new_community/pages/message_center_page/message_center_page.dart';
|
|
|
|
import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart';
|
|
|
|
import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart';
|
|
|
|
import 'package:aku_new_community/pages/visitor_access_page/visitor_access_page.dart';
|
|
|
|
import 'package:aku_new_community/pages/visitor_access_page/visitor_access_page.dart';
|
|
|
@ -27,18 +25,16 @@ import 'package:aku_new_community/widget/others/rectIndicator.dart';
|
|
|
|
import 'package:aku_new_community/widget/others/user_tool.dart';
|
|
|
|
import 'package:aku_new_community/widget/others/user_tool.dart';
|
|
|
|
import 'package:badges/badges.dart';
|
|
|
|
import 'package:badges/badges.dart';
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:bot_toast/bot_toast.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
|
|
|
|
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:jpush_flutter/jpush_flutter.dart';
|
|
|
|
import 'package:jpush_flutter/jpush_flutter.dart';
|
|
|
|
|
|
|
|
import 'package:palette_generator/palette_generator.dart';
|
|
|
|
import 'package:power_logger/power_logger.dart';
|
|
|
|
import 'package:power_logger/power_logger.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'widget/home_search.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
HomePage({Key? key}) : super(key: key);
|
|
|
|
HomePage({Key? key}) : super(key: key);
|
|
|
@ -66,6 +62,9 @@ class _HomePageState extends State<HomePage>
|
|
|
|
List<ActivityItemModel> _activityItemModels = [];
|
|
|
|
List<ActivityItemModel> _activityItemModels = [];
|
|
|
|
List<BoardItemModel> _boardItemModels = [];
|
|
|
|
List<BoardItemModel> _boardItemModels = [];
|
|
|
|
List<SwiperModel> _swiperModels = [];
|
|
|
|
List<SwiperModel> _swiperModels = [];
|
|
|
|
|
|
|
|
SwiperController _swiperController = SwiperController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ValueNotifier<Color> _barColor = ValueNotifier(Colors.transparent);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
@ -81,12 +80,15 @@ class _HomePageState extends State<HomePage>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_scrollController = ScrollController();
|
|
|
|
_scrollController = ScrollController();
|
|
|
|
_refreshController = EasyRefreshController();
|
|
|
|
_refreshController = EasyRefreshController();
|
|
|
|
|
|
|
|
SystemChrome.setSystemUIOverlayStyle(
|
|
|
|
|
|
|
|
SystemUiOverlayStyle(statusBarColor: Colors.transparent));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
void dispose() {
|
|
|
|
_refreshController.dispose();
|
|
|
|
_refreshController.dispose();
|
|
|
|
_scrollController?.dispose();
|
|
|
|
_scrollController?.dispose();
|
|
|
|
|
|
|
|
_swiperController.dispose();
|
|
|
|
super.dispose();
|
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -97,11 +99,51 @@ class _HomePageState extends State<HomePage>
|
|
|
|
commentCount = appProvider.messageCenterModel.commentCount ?? 0;
|
|
|
|
commentCount = appProvider.messageCenterModel.commentCount ?? 0;
|
|
|
|
sysCount = appProvider.messageCenterModel.sysCount ?? 0;
|
|
|
|
sysCount = appProvider.messageCenterModel.sysCount ?? 0;
|
|
|
|
sum = commentCount + sysCount;
|
|
|
|
sum = commentCount + sysCount;
|
|
|
|
return Scaffold(
|
|
|
|
var head = ValueListenableBuilder(
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
valueListenable: _barColor,
|
|
|
|
appBar: AnimateAppBar(
|
|
|
|
builder: (context, Color color, child) {
|
|
|
|
scrollController: _scrollController,
|
|
|
|
return Container(
|
|
|
|
actions: [
|
|
|
|
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
border: Border.all(width: 0, color: color),
|
|
|
|
|
|
|
|
color: color,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
|
|
|
child: child,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 16.w),
|
|
|
|
|
|
|
|
child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [
|
|
|
|
|
|
|
|
if (appProvider.location != null)
|
|
|
|
|
|
|
|
Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(right: 5),
|
|
|
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG,
|
|
|
|
|
|
|
|
width: 32.w,
|
|
|
|
|
|
|
|
height: 32.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
appProvider.location?['city'] == null
|
|
|
|
|
|
|
|
? ''
|
|
|
|
|
|
|
|
: appProvider.location?['city'] as String? ?? '',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
fontSize: 24.sp,
|
|
|
|
|
|
|
|
color: Color(0xff333333),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'(${appProvider.weatherType} ${appProvider.weatherTemp}℃)',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 24.sp,
|
|
|
|
|
|
|
|
color: Color(0xff999999),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
GestureDetector(
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Get.to(() => BeeSearch());
|
|
|
|
Get.to(() => BeeSearch());
|
|
|
@ -134,311 +176,303 @@ class _HomePageState extends State<HomePage>
|
|
|
|
height: 40.w, width: 40.w),
|
|
|
|
height: 40.w, width: 40.w),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// floatingActionButton: FloatingActionButton(
|
|
|
|
);
|
|
|
|
//
|
|
|
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
|
|
|
// child: Container(
|
|
|
|
value: SystemUiOverlayStyle.dark,
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
child: Scaffold(
|
|
|
|
// image: DecorationImage(
|
|
|
|
extendBody: true,
|
|
|
|
// fit: BoxFit.fill,
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
// image:
|
|
|
|
body: Stack(
|
|
|
|
// AssetImage(R.ASSETS_ICONS_ICON_MAIN_OPEN_PNG),)
|
|
|
|
children: [
|
|
|
|
// ),
|
|
|
|
Column(
|
|
|
|
// ),
|
|
|
|
children: [
|
|
|
|
// onPressed: (){
|
|
|
|
head,
|
|
|
|
// print('FloatingActionButton');
|
|
|
|
Flexible(
|
|
|
|
// },
|
|
|
|
child: EasyRefresh(
|
|
|
|
// ),
|
|
|
|
controller: _refreshController,
|
|
|
|
body: Stack(
|
|
|
|
header: BeeBallPauseHeader(bgColor: _barColor),
|
|
|
|
children: [
|
|
|
|
firstRefresh: true,
|
|
|
|
EasyRefresh(
|
|
|
|
onRefresh: () async {
|
|
|
|
controller: _refreshController,
|
|
|
|
//_activityItemModel = await CommunityFunc.activity();
|
|
|
|
header: MaterialHeader(),
|
|
|
|
_activityItemModels = await CommunityFunc.activityList();
|
|
|
|
firstRefresh: true,
|
|
|
|
_boardItemModels = await CommunityFunc.board();
|
|
|
|
onRefresh: () async {
|
|
|
|
_swiperModels = await CommunityFunc.swiper();
|
|
|
|
//_activityItemModel = await CommunityFunc.activity();
|
|
|
|
appProvider.getMessageCenter();
|
|
|
|
_activityItemModels = await CommunityFunc.activityList();
|
|
|
|
setState(() {});
|
|
|
|
_boardItemModels = await CommunityFunc.board();
|
|
|
|
},
|
|
|
|
_swiperModels = await CommunityFunc.swiper();
|
|
|
|
child: CustomScrollView(
|
|
|
|
appProvider.getMessageCenter();
|
|
|
|
controller: _scrollController,
|
|
|
|
setState(() {});
|
|
|
|
slivers: [
|
|
|
|
},
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
child: CustomScrollView(
|
|
|
|
|
|
|
|
controller: _scrollController,
|
|
|
|
|
|
|
|
slivers: [
|
|
|
|
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
HomeSearch(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HomeSwiper(), //要做点击事件
|
|
|
|
|
|
|
|
// SizedBox(height: 100.w),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(top: 24.w, bottom: 32.w),
|
|
|
|
|
|
|
|
child: getFunction(), //ApplicationView(),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
boxShadow: const <BoxShadow>[
|
|
|
|
|
|
|
|
BoxShadow(
|
|
|
|
|
|
|
|
color: Color(0x14000000),
|
|
|
|
|
|
|
|
blurRadius: 0,
|
|
|
|
|
|
|
|
offset: Offset(0.0, 2.0),
|
|
|
|
|
|
|
|
spreadRadius: 0.1)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
|
|
|
bottomLeft: Radius.circular(28),
|
|
|
|
|
|
|
|
bottomRight: Radius.circular(28))),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
//ApplicationBox(child: ApplicationView()),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 40,
|
|
|
|
|
|
|
|
margin:
|
|
|
|
|
|
|
|
EdgeInsets.only(left: 32.w, right: 32.w, top: 24.w),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
|
|
|
|
|
|
|
boxShadow: const <BoxShadow>[
|
|
|
|
|
|
|
|
BoxShadow(
|
|
|
|
|
|
|
|
color: Color(0x14000000),
|
|
|
|
|
|
|
|
blurRadius: 4,
|
|
|
|
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: HomeNotification(items: _boardItemModels)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
GestureDetector(
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: 24.w),
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 32.w, top: 24.w),
|
|
|
|
|
|
|
|
width: 140,
|
|
|
|
|
|
|
|
height: 150,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
|
|
|
image: AssetImage(R.ASSETS_IMAGES_CARD_YELLOW_PNG),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
HomeSwiper(), //要做点击事件
|
|
|
|
'访客邀请',
|
|
|
|
// SizedBox(height: 100.w),
|
|
|
|
style: TextStyle(
|
|
|
|
Container(
|
|
|
|
color: Color(0xD9000000),
|
|
|
|
padding:
|
|
|
|
fontSize: 26.sp,
|
|
|
|
EdgeInsets.only(top: 24.w, bottom: 32.w),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
child: getFunction(), //ApplicationView(),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
10.hb,
|
|
|
|
color: Colors.white,
|
|
|
|
Text(
|
|
|
|
boxShadow: const <BoxShadow>[
|
|
|
|
'一键分享',
|
|
|
|
BoxShadow(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color(0x14000000),
|
|
|
|
color: Color(0x73000000),
|
|
|
|
blurRadius: 0,
|
|
|
|
fontSize: 20.sp,
|
|
|
|
offset: Offset(0.0, 2.0),
|
|
|
|
),
|
|
|
|
spreadRadius: 0.1)
|
|
|
|
),
|
|
|
|
],
|
|
|
|
Text(
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
'让拜访不再是难事',
|
|
|
|
bottomLeft: Radius.circular(28),
|
|
|
|
style: TextStyle(
|
|
|
|
bottomRight: Radius.circular(28))),
|
|
|
|
color: Color(0x73000000),
|
|
|
|
)
|
|
|
|
fontSize: 20.sp,
|
|
|
|
//ApplicationBox(child: ApplicationView()),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_INVITE_PNG,
|
|
|
|
|
|
|
|
width: 100.w,
|
|
|
|
|
|
|
|
height: 100.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
30.hb,
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
Get.to(VisitorAccessPage());
|
|
|
|
child: Container(
|
|
|
|
},
|
|
|
|
height: 40,
|
|
|
|
),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
25.wb,
|
|
|
|
left: 32.w, right: 32.w, top: 24.w),
|
|
|
|
Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
margin: EdgeInsets.only(top: 24.w),
|
|
|
|
color: Colors.white,
|
|
|
|
child: Column(
|
|
|
|
borderRadius:
|
|
|
|
children: [
|
|
|
|
BorderRadius.all(Radius.circular(8)),
|
|
|
|
GestureDetector(
|
|
|
|
boxShadow: const <BoxShadow>[
|
|
|
|
child: Container(
|
|
|
|
BoxShadow(
|
|
|
|
width: 190,
|
|
|
|
color: Color(0x14000000),
|
|
|
|
height: 69,
|
|
|
|
blurRadius: 4,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
spreadRadius: 0.5)
|
|
|
|
image: DecorationImage(
|
|
|
|
],
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
),
|
|
|
|
image:
|
|
|
|
child: HomeNotification(items: _boardItemModels)),
|
|
|
|
AssetImage(R.ASSETS_IMAGES_CARD_PINK_PNG),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
20.wb,
|
|
|
|
GestureDetector(
|
|
|
|
Column(
|
|
|
|
child: Container(
|
|
|
|
crossAxisAlignment:
|
|
|
|
margin: EdgeInsets.only(top: 24.w),
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
padding:
|
|
|
|
children: [
|
|
|
|
EdgeInsets.only(left: 32.w, top: 24.w),
|
|
|
|
20.hb,
|
|
|
|
width: 140,
|
|
|
|
Text(
|
|
|
|
height: 150,
|
|
|
|
'一键报警',
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
style: TextStyle(
|
|
|
|
image: DecorationImage(
|
|
|
|
color: Color(0xD9000000),
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
fontSize: 26.sp,
|
|
|
|
image: AssetImage(
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
R.ASSETS_IMAGES_CARD_YELLOW_PNG),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'访客邀请',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Color(0xD9000000),
|
|
|
|
|
|
|
|
fontSize: 26.sp,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
10.hb,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'一键分享',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Color(0x73000000),
|
|
|
|
|
|
|
|
fontSize: 20.sp,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
10.hb,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
'提交报警位置给物业',
|
|
|
|
'让拜访不再是难事',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color(0x73000000),
|
|
|
|
color: Color(0x73000000),
|
|
|
|
fontSize: 20.sp,
|
|
|
|
fontSize: 20.sp,
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_INVITE_PNG,
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_POLICE_PNG,
|
|
|
|
width: 100.w,
|
|
|
|
width: 98.w,
|
|
|
|
height: 100.w,
|
|
|
|
height: 98.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
30.hb,
|
|
|
|
20.wb,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Get.to(VisitorAccessPage());
|
|
|
|
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
25.wb,
|
|
|
|
Get.to(AlarmPage());
|
|
|
|
Container(
|
|
|
|
},
|
|
|
|
margin: EdgeInsets.only(top: 24.w),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
GestureDetector(
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: 20.w),
|
|
|
|
|
|
|
|
width: 190,
|
|
|
|
|
|
|
|
height: 69,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
|
|
|
image:
|
|
|
|
|
|
|
|
AssetImage(R.ASSETS_IMAGES_CARD_BLUE_PNG),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
20.wb,
|
|
|
|
GestureDetector(
|
|
|
|
Column(
|
|
|
|
child: Container(
|
|
|
|
crossAxisAlignment:
|
|
|
|
width: 190,
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
height: 69,
|
|
|
|
children: [
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
20.hb,
|
|
|
|
image: DecorationImage(
|
|
|
|
Text(
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
'建议咨询',
|
|
|
|
image: AssetImage(
|
|
|
|
style: TextStyle(
|
|
|
|
R.ASSETS_IMAGES_CARD_PINK_PNG),
|
|
|
|
color: Color(0xD9000000),
|
|
|
|
)),
|
|
|
|
fontSize: 26.sp,
|
|
|
|
child: Row(
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
20.wb,
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
20.hb,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'一键报警',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Color(0xD9000000),
|
|
|
|
|
|
|
|
fontSize: 26.sp,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
10.hb,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'提交报警位置给物业',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Color(0x73000000),
|
|
|
|
|
|
|
|
fontSize: 20.sp,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_POLICE_PNG,
|
|
|
|
|
|
|
|
width: 98.w,
|
|
|
|
|
|
|
|
height: 98.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
20.wb,
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
10.hb,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
onTap: () {
|
|
|
|
'欢迎给我们提供服务意见',
|
|
|
|
Get.to(AlarmPage());
|
|
|
|
style: TextStyle(
|
|
|
|
},
|
|
|
|
color: Color(0x73000000),
|
|
|
|
|
|
|
|
fontSize: 20.sp,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_CONSULT_PNG,
|
|
|
|
|
|
|
|
width: 98.w,
|
|
|
|
|
|
|
|
height: 98.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
20.wb,
|
|
|
|
GestureDetector(
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: 20.w),
|
|
|
|
|
|
|
|
width: 190,
|
|
|
|
|
|
|
|
height: 69,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
|
|
|
image: AssetImage(
|
|
|
|
|
|
|
|
R.ASSETS_IMAGES_CARD_BLUE_PNG),
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
20.wb,
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
20.hb,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'建议咨询',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Color(0xD9000000),
|
|
|
|
|
|
|
|
fontSize: 26.sp,
|
|
|
|
|
|
|
|
fontWeight:
|
|
|
|
|
|
|
|
FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
10.hb,
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
'欢迎给我们提供服务意见',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: Color(0x73000000),
|
|
|
|
|
|
|
|
fontSize: 20.sp,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Spacer(),
|
|
|
|
|
|
|
|
Image.asset(
|
|
|
|
|
|
|
|
R.ASSETS_ICONS_ICON_MAIN_CONSULT_PNG,
|
|
|
|
|
|
|
|
width: 98.w,
|
|
|
|
|
|
|
|
height: 98.w,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
20.wb,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Get.to(AdvicePage(
|
|
|
|
|
|
|
|
type: AdviceType.SUGGESTION));
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
onTap: () {
|
|
|
|
],
|
|
|
|
Get.to(AdvicePage(type: AdviceType.SUGGESTION));
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
],
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
HomeTitle(
|
|
|
|
|
|
|
|
title: '社区活动',
|
|
|
|
|
|
|
|
suffixTitle: '查看全部',
|
|
|
|
|
|
|
|
onTap: () => Get.to(() => ActivityListPage()),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_activityItemModels == []
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: Container(
|
|
|
|
|
|
|
|
height: 400.w,
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 32.w),
|
|
|
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
|
|
|
return SizedBox(
|
|
|
|
|
|
|
|
width: 16.w,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
width: 500.w,
|
|
|
|
|
|
|
|
child: Builder(
|
|
|
|
|
|
|
|
builder: (context) {
|
|
|
|
|
|
|
|
return ActivityCard(
|
|
|
|
|
|
|
|
model: _activityItemModels[
|
|
|
|
|
|
|
|
index]);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
itemCount: _activityItemModels.length,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// : ActivityCard(model: _activityItemModel)
|
|
|
|
|
|
|
|
// .pSymmetric(h: 24.w, v: 24.w),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SliverToBoxAdapter(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
// HomeTitle(
|
|
|
|
|
|
|
|
// title: '公共资讯',
|
|
|
|
|
|
|
|
// suffixTitle: '更多资讯',
|
|
|
|
|
|
|
|
// onTap: () async {
|
|
|
|
|
|
|
|
// final cancel = BotToast.showLoading();
|
|
|
|
|
|
|
|
// BaseModel model = await NetUtil().get(API.news.category);
|
|
|
|
|
|
|
|
// List<NewsCategoryModel>? category;
|
|
|
|
|
|
|
|
// if (model.status == true && model.data != null) {
|
|
|
|
|
|
|
|
// category = (model.data as List)
|
|
|
|
|
|
|
|
// .map((e) => NewsCategoryModel.fromJson(e))
|
|
|
|
|
|
|
|
// .toList();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// cancel();
|
|
|
|
|
|
|
|
// Get.to(
|
|
|
|
|
|
|
|
// () => PublicInfomationPage(models: category ?? []));
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
HomeTitle(
|
|
|
|
|
|
|
|
title: '社区活动',
|
|
|
|
|
|
|
|
suffixTitle: '查看全部',
|
|
|
|
|
|
|
|
onTap: () => Get.to(() => ActivityListPage()),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_activityItemModels == []
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: Container(
|
|
|
|
|
|
|
|
height: 400.w,
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 32.w),
|
|
|
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
|
|
|
return SizedBox(
|
|
|
|
|
|
|
|
width: 16.w,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
width: 500.w,
|
|
|
|
|
|
|
|
child: Builder(
|
|
|
|
|
|
|
|
builder: (context) {
|
|
|
|
|
|
|
|
return ActivityCard(
|
|
|
|
|
|
|
|
model: _activityItemModels[index]);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
itemCount: _activityItemModels.length,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
// : ActivityCard(model: _activityItemModel)
|
|
|
|
|
|
|
|
// .pSymmetric(h: 24.w, v: 24.w),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
OverlayLivingBtnWidget()
|
|
|
|
OverlayLivingBtnWidget()
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -447,10 +481,25 @@ class _HomePageState extends State<HomePage>
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
height: 320.w,
|
|
|
|
height: 320.w,
|
|
|
|
|
|
|
|
decoration:
|
|
|
|
|
|
|
|
BoxDecoration(border: Border.all(width: 0, color: _barColor.value)),
|
|
|
|
child: AspectRatio(
|
|
|
|
child: AspectRatio(
|
|
|
|
aspectRatio: 375 / 160,
|
|
|
|
aspectRatio: 375 / 160,
|
|
|
|
child: Swiper(
|
|
|
|
child: Swiper(
|
|
|
|
key: UniqueKey(),
|
|
|
|
key: UniqueKey(),
|
|
|
|
|
|
|
|
onIndexChanged: (index) async {
|
|
|
|
|
|
|
|
if (_swiperModels.isNotEmpty) {
|
|
|
|
|
|
|
|
var color = await PaletteGenerator.fromImageProvider(
|
|
|
|
|
|
|
|
CachedNetworkImageProvider(
|
|
|
|
|
|
|
|
API.image(
|
|
|
|
|
|
|
|
ImgModel.first(_swiperModels[index].voResourcesImgList)),
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
_barColor.value =
|
|
|
|
|
|
|
|
color.dominantColor?.color ?? Colors.transparent;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
_barColor.value = Colors.transparent;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
return getSwiperImage(_swiperModels[index]);
|
|
|
|
return getSwiperImage(_swiperModels[index]);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -562,3 +611,62 @@ class _HomePageState extends State<HomePage>
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
bool get wantKeepAlive => true;
|
|
|
|
bool get wantKeepAlive => true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BeeBallPauseHeader extends Header {
|
|
|
|
|
|
|
|
/// Key
|
|
|
|
|
|
|
|
final Key? key;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final ValueNotifier<Color> bgColor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final LinkHeaderNotifier linkNotifier = LinkHeaderNotifier();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BeeBallPauseHeader({
|
|
|
|
|
|
|
|
this.key,
|
|
|
|
|
|
|
|
required this.bgColor,
|
|
|
|
|
|
|
|
bool enableHapticFeedback = true,
|
|
|
|
|
|
|
|
bool enableInfiniteRefresh = false,
|
|
|
|
|
|
|
|
}) : super(
|
|
|
|
|
|
|
|
extent: 70.0,
|
|
|
|
|
|
|
|
triggerDistance: 70.0,
|
|
|
|
|
|
|
|
float: false,
|
|
|
|
|
|
|
|
enableHapticFeedback: enableHapticFeedback,
|
|
|
|
|
|
|
|
enableInfiniteRefresh: enableInfiniteRefresh,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
|
|
Widget contentBuilder(
|
|
|
|
|
|
|
|
BuildContext context,
|
|
|
|
|
|
|
|
RefreshMode refreshState,
|
|
|
|
|
|
|
|
double pulledExtent,
|
|
|
|
|
|
|
|
double refreshTriggerPullDistance,
|
|
|
|
|
|
|
|
double refreshIndicatorExtent,
|
|
|
|
|
|
|
|
AxisDirection axisDirection,
|
|
|
|
|
|
|
|
bool float,
|
|
|
|
|
|
|
|
Duration? completeDuration,
|
|
|
|
|
|
|
|
bool enableInfiniteRefresh,
|
|
|
|
|
|
|
|
bool success,
|
|
|
|
|
|
|
|
bool noMore) {
|
|
|
|
|
|
|
|
linkNotifier.contentBuilder(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
refreshState,
|
|
|
|
|
|
|
|
pulledExtent,
|
|
|
|
|
|
|
|
refreshTriggerPullDistance,
|
|
|
|
|
|
|
|
refreshIndicatorExtent,
|
|
|
|
|
|
|
|
axisDirection,
|
|
|
|
|
|
|
|
float,
|
|
|
|
|
|
|
|
completeDuration,
|
|
|
|
|
|
|
|
enableInfiniteRefresh,
|
|
|
|
|
|
|
|
success,
|
|
|
|
|
|
|
|
noMore);
|
|
|
|
|
|
|
|
return ValueListenableBuilder(
|
|
|
|
|
|
|
|
valueListenable: bgColor,
|
|
|
|
|
|
|
|
builder: (context, Color color, child) {
|
|
|
|
|
|
|
|
return BallPulseHeaderWidget(
|
|
|
|
|
|
|
|
key: key,
|
|
|
|
|
|
|
|
color: color.withBlue(128),
|
|
|
|
|
|
|
|
backgroundColor: color,
|
|
|
|
|
|
|
|
linkNotifier: linkNotifier,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|