|
|
@ -1,14 +1,14 @@
|
|
|
|
// Dart imports:
|
|
|
|
// Dart imports:
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
|
|
|
|
import 'package:akuCommunity/provider/app_provider.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Package imports:
|
|
|
|
// Package imports:
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
@ -19,7 +19,6 @@ import 'package:akuCommunity/model/community/activity_item_model.dart';
|
|
|
|
import 'package:akuCommunity/model/community/board_model.dart';
|
|
|
|
import 'package:akuCommunity/model/community/board_model.dart';
|
|
|
|
import 'package:akuCommunity/pages/home/widget/animate_app_bar.dart';
|
|
|
|
import 'package:akuCommunity/pages/home/widget/animate_app_bar.dart';
|
|
|
|
import 'package:akuCommunity/pages/message_center_page/message_center_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/message_center_page/message_center_page.dart';
|
|
|
|
import 'package:akuCommunity/service/base_model.dart';
|
|
|
|
|
|
|
|
import 'package:akuCommunity/ui/community/activity/activity_card.dart';
|
|
|
|
import 'package:akuCommunity/ui/community/activity/activity_card.dart';
|
|
|
|
import 'package:akuCommunity/ui/community/activity/activity_list_page.dart';
|
|
|
|
import 'package:akuCommunity/ui/community/activity/activity_list_page.dart';
|
|
|
|
import 'package:akuCommunity/ui/community/community_func.dart';
|
|
|
|
import 'package:akuCommunity/ui/community/community_func.dart';
|
|
|
@ -30,7 +29,6 @@ import 'package:akuCommunity/widget/buttons/column_action_button.dart';
|
|
|
|
import 'package:akuCommunity/widget/views/application_box.dart';
|
|
|
|
import 'package:akuCommunity/widget/views/application_box.dart';
|
|
|
|
import 'package:akuCommunity/widget/views/application_view.dart';
|
|
|
|
import 'package:akuCommunity/widget/views/application_view.dart';
|
|
|
|
import 'widget/home_search.dart';
|
|
|
|
import 'widget/home_search.dart';
|
|
|
|
import 'widget/home_swiper.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
|
HomePage({Key key}) : super(key: key);
|
|
|
|
HomePage({Key key}) : super(key: key);
|
|
|
@ -67,16 +65,31 @@ class _HomePageState extends State<HomePage>
|
|
|
|
super.build(context);
|
|
|
|
super.build(context);
|
|
|
|
ScreenUtil.init(context,
|
|
|
|
ScreenUtil.init(context,
|
|
|
|
designSize: Size(750, 1334), allowFontScaling: true);
|
|
|
|
designSize: Size(750, 1334), allowFontScaling: true);
|
|
|
|
|
|
|
|
AppProvider appProvider = Provider.of<AppProvider>(context);
|
|
|
|
return Scaffold(
|
|
|
|
return Scaffold(
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
extendBodyBehindAppBar: true,
|
|
|
|
appBar: AnimateAppBar(
|
|
|
|
appBar: AnimateAppBar(
|
|
|
|
scrollController: _scrollController,
|
|
|
|
scrollController: _scrollController,
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
ColumnActionButton(
|
|
|
|
Stack(children: [
|
|
|
|
onPressed: MessageCenterPage().to,
|
|
|
|
ColumnActionButton(
|
|
|
|
title: '消息',
|
|
|
|
onPressed: MessageCenterPage().to,
|
|
|
|
path: R.ASSETS_ICONS_ALARM_PNG,
|
|
|
|
title: '消息',
|
|
|
|
),
|
|
|
|
path: R.ASSETS_ICONS_ALARM_PNG,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Positioned(
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
right: 0,
|
|
|
|
|
|
|
|
child: appProvider.messageCenterModel.sysCount == 0
|
|
|
|
|
|
|
|
? SizedBox()
|
|
|
|
|
|
|
|
: Container(
|
|
|
|
|
|
|
|
width: 2.w,
|
|
|
|
|
|
|
|
height: 2.w,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.red,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(1.w)),
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
]),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: EasyRefresh(
|
|
|
|
body: EasyRefresh(
|
|
|
@ -86,6 +99,7 @@ class _HomePageState extends State<HomePage>
|
|
|
|
onRefresh: () async {
|
|
|
|
onRefresh: () async {
|
|
|
|
_activityItemModel = await CommunityFunc.activity();
|
|
|
|
_activityItemModel = await CommunityFunc.activity();
|
|
|
|
_boardItemModels = await CommunityFunc.board();
|
|
|
|
_boardItemModels = await CommunityFunc.board();
|
|
|
|
|
|
|
|
appProvider.getMessageCenter();
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: CustomScrollView(
|
|
|
|
child: CustomScrollView(
|
|
|
|