商城首页+周边企业(差接口) 地理信息 住房说明+警报修改

hmxc
章文轩 3 years ago
parent 1053c11c28
commit db6dda42a6

@ -20,7 +20,7 @@
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

@ -5,6 +5,7 @@ import 'package:aku_community/utils/headers.dart';
const ktextPrimary = Color(0xff333333);
const ktextSubColor = Color(0xff666666);
const ktextThirdColor = Color(0xff999999);
const kForeGroundColor = Color(0xFFFFFFFF);
const kPrimaryColor = Color(0xFFFFC40C);
const kDarkPrimaryColor = Color(0xFFFF8200);

@ -120,6 +120,9 @@ class R {
/// ![preview](file:///Users/datang/aku_community/assets/icons/app_add.png)
static const String ASSETS_ICONS_APP_ADD_PNG = 'assets/icons/app_add.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/app_alarm.png)
static const String ASSETS_ICONS_APP_ALARM_PNG = 'assets/icons/app_alarm.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/app_reduce.png)
static const String ASSETS_ICONS_APP_REDUCE_PNG =
'assets/icons/app_reduce.png';
@ -178,6 +181,10 @@ class R {
/// ![preview](file:///Users/datang/aku_community/assets/icons/contract.png)
static const String ASSETS_ICONS_CONTRACT_PNG = 'assets/icons/contract.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/device_alarm.png)
static const String ASSETS_ICONS_DEVICE_ALARM_PNG =
'assets/icons/device_alarm.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/examine.png)
static const String ASSETS_ICONS_EXAMINE_PNG = 'assets/icons/examine.png';
@ -190,6 +197,10 @@ class R {
/// ![preview](file:///Users/datang/aku_community/assets/icons/finish.png)
static const String ASSETS_ICONS_FINISH_PNG = 'assets/icons/finish.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/fire_alarm.png)
static const String ASSETS_ICONS_FIRE_ALARM_PNG =
'assets/icons/fire_alarm.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/goods_borrow.png)
static const String ASSETS_ICONS_GOODS_BORROW_PNG =
'assets/icons/goods_borrow.png';
@ -326,10 +337,28 @@ class R {
static const String ASSETS_ICONS_SHIELD_USER_PNG =
'assets/icons/shield_user.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/shop_car.png)
static const String ASSETS_ICONS_SHOP_CAR_PNG = 'assets/icons/shop_car.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/shop_laba.png)
static const String ASSETS_ICONS_SHOP_LABA_PNG = 'assets/icons/shop_laba.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/shop_location.png)
static const String ASSETS_ICONS_SHOP_LOCATION_PNG =
'assets/icons/shop_location.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/shop_notice.png)
static const String ASSETS_ICONS_SHOP_NOTICE_PNG =
'assets/icons/shop_notice.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/shop_order.png)
static const String ASSETS_ICONS_SHOP_ORDER_PNG =
'assets/icons/shop_order.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/shop_search.png)
static const String ASSETS_ICONS_SHOP_SEARCH_PNG =
'assets/icons/shop_search.png';
/// ![preview](file:///Users/datang/aku_community/assets/icons/system_notice.png)
static const String ASSETS_ICONS_SYSTEM_NOTICE_PNG =
'assets/icons/system_notice.png';
@ -537,6 +566,22 @@ class R {
static const String ASSETS_IMAGES_CARD_YELLOW_PNG =
'assets/images/card_yellow.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/circle_left_bottom.png)
static const String ASSETS_IMAGES_CIRCLE_LEFT_BOTTOM_PNG =
'assets/images/circle_left_bottom.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/circle_right_bottom.png)
static const String ASSETS_IMAGES_CIRCLE_RIGHT_BOTTOM_PNG =
'assets/images/circle_right_bottom.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/circle_right_top.png)
static const String ASSETS_IMAGES_CIRCLE_RIGHT_TOP_PNG =
'assets/images/circle_right_top.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/circle_text.png)
static const String ASSETS_IMAGES_CIRCLE_TEXT_PNG =
'assets/images/circle_text.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/code_logo.png)
static const String ASSETS_IMAGES_CODE_LOGO_PNG =
'assets/images/code_logo.png';
@ -595,6 +640,10 @@ class R {
static const String ASSETS_IMAGES_PLACEHOLDER_WEBP =
'assets/images/placeholder.webp';
/// ![preview](file:///Users/datang/aku_community/assets/images/splash_logo.png)
static const String ASSETS_IMAGES_SPLASH_LOGO_PNG =
'assets/images/splash_logo.png';
/// ![preview](file:///Users/datang/aku_community/assets/images/white.png)
static const String ASSETS_IMAGES_WHITE_PNG = 'assets/images/white.png';

@ -253,6 +253,9 @@ class _Manager {
///app
String get communityIntroduceInfo => '/user/communityIntroduction/findEnable';
///
String get geographyInformation => '/user/geography/findGeographyInfo';
////
String get completeFeedBack => '/user/advice/completeFeedback';
@ -311,6 +314,10 @@ class _Manager {
///app:
String get sharePayRecord =>
'/user/meterReadingShareDetails/findAllMeterShareOrderByTel';
///
String get houseType =>
'/user/houseTypeDescription/list';
}
class _Community {

@ -8,6 +8,7 @@ import 'package:aku_community/pages/event_activity/event_voting_page.dart';
import 'package:aku_community/pages/express_packages/express_package_page.dart';
import 'package:aku_community/pages/goods_deto_page/goods_deto_page.dart';
import 'package:aku_community/pages/goods_manage_page/select_borrow_return_page.dart';
import 'package:aku_community/pages/house_introduce/house_introduce.dart';
import 'package:aku_community/pages/industry_committee/industry_committee_page.dart';
import 'package:aku_community/pages/life_pay/life_pay_choose_page.dart';
import 'package:aku_community/pages/one_alarm/widget/alarm_page.dart';
@ -91,6 +92,11 @@ List<AO> appObjects = [
AO('服务浏览', R.ASSETS_ICONS_SERVICE_PNG, () => ServiceBrowsePage()),
AO('社区介绍', R.ASSETS_ICONS_INTRODUCE_PNG, () => CommunityIntroducePage()),
AO('家政服务', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
AO('地理信息', R.ASSETS_ICONS_INTRODUCE_PNG, () => CommunityIntroducePage()),
AO('周边企业', R.ASSETS_ICONS_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
AO('住房介绍', R.ASSETS_ICONS_INTRODUCE_PNG, () => HouseIntroducePage()),
// AO(
// '小区教育',
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
@ -174,7 +180,10 @@ List<String> _smartManagerApp = [
'电子商务',
'服务浏览',
'社区介绍',
'家政服务'
'家政服务',
'地理信息',
'周边企业',
'住房介绍',
// '小区教育',
// '健康运动',
// '家政服务',

@ -9,6 +9,7 @@ import 'package:aku_community/utils/headers.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@ -22,13 +23,17 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
///firebase crashlytics initalize
await MainInitialize.initFirebase();
// await MainInitialize.initFirebase();
MainInitialize.initTheme();
MainInitialize.initWechat();
//MainInitialize.initWechat();
MainInitialize.initWebSocket();
await MainInitialize.initJPush();
//
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((_) {
runApp(MyApp());
});
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@ -73,7 +78,13 @@ class _MyAppState extends State<MyApp> {
],
supportedLocales: [const Locale('zh')],
locale: Locale('zh'),
builder: BotToastInit(),
builder: (context, child) {
return MediaQuery(
//
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
child: BotToastInit().call(context,child),
);
},
navigatorObservers: [BotToastNavigatorObserver()],
),
),

@ -0,0 +1,43 @@
import 'package:aku_community/model/common/img_model.dart';
import 'package:flustars/flustars.dart';
class GeographicInformationModel {
int? id;
String? name;
String? content;
String? createDate;
List<ImgModel>? imgUrls;
DateTime? get getCreateDate => DateUtil.getDateTime(createDate!);
GeographicInformationModel(
{this.id, this.name, this.content, this.createDate, this.imgUrls});
GeographicInformationModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
content = json['content'];
createDate = json['createDate'];
if (json['imgUrls'] != null) {
imgUrls =
(json['imgUrls'] as List).map((e) => ImgModel.fromJson(e)).toList();
} else
imgUrls = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['content'] = this.content;
data['createDate'] = this.createDate;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v.toJson()).toList();
}
return data;
}
factory GeographicInformationModel.init() =>
GeographicInformationModel(id: -1, name: '', content: '', createDate: '');
}

@ -0,0 +1,39 @@
import 'package:aku_community/model/common/img_model.dart';
import 'package:flustars/flustars.dart';
class HouseIntroduceModel {
int? id;
String? name;
String? content;
String? releaseDate;
List<ImgModel>? imgUrls;
DateTime? get getReleaseDate => DateUtil.getDateTime(releaseDate!);
HouseIntroduceModel(
{this.id, this.name, this.content, this.releaseDate, this.imgUrls});
HouseIntroduceModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
content = json['content'];
releaseDate = json['releaseDate'];
if (json['imgUrls'] != null) {
imgUrls =
(json['imgUrls'] as List).map((e) => ImgModel.fromJson(e)).toList();
} else
imgUrls = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['content'] = this.content;
data['releaseDate'] = this.releaseDate;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls!.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -23,6 +23,7 @@ class CommunityIntroducePage extends StatefulWidget {
class _CommunityIntroducePageState extends State<CommunityIntroducePage> {
CommunityIontroduceModel _model = CommunityIontroduceModel.init();
bool _onload = false;
@override
Widget build(BuildContext context) {
return BeeScaffold(

@ -0,0 +1,77 @@
import 'package:aku_community/models/geographic_information/geographic_information_model.dart';
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/community_introduce/community_introduce_model.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class GeographicInformationPage extends StatefulWidget {
GeographicInformationPage({Key? key,})
: super(key: key);
@override
_GeographicInformationPageState createState() => _GeographicInformationPageState();
}
class _GeographicInformationPageState extends State<GeographicInformationPage> {
GeographicInformationModel _model = GeographicInformationModel.init();
bool _onload = false;
@override
Widget build(BuildContext context) {
return BeeScaffold(
bodyColor: Colors.white,
title: '地理信息',
body:EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
BaseModel baseModel =
await NetUtil().get(API.manager.geographyInformation);
if (baseModel.status! && baseModel.data != null) {
_model = GeographicInformationModel.fromJson(baseModel.data);
}
_onload = false;
setState(() {});
},
child: _onload
? Container()
:
ListView(
children: [
SizedBox(
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover,
image: API
.image(ImgModel.first(_model.imgUrls))),
width: double.infinity,
height: 424.w,
),
24.w.heightBox,
Padding(
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 40.w),
child: Text(
_model.content ?? '',
style: TextStyle(
fontSize: 26.sp,
color: (ktextSubColor),
fontWeight: FontWeight.bold),
)),
],
),
));
}
}

@ -14,6 +14,7 @@ import 'package:aku_community/ui/manager/advice/advice_page.dart';
import 'package:aku_community/ui/search/bee_search.dart';
import 'package:aku_community/widget/animated/OverlayWidget.dart';
import 'package:aku_community/widget/others/rectIndicator.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -179,7 +180,7 @@ class _HomePageState extends State<HomePage>
// SizedBox(height: 100.w),
Container(
padding: EdgeInsets.only(
top: 24.w, left: 32.w, right: 32.w, bottom: 32.w),
top: 24.w, bottom: 32.w),
child: getFunction(), //ApplicationView(),
decoration: BoxDecoration(
color: Colors.white,
@ -216,12 +217,13 @@ class _HomePageState extends State<HomePage>
),
SliverToBoxAdapter(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
child: Container(
margin: EdgeInsets.only(left: 32.w, top: 24.w),
margin: EdgeInsets.only(top: 24.w),
padding: EdgeInsets.only(left: 32.w, top: 24.w),
width: 150,
width: 140,
height: 150,
decoration: BoxDecoration(
image: DecorationImage(
@ -263,15 +265,16 @@ class _HomePageState extends State<HomePage>
Get.to(VisitorAccessPage());
},
),
25.wb,
Container(
margin: EdgeInsets.only(top: 24.w,left: 25.w),
margin: EdgeInsets.only(top: 24.w),
child: Column(
children: [
GestureDetector(
child: Container(
width: 195,
width: 190,
height: 69,
decoration: BoxDecoration(
@ -305,8 +308,8 @@ class _HomePageState extends State<HomePage>
],
),
Spacer(),
Image.asset(R.ASSETS_ICONS_ICON_MAIN_POLICE_PNG,width: 100.w,height: 100.w,),
25.wb,
Image.asset(R.ASSETS_ICONS_ICON_MAIN_POLICE_PNG,width: 98.w,height: 98.w,),
20.wb,
],
),
),
@ -317,7 +320,7 @@ class _HomePageState extends State<HomePage>
GestureDetector(
child: Container(
margin: EdgeInsets.only(top: 20.w),
width: 195,
width: 190,
height: 69,
decoration: BoxDecoration(
image: DecorationImage(
@ -350,8 +353,8 @@ class _HomePageState extends State<HomePage>
],
),
Spacer(),
Image.asset(R.ASSETS_ICONS_ICON_MAIN_CONSULT_PNG,width: 100.w,height: 100.w,),
25.wb,
Image.asset(R.ASSETS_ICONS_ICON_MAIN_CONSULT_PNG,width: 98.w,height: 98.w,),
20.wb,
],
),
),
@ -366,9 +369,7 @@ class _HomePageState extends State<HomePage>
],
),
),
// SliverToBoxAdapter(
// child: 20.hb,
// ),
SliverToBoxAdapter(
child: Column(
children: [
@ -445,19 +446,6 @@ class _HomePageState extends State<HomePage>
itemBuilder: (BuildContext context, int index) {
return getSwiperImage(_swiperModels[index]);
},
// CarouselSlider(
// items:
// _swiperModels.map((e) => getSwiperImage(e)).toList(),
// options: CarouselOptions(
// viewportFraction: 1.0,
// aspectRatio: 686 / 172,
// autoPlay: true,
// onPageChanged: (index, _) {
// setState(() {
// _currentIndicator = index;
// });
// },
// ),
pagination: SwiperPagination(
alignment: Alignment.bottomRight,
@ -493,7 +481,8 @@ class _HomePageState extends State<HomePage>
Widget getSwiperImage(SwiperModel swiperModel) {
return Container(
child: FadeInImage.assetNetwork(
child:
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(swiperModel.voResourcesImgList)),
fit: BoxFit.fill,
@ -548,4 +537,5 @@ class _HomePageState extends State<HomePage>
);
}
}

@ -45,14 +45,12 @@ class _AnimateAppBarState extends State<AnimateAppBar> {
padding: const EdgeInsets.only(top: 5),
child: AppBar(
titleSpacing: 10.0,
title: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (appProvider.location != null)
Padding(
padding: const EdgeInsets.only(top: 2,right: 5),
padding: const EdgeInsets.only(right: 5),
child: Image.asset(
R.ASSETS_ICONS_ICON_MAIN_LOCATION_PNG,
width: 32.w,
@ -60,7 +58,7 @@ class _AnimateAppBarState extends State<AnimateAppBar> {
),
),
Text(
appProvider.location!['city'] as String? ?? '',
appProvider.location?['city']==null?'':appProvider.location?['city'] as String? ?? '',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24.sp,
@ -79,6 +77,7 @@ class _AnimateAppBarState extends State<AnimateAppBar> {
]),
backgroundColor: _bgColor,
actions: widget.actions,
),
);
}

@ -0,0 +1,587 @@
/*
* ====================================================
* package : widgets
* author : Created by nansi.
* time : 2019/5/13 1:44 PM
* remark :
* ====================================================
*/
import 'package:aku_community/utils/text_utils.dart';
import 'package:flutter/material.dart';
///
typedef SelectedListener = Function(int selectedIndex, FilterItemModel item);
///
typedef PopOptionHandle = Function(OptionListStatus status);
/// filterBar
typedef FilterToolBarListener = Function(bool update);
class FilterToolBarController {
late FilterResultContainerHelper helper;
late int selectedIndex;
late FilterItemModel item;
late GlobalKey _containerKey;
late GlobalKey _toolBarKey;
/// [update] sublist index
FilterToolBarListener updateToolBarState = (bool update) {};
close() {
helper.changeOptionListStatus(OptionListStatus.close);
}
get toolBarDx {
RenderBox box = _toolBarKey.currentContext?.findRenderObject() as RenderBox;//_toolBarKey.currentContext.findRenderObject();
Offset offset = box.localToGlobal(Offset.zero);
return offset.dx;
}
double get toolBarDy {
/// toolbar top - containertop
RenderBox containerBox = _containerKey.currentContext?.findRenderObject() as RenderBox;
RenderBox box = _toolBarKey.currentContext?.findRenderObject() as RenderBox;
Offset containerTopOffset = containerBox.localToGlobal(Offset.zero);
Offset toolBarTopOffset = box.localToGlobal(Offset.zero);
return toolBarTopOffset.dy - containerTopOffset.dy;
}
////position
// RenderBox box = _key.currentContext.findRenderObject();
// Offset offset = box.localToGlobal(Offset.zero);
//
////size
// Size size = box.size;
// print(" ---- $offset ------- $size");
}
enum OptionListStatus { open, close }
///
class FilterResultContainerHelper {
final PopOptionHandle handle;
///
late OptionListStatus status;
FilterResultContainerHelper({required this.handle});
changeOptionListStatus(OptionListStatus status) {
this.status = status;
this.handle(status);
}
}
/// FilterToolBar 使
class FilterToolBarResultContainer extends StatefulWidget {
final FilterToolBarController? controller;
final Widget? body;
const FilterToolBarResultContainer(
{ GlobalKey? key, this.controller, this.body})
: assert(controller != null, "controller 不为空");
@override
State<StatefulWidget> createState() {
return _FilterToolBarResultContainerState();
}
}
class _FilterToolBarResultContainerState
extends State<FilterToolBarResultContainer> with TickerProviderStateMixin {
///
late int _lines;
int maxLines = 3;
///
double _lineHeight = 35.0;
///
double _bottomSpacing = 8.0;
///
double _topSpacing = 8.0;
///
Color _unselectedColor = Colors.grey[700]!;
/// toolbar
// double _toolBarTitleFont = 14.0;
///
double _subTitleFont = 13.0;
/// row
EdgeInsetsGeometry _subtitleRowPadding = EdgeInsets.only(left: 15, right: 15);
late AnimationController _animationController;
late Animation<double> _animation;
@override
void initState() {
_animationController =
AnimationController(vsync: this, duration: Duration(milliseconds: 150));
_lines = maxLines;
widget.controller?.helper = FilterResultContainerHelper(handle: (status) {
if (status == OptionListStatus.open) {
_buildAnimation(widget.controller!.item);
_animationController.forward();
} else {
_animationController.reset();
}
});
if (widget.key == null) {
widget.controller!._containerKey = GlobalKey();
} else {
widget.controller!._containerKey = widget.key as GlobalKey;
}
super.initState();
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
key: widget.controller!._containerKey,
child: _buildBody(context),
);
}
Stack _buildBody(BuildContext context) {
return Stack(
children: <Widget>[
/// body
Container(
height: double.infinity,
child: widget.body,
),
///
_maskView(),
widget.controller?._toolBarKey == null
? Container()
: Positioned(
top: widget.controller!.toolBarDy + 40,
left: 0,
right: 0,
bottom: 0,
child: Stack(children: [
widget.controller!.item.type == FilterItemType.list
? _buildList(context)
: Container(),
]))
],
);
}
Widget _maskView() {
double? num =widget.controller?.toolBarDy;
return widget.controller?._toolBarKey == null
? Container()
: Positioned(
top: (num as double) + 40,
left: 0,
right: 0,
bottom: 0,
child: Offstage(
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
widget.controller!.helper.changeOptionListStatus(
OptionListStatus.close,
);
widget.controller!.updateToolBarState(false);
_animationController.reset();
},
child: Opacity(
opacity: 0.3,
child: Container(
color: Colors.black,
),
),
),
offstage: _animation == null ||
(_animation.status == AnimationStatus.dismissed),
),
);
}
/// [widget.maxLines]
/// ,
_buildAnimation(FilterItemModel item) {
_lines =
item.subtitles!.length > maxLines ? maxLines : item.subtitles!.length;
_animation = new Tween(
begin: 0.0 - _lines * _lineHeight - _bottomSpacing - _topSpacing,
end: 0.0)
.animate(_animationController)
..addListener(() {
setState(() {
// the state that has changed here is the animation objects value
});
});
}
///
Positioned _buildList(context) {
FilterItemModel item = widget.controller!.item;
return Positioned(
top: _animation.value,
left: 0,
right: 0,
child: LimitedBox(
maxHeight: _lineHeight * _lines + _topSpacing + _bottomSpacing,
child: Container(
padding: EdgeInsets.only(bottom: _bottomSpacing, top: 5),
height: _lineHeight * item.subtitles!.length +
_bottomSpacing +
_topSpacing,
decoration: BoxDecoration(
color: Color.fromARGB(240, 255, 255, 255),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10),
bottomRight: Radius.circular(10))),
child: MediaQuery.removePadding(
context: context,
removeTop: true,
child: ListView.builder(
physics: NeverScrollableScrollPhysics(),
controller: PrimaryScrollController.of(context),
itemCount: item.subtitles!.length,
itemBuilder: (context, index) {
bool subTitleSelected = item.selectedSubIndex == index;
return Container(
height: _lineHeight,
child: RawMaterialButton(
onPressed: () {
widget.controller!.helper
.changeOptionListStatus(OptionListStatus.close);
widget.controller!.updateToolBarState(false);
if (item.selectedSubIndex == index) return;
item.selectedSubIndex = index;
String title = item.subtitleShort == null ||
TextUtils.isEmpty(item.subtitleShort![index])
? item.subtitles![index]
: item.subtitleShort![index];
item.title = title;
widget.controller!.updateToolBarState(true);
},
child: _sublistItem(index, item, subTitleSelected),
),
);
}),
),
),
),
);
}
/// item
Container _sublistItem(
int index, FilterItemModel item, bool subTitleSelected) {
return Container(
padding: _subtitleRowPadding,
child: Row(
children: <Widget>[
Offstage(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Icon(
Icons.check,
size: 17,
color: Colors.red,
),
),
offstage: index != item.selectedSubIndex,
),
Expanded(
child: Text(
item.subtitles![index],
style: TextStyle(
fontSize: _subTitleFont,
color: _unselectedColor,
fontWeight:
(subTitleSelected ? FontWeight.w600 : FontWeight.w400)),
)),
],
),
);
}
}
class FilterToolBar extends StatefulWidget {
FilterToolBar({
required this.titles,
required this.listener,
required this.controller,
this.selectedColor,
this.maxLines = 4,
this.trialing,
this.startWidget,
this.fontSize = 15.0,
this.height = 40,
}) : assert(listener != null, "请设置监听事件"),
assert(controller != null, "请设置controller");
final List<FilterItemModel> titles;
final Color? selectedColor;
final int maxLines;
final SelectedListener listener;
final Widget? trialing;
final Widget? startWidget;
final FilterToolBarController? controller;
final double fontSize;
final double height;
@override
State<StatefulWidget> createState() {
return _FilterToolBarState();
}
}
class _FilterToolBarState extends State<FilterToolBar>
with TickerProviderStateMixin {
Color _unselectedColor = Colors.grey[700]!;
GlobalKey _key = GlobalKey();
@override
void initState() {
super.initState();
widget.controller?.selectedIndex = widget.controller?.selectedIndex ?? 0;
widget.controller?._toolBarKey = _key;
widget.controller?.updateToolBarState = (bool update) {
// print("----- ${widget.controller.selectedIndex}");
if (update) {
widget.listener(
widget.controller!.selectedIndex, widget.controller!.item);
}
setState(() {});
};
}
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: widget.height,
child: _buildToolBar(),
);
}
Container _buildToolBar() {
List<Widget> items = <Widget>[];
if (widget.startWidget != null) {
items.add(SizedBox(width: 60,));
items.add(widget.startWidget!);
items.add(SizedBox(width: 20,));
}
items.addAll(_buildToolBarItem());
if (widget.trialing != null) {
items.add(widget.trialing!);
}
return Container(
key: _key,
height: 40,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
top: BorderSide(color: Colors.grey[200]!, width: 0.5),
bottom: BorderSide(color: Colors.grey[200]!, width: 0.5))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: items,
),
);
}
List<Expanded> _buildToolBarItem() {
return widget.titles.map((item) {
int index = widget.titles.indexOf(item);
bool selected = index == widget.controller?.selectedIndex;
Color color = (selected ? widget.selectedColor : _unselectedColor)!;
return Expanded(
child: GestureDetector(
onTap: () {
widget.controller?.item = item;
/// toolbar
if (widget.controller?.helper != null &&
widget.controller?.helper.status == OptionListStatus.open) {
widget.controller?.helper.changeOptionListStatus(
OptionListStatus.close,
);
} else {
if (item.type == FilterItemType.list) {
///
if (widget.controller?.selectedIndex == index) {
if (widget.controller?.helper != null) {
widget.controller?.helper.changeOptionListStatus(
OptionListStatus.open,
);
} else {
FlutterError("列表类型需要与 FilterToolBarResultContainer 一起使用");
}
} else {
///
widget.listener(index, item);
}
}
}
///
if (item.type == FilterItemType.double) {
if (widget.controller?.selectedIndex != index) {
item.selectedList![index] = true;
item.topSelected = item.selectedList![index];
} else {
//print(item.topSelected);
//item.topSelected = !item.topSelected;
// print(widget.titles[index].topSelected);
item.selectedList![index] = ! item.selectedList![index];
item.topSelected = item.selectedList![index];
}
widget.listener(index, item);
}
///
else if (item.type == FilterItemType.normal) {
if (widget.controller?.selectedIndex == index) return;
widget.listener(index, item);
}
widget.controller?.selectedIndex = index;
setState(() {});
},
child: Container(
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
item.title,
style: TextStyle(
fontSize: widget.fontSize, color: color, fontWeight: FontWeight.w400
)
// AppTextStyle.generate(widget.fontSize,
// color: color, fontWeight: FontWeight.w400),
),
_buildArrow(item, color, selected,index)
],
),
),
),
);
}).toList();
}
_buildArrow(FilterItemModel item, color, bool selected,int index) {
if (item.type == FilterItemType.list) {
return Icon(
selected
? (widget.controller?.helper != null &&
widget.controller?.helper.status == OptionListStatus.open
? Icons.arrow_drop_up
: Icons.arrow_drop_down)
: Icons.arrow_drop_down,
color: color,
size: 19,
);
} else if (item.type == FilterItemType.double) {
if (selected) {
return Padding(
padding: const EdgeInsets.only(left: 2.0),
child: Icon(
item.selectedList![index] ? IconData( 0xe620, fontFamily: "AppIcons"): IconData( 0xe621, fontFamily: "AppIcons"),
size: 7,
color: color,
),
);
} else {
return Padding(
padding: const EdgeInsets.only(left: 2.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
IconData( 0xe620, fontFamily: "AppIcons"),
size: 7,
color: _unselectedColor,
),
Icon(
IconData( 0xe621, fontFamily: "AppIcons"),
size: 7,
color: _unselectedColor,
),
],
),
);
}
} else {
return Container();
}
}
}
enum FilterItemType {
///
list,
///
double,
///
normal
}
class FilterItemModel {
final FilterItemType type;
String title;
final List<String>? subtitles;
///
final List<String>? subtitleShort;
List<bool>? selectedList;
bool topSelected;
int selectedSubIndex = 0;
FilterItemModel({
required this.type,
required this.title,
this.selectedList,
this.subtitles,
this.subtitleShort,
this.topSelected = true,
}) : assert(
type == FilterItemType.list
? (subtitles != null && subtitles.length > 0)
: true,
"type为list列表项不能为空");
}

@ -0,0 +1,83 @@
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/community_introduce/community_introduce_model.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class HouseDetailPage extends StatefulWidget {
final HouseIntroduceModel houseIntroduceModel;
HouseDetailPage({Key? key, required this.houseIntroduceModel})
: super(key: key);
@override
_HouseDetailPageState createState() => _HouseDetailPageState();
}
class _HouseDetailPageState extends State<HouseDetailPage> {
bool _onload = false;
@override
Widget build(BuildContext context) {
return BeeScaffold(
bodyColor: Colors.white,
title: '住房详情',
body: ListView(
children: [
SizedBox(
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover,
image: API
.image(ImgModel.first(widget.houseIntroduceModel.imgUrls))),
width: double.infinity,
height: 424.w,
),
24.w.heightBox,
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child:
// widget.houseIntroduceModel.content!.text
// .size(28.sp)
// .color(ktextPrimary)
// .make(),
Text(
widget.houseIntroduceModel.name ?? '',
style: TextStyle(
fontSize: 30.sp,
color: (ktextPrimary),
fontWeight: FontWeight.bold),
)),
Padding(
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 16.w),
child: Text(
'发布于:${widget.houseIntroduceModel.getReleaseDate}' ,
style: TextStyle(
fontSize: 20.sp,
color: (ktextThirdColor),
fontWeight: FontWeight.bold),
)),
Padding(
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 40.w),
child: Text(
widget.houseIntroduceModel.content ?? '',
style: TextStyle(
fontSize: 26.sp,
color: (ktextSubColor),
fontWeight: FontWeight.bold),
)),
],
),
);
}
}

@ -0,0 +1,130 @@
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
import 'package:aku_community/utils/hive_store.dart';
import 'package:aku_community/utils/websocket/tips_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/model/user/committee_item_model.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'house_detail_page.dart';
class HouseIntroducePage extends StatefulWidget {
HouseIntroducePage({Key? key}) : super(key: key);
@override
_HouseIntroducePageState createState() => _HouseIntroducePageState();
}
class _HouseIntroducePageState extends State<HouseIntroducePage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
super.initState();
// Future.delayed(Duration(milliseconds: 0), () async {
// var agreement = await HiveStore.appBox?.get('IndustryCommitteePage') ?? false;
// if (!agreement) {
// await TipsDialog.tipsDialog();
// HiveStore.appBox!.put('IndustryCommitteePage',true);
// }
// });
}
Widget _buildCard(HouseIntroduceModel model) {
return GestureDetector(
onTap: (){
Get.to(HouseDetailPage(houseIntroduceModel: model,));
},
child: Container(
padding: EdgeInsets.all(20.w),
color: Colors.white,
height: 250.w,
child: Row(
// .padding(EdgeInsets.all(20.w)).white.withRounded(value: 8.w).make()
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(model.imgUrls)),
height: 200.w,
width: 240.w,
fit: BoxFit.fill,
),
),
24.wb,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 440.w,
child: Text(
'${model.name}',
style: TextStyle(
fontSize: 30.sp,
fontWeight: FontWeight.bold,
color: ktextPrimary
),
maxLines: 4,
overflow: TextOverflow.ellipsis,
),
),
Spacer(),
'发布于:${model.getReleaseDate}'
.text
.size(20.sp)
.color(ktextThirdColor)
.make(),
],
),
],
),
),
);
}
Widget build(BuildContext context) {
return BeeScaffold(
title: '住房介绍',
systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)),
body: BeeListView<HouseIntroduceModel>(
path: API.manager.houseType,
convert: (model) {
return model.tableList!
.map((e) => HouseIntroduceModel.fromJson(e))
.toList();
},
controller: _refreshController,
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 20.w),
itemBuilder: (context, index) {
return _buildCard(items[index]);
},
separatorBuilder: (context, index) => 20.hb,
itemCount: items.length,
);
},
),
);
}
}

@ -14,6 +14,7 @@ import 'package:aku_community/widget/picker/bee_custom_picker.dart';
import 'package:aku_community/widget/picker/bee_date_picker.dart';
import 'package:aku_community/widget/picker/bee_image_picker.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -92,7 +93,21 @@ class _UserProfilePageState extends State<UserProfilePage> {
Hero(
tag: 'AVATAR',
child: ClipOval(
child: FadeInImage.assetNetwork(
child:
// CachedNetworkImage(
// imageUrl: API.image(
// userProvider.userInfoModel!.imgUrls.isNotEmpty
// ? userProvider.userInfoModel?.imgUrls.first.url
// : ''),
// height: 56.w,
// width: 56.w,
// placeholder: (context, url) =>
// Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP),
// errorWidget: (context, url, error) =>
// Image.asset(R.ASSETS_IMAGES_PLACEHOLDER_WEBP),
// fit: BoxFit.fill,
// ),
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(
userProvider.userInfoModel!.imgUrls.isNotEmpty

@ -21,6 +21,10 @@ import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/utils/headers.dart';
class SplashPage extends StatefulWidget {
SplashPage({Key? key}) : super(key: key);
@ -110,7 +114,7 @@ class _SplashPageState extends State<SplashPage> {
context,
debug: DeveloperUtil.dev,
);
Future.delayed(Duration(milliseconds: 1000), () async {
Future.delayed(Duration(milliseconds: 0), () async {
await _originOp();
var agreement = await HiveStore.appBox?.get('agreement') ?? false;
if (!agreement) {
@ -130,21 +134,104 @@ class _SplashPageState extends State<SplashPage> {
await _initOp();
Get.offAll(() => TabNavigator());
});
// _initOp().then((value) => Get.offAll(() => TabNavigator()));
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SizedBox(
height: 80,
width: 80,
child: Image.asset(R.ASSETS_IMAGES_LOGO_PNG),
).centered(),
bottomNavigationBar: SizedBox(
child: CircularProgressIndicator().centered(),
height: 100,
body: Container(
color: Colors.white,
child: Stack(
children: [
Align(
alignment: Alignment.topCenter,
child:Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
380.hb,
Text('\n',style: TextStyle(color:Color(0xFF000000),fontSize: 40.sp,height: 1.15),),
],
),
height: 400,
),
25.wb,
Container(
child:
Row(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text('\n便\n\n\n\n\n\n\n',style: TextStyle(color:Color(0xFF000000),fontSize: 40.sp,height: 1.15),),
40.hb,
],
),
20.wb,
Column(
children: [
580.hb,
Container(
height: 400.w,
width: 2.w,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0x99000000), Color(0x00000000)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
borderRadius: BorderRadius.circular(2.w),
),
),
],
)
],
),
height: 472,
),
],
)
),
Positioned(child: Image.asset(R.ASSETS_IMAGES_CIRCLE_TEXT_PNG,width: 61.w,height: 72.w,fit: BoxFit.fill,),top: 410.w,left: 275.w,),
Positioned(child: Image.asset(R.ASSETS_IMAGES_CIRCLE_RIGHT_TOP_PNG,width: 185.w,height: 249.w,fit: BoxFit.fill,),top: 0.w,right: 0.w,),
Positioned(child: Image.asset(R.ASSETS_IMAGES_CIRCLE_LEFT_BOTTOM_PNG,width: 270.w,height: 504.w,fit: BoxFit.fill,),bottom: 224.w,left: 0.w,),
Positioned(child: Image.asset(R.ASSETS_IMAGES_CIRCLE_RIGHT_BOTTOM_PNG,width: 88.w,height: 180.w,fit: BoxFit.fill,),bottom: 150.w,right: 0.w,),
Align(
alignment: Alignment.bottomCenter,
child: Container(
padding: EdgeInsets.only(bottom: 60.w),
height: 300.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(R.ASSETS_IMAGES_SPLASH_LOGO_PNG,width: 140.w,height: 140.w,fit: BoxFit.fill,),
Text('小蜜蜂智慧社区',style: TextStyle(color:Color(0xD9000000),fontSize: 32.sp,fontWeight: FontWeight.bold),),
],
),
),
)
],
),
),
// SizedBox(
// height: 80,
// width: 80,
// child: Image.asset(R.ASSETS_IMAGES_LOGO_PNG),
// ).centered(),
// bottomNavigationBar: SizedBox(
// child: CircularProgressIndicator().centered(),
// height: 100,
// ),
);
}
}

@ -0,0 +1,83 @@
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/community_introduce/community_introduce_model.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class SurroundingEnterprisesDetailPage extends StatefulWidget {
final HouseIntroduceModel houseIntroduceModel;
SurroundingEnterprisesDetailPage({Key? key, required this.houseIntroduceModel})
: super(key: key);
@override
_SurroundingEnterprisesDetailPageState createState() => _SurroundingEnterprisesDetailPageState();
}
class _SurroundingEnterprisesDetailPageState extends State<SurroundingEnterprisesDetailPage> {
bool _onload = false;
@override
Widget build(BuildContext context) {
return BeeScaffold(
bodyColor: Colors.white,
title: '住房详情',
body: ListView(
children: [
SizedBox(
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover,
image: API
.image(ImgModel.first(widget.houseIntroduceModel.imgUrls))),
width: double.infinity,
height: 424.w,
),
24.w.heightBox,
Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child:
// widget.houseIntroduceModel.content!.text
// .size(28.sp)
// .color(ktextPrimary)
// .make(),
Text(
widget.houseIntroduceModel.name ?? '',
style: TextStyle(
fontSize: 30.sp,
color: (ktextPrimary),
fontWeight: FontWeight.bold),
)),
Padding(
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 16.w),
child: Text(
'发布于:${widget.houseIntroduceModel.getReleaseDate}' ,
style: TextStyle(
fontSize: 20.sp,
color: (ktextThirdColor),
fontWeight: FontWeight.bold),
)),
Padding(
padding: EdgeInsets.only(left: 32.w,right: 32.w,top: 40.w),
child: Text(
widget.houseIntroduceModel.content ?? '',
style: TextStyle(
fontSize: 26.sp,
color: (ktextSubColor),
fontWeight: FontWeight.bold),
)),
],
),
);
}
}

@ -0,0 +1,130 @@
import 'package:aku_community/models/house_introduce/house_introduce_model.dart';
import 'package:aku_community/pages/surrounding_enterprises/surrding_enterprises_detail_page.dart';
import 'package:aku_community/utils/hive_store.dart';
import 'package:aku_community/utils/websocket/tips_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/constants/app_theme.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/model/user/committee_item_model.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class SurroundingEnterprisesPage extends StatefulWidget {
SurroundingEnterprisesPage({Key? key}) : super(key: key);
@override
_SurroundingEnterprisesPageState createState() => _SurroundingEnterprisesPageState();
}
class _SurroundingEnterprisesPageState extends State<SurroundingEnterprisesPage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
super.initState();
// Future.delayed(Duration(milliseconds: 0), () async {
// var agreement = await HiveStore.appBox?.get('IndustryCommitteePage') ?? false;
// if (!agreement) {
// await TipsDialog.tipsDialog();
// HiveStore.appBox!.put('IndustryCommitteePage',true);
// }
// });
}
Widget _buildCard(HouseIntroduceModel model) {
return GestureDetector(
onTap: (){
Get.to(SurroundingEnterprisesDetailPage(houseIntroduceModel: model,));
},
child: Container(
padding: EdgeInsets.all(20.w),
color: Colors.white,
height: 250.w,
child: Row(
// .padding(EdgeInsets.all(20.w)).white.withRounded(value: 8.w).make()
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(ImgModel.first(model.imgUrls)),
height: 200.w,
width: 240.w,
fit: BoxFit.fill,
),
),
24.wb,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 440.w,
child: Text(
'${model.name}',
style: TextStyle(
fontSize: 30.sp,
fontWeight: FontWeight.bold,
color: ktextPrimary
),
maxLines: 4,
overflow: TextOverflow.ellipsis,
),
),
Spacer(),
'发布于:${model.getReleaseDate}'
.text
.size(20.sp)
.color(ktextThirdColor)
.make(),
],
),
],
),
),
);
}
Widget build(BuildContext context) {
return BeeScaffold(
title: '住房介绍',
systemStyle: SystemStyle.genStyle(bottom: Color(0xFF2A2A2A)),
body: BeeListView<HouseIntroduceModel>(
path: API.manager.houseType,
convert: (model) {
return model.tableList!
.map((e) => HouseIntroduceModel.fromJson(e))
.toList();
},
controller: _refreshController,
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(vertical: 20.w),
itemBuilder: (context, index) {
return _buildCard(items[index]);
},
separatorBuilder: (context, index) => 20.hb,
itemCount: items.length,
);
},
),
);
}
}

@ -82,7 +82,7 @@ class ActivityCard extends StatelessWidget {
width: 98.w,
decoration: BoxDecoration(
color: outdate ? Color(0xFFABABAB) : Color(0x80FEBF76),
borderRadius: BorderRadius.all(Radius.circular(8)),
borderRadius: BorderRadius.all(Radius.circular(4)),
),
child: outdate
@ -90,13 +90,13 @@ class ActivityCard extends StatelessWidget {
.text
.size(22.sp)
.color(Color(0xFF666666))
.bold
.make()
: '报名中'
.text
.size(22.sp)
.color(Color(0xFFF48117))
.bold
.make(),
),
onTap: () {

@ -51,9 +51,7 @@ class _HomeNotificationState extends State<HomeNotification> {
24.wb,
widget.items.isEmpty
? Spacer()
: Container(
width: 295,
child: CarouselSlider(
: CarouselSlider(
items: widget.items.map((e) => getText(e)).toList(),
options: CarouselOptions(
scrollDirection: Axis.vertical,
@ -62,116 +60,15 @@ class _HomeNotificationState extends State<HomeNotification> {
autoPlay: true,
onPageChanged: (index, _) {
print(index.toString());
//print(index.toString());
// setState(() {
// _currentIndicator = index;
// });
},
),
),
),
// Container(
// alignment: Alignment.centerLeft,
// height: 85.w,
// child:
// Row(
// children: [
// Container(
// width: 200,
// height: 22,
// alignment: Alignment.centerLeft,
// child: AnimatedTextKit(
// pause: Duration(milliseconds: 2000),
// animatedTexts: widget.items
// .map((e) {
// return RotateAnimatedText(
// e.title!,
// textStyle: TextStyle(
// color: Color(0xA6000000),
// fontSize: 22.sp,
// fontWeight: FontWeight.bold,
//
//
// ),
// duration: Duration(milliseconds: 3000),
// );
// }
//
// )
// .toList(),
// repeatForever: true,
// onNext: (index,bool){
// print('next');
// boardItemModel = widget.items[index];
// isDate = true;
// setState(() {
// });
// },
// onNextBeforePause: (index,bool){
// print('before');
// isDate = false;
// setState(() {
// });
// },
// ),
// ),
//
//
// ],
// )
//
// ).expand(),
// isDate
// ? MaterialButton(
// shape: StadiumBorder(),
// padding: EdgeInsets.symmetric(horizontal: 12.w),
// onPressed: () {
// Get.to(() => NoticePage());
// },
// child: Row(
// children: [
// Container(
// constraints: BoxConstraints(minWidth: 60),
// child: Text(
// isDate
// ? boardItemModel.releaseDate != null
// ? BeeDateUtil(boardItemModel.releaseDate)
// .timeAgo
// : ''
// : '',
// style: TextStyle(
// color: Color(0x73000000),
// fontSize: 20.sp,
// ),
// )
// // AnimatedTextKit(
// // pause: Duration(milliseconds: 2000),
// // animatedTexts: widget.items
// // .map((e) => RotateAnimatedText(
// // e.releaseDate!=null?BeeDateUtil(e.releaseDate)
// // .timeAgo:'',
// //
// // textStyle: TextStyle(
// // color: Color(0x73000000),
// // fontSize: 20.sp,
// //
// // ),
// // duration: Duration(milliseconds: 3000),
// // ))
// // .toList(),
// // repeatForever: true,
// // ),
// ),
// 8.wb,
// Icon(
// CupertinoIcons.chevron_forward,
// size: 24.w,
// color: Color(0xFF999999),
// ),
// ],
// ),
// )
// : SizedBox(),
).expand(),
12.wb,
],
);
@ -183,13 +80,14 @@ class _HomeNotificationState extends State<HomeNotification> {
Get.to(() => NoticePage());
},
child: Container(
width: 295,
color: Colors.transparent,
child: Row(
children: [
Container(
constraints: BoxConstraints(
maxWidth: 230
maxWidth: 190
),
child: Text(
e.title ?? '',

@ -1,5 +1,10 @@
// import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/ui/market/widget/animated_home_background.dart';
import 'package:aku_community/ui/search/bee_search.dart';
import 'package:aku_community/widget/home/home_sliver_app_bar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -22,6 +27,9 @@ import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/utils/network/base_list_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:provider/provider.dart';
import 'package:aku_community/provider/app_provider.dart';
// import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
@ -35,13 +43,22 @@ class MarketPage extends StatefulWidget {
}
class _MarketPageState extends State<MarketPage>
with AutomaticKeepAliveClientMixin {
with AutomaticKeepAliveClientMixin , TickerProviderStateMixin{
List<MarketCategoryModel> _marketModels = [];
List<GoodsItem> _hotItems = [];
late EasyRefreshController _refreshController;
late ScrollController _sliverListController;
GlobalKey<HomeSliverAppBarState> _sliverAppBarGlobalKey = GlobalKey();
GlobalKey<AnimatedHomeBackgroundState> _animatedBackgroundState = GlobalKey();
int _pageNum = 1;
int _size = 4;
int _pageCount = 0;
double MessageHeight = 0;
double bannerHeight = 0;
double buttonsHeight = 200.w;
double tabBarHeight = 60.w;
late TabController _tabController;
Future updateMarketInfo() async {
BaseListModel baseListModel =
@ -75,6 +92,9 @@ class _MarketPageState extends State<MarketPage>
void initState() {
super.initState();
_refreshController = EasyRefreshController();
_sliverListController = ScrollController();
_tabController = TabController(
initialIndex: 0, length: 3, vsync: this);
Future.delayed(Duration(milliseconds: 0), () async {
_marketModels = await DisplayCategoryModel.top8;
await updateMarketInfo();
@ -85,6 +105,8 @@ class _MarketPageState extends State<MarketPage>
@override
void dispose() {
_refreshController.dispose();
_sliverListController.dispose();
_tabController.dispose();
super.dispose();
}
@ -92,203 +114,425 @@ class _MarketPageState extends State<MarketPage>
Widget build(BuildContext context) {
super.build(context);
final mediaWidth = MediaQuery.of(context).size.width;
return BeeScaffold(
leading: IconButton(
icon: Icon(CupertinoIcons.search),
onPressed: () {
Get.to(() => SearchGoodsPage());
MessageHeight = 76;
return Scaffold(
// leading: IconButton(
// icon: Icon(CupertinoIcons.search),
// onPressed: () {
// Get.to(() => SearchGoodsPage());
// },
// ),
// title: '商城',
// actions: [
// MaterialButton(
// minWidth: 108.w,
// padding: EdgeInsets.zero,
// onPressed: () async {
// // Get.to(() => SecondHandPage());
// Get.to(() => MyOrderPage());
// },
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: [
// Image.asset(
// R.ASSETS_ICONS_SECOND_HAND_PNG,
// width: 48.w,
// height: 48.w,
// ),
// 4.hb,
// // '二手'.text.size(20.sp).black.make(),
// '订单'.text.size(20.sp).black.make(),
// ],
// ),
// ),
// MaterialButton(
// minWidth: 108.w,
// padding: EdgeInsets.zero,
// onPressed: () async {
// final cancel = BotToast.showLoading();
// List<MarketCategoryModel> models =
// await DisplayCategoryModel.fetchCategory(0);
// cancel();
// Get.to(() => CategoryPage(models: models));
// },
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// mainAxisSize: MainAxisSize.max,
// children: [
// Image.asset(
// R.ASSETS_ICONS_CATEGORY_PNG,
// width: 48.w,
// height: 48.w,
// ),
// 4.hb,
// '分类'.text.size(20.sp).black.make(),
// ],
// ),
// ),
// ],
body:EasyRefresh(
firstRefresh: true,
enableControlFinishLoad: false,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _refreshController,
onRefresh: () async {
_pageNum = 1;
await updateMarketInfo();
setState(() {});
},
onLoad: () async {
_pageNum++;
await loadMarketInfo();
if (_pageCount <= _pageNum) {
_refreshController.finishLoad(noMore: false);
}
setState(() {});
},
child: _buildBody(context),
),
title: '商城',
actions: [
MaterialButton(
minWidth: 108.w,
padding: EdgeInsets.zero,
onPressed: () async {
// Get.to(() => SecondHandPage());
Get.to(() => MyOrderPage());
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Image.asset(
R.ASSETS_ICONS_SECOND_HAND_PNG,
width: 48.w,
height: 48.w,
),
4.hb,
// '二手'.text.size(20.sp).black.make(),
'订单'.text.size(20.sp).black.make(),
],
),
);
}
Widget _buildBody(BuildContext context) {
return CustomScrollView(
controller: _sliverListController,
slivers: <Widget>[
HomeSliverAppBar(
key: _sliverAppBarGlobalKey,
actions: _actionsWidget(),
title: _buildTitle(),
backgroundColor: Colors.white,
expandedHeight:
bannerHeight +
buttonsHeight+600.w,
flexibleSpace: _flexibleSpaceBar(context),
bottom: PreferredSize(
preferredSize: Size.fromHeight(tabBarHeight),
child: _goodsTitle()
// Container(
// color: Colors.green,
// height: tabBarHeight,
// width: 200.w,
// // alignment: Alignment.center,
// // color: AppColor.frenchColor,
// // child: HomePageTabbar(
// // promotionList: _promotionList,
// // timerJump: (index) {
// // _tabIndex = index;
// // _homeCountdownController.indexChange(index);
// // //
// // _tabController.animateTo(index);
// // _getPromotionGoodsList(_promotionList[index].id);
// // },
// // clickItem: (index) {
// // _homeCountdownController.indexChange(index);
// // _getPromotionGoodsList(_promotionList[index].id);
// // },
// // tabController: _tabController,
// // ),
// ),
)),
SliverPadding(
padding: EdgeInsets.all(10.w),
),
MaterialButton(
minWidth: 108.w,
padding: EdgeInsets.zero,
onPressed: () async {
final cancel = BotToast.showLoading();
List<MarketCategoryModel> models =
await DisplayCategoryModel.fetchCategory(0);
cancel();
Get.to(() => CategoryPage(models: models));
buildSliverGrid(),
// EasyRefresh(
// firstRefresh: false,
// enableControlFinishLoad: false,
// header: MaterialHeader(),
// footer: MaterialFooter(),
// controller: _refreshController,
// onRefresh: () async {
// _pageNum = 1;
// await updateMarketInfo();
// setState(() {});
// },
// onLoad: () async {
// _pageNum++;
// await loadMarketInfo();
// if (_pageCount <= _pageNum) {
// _refreshController.finishLoad(noMore: false);
// }
// setState(() {});
// },
// child: WaterfallFlow.builder(
// gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// mainAxisSpacing: 20.w,
// crossAxisSpacing: 20.w,
// ),
// padding: EdgeInsets.all(32.w),
// itemBuilder: (context, index) {
// final item = _hotItems[index];
// return GoodsCard(item: item);
// },
// itemCount: _hotItems.length,
// ),
// ),
],
);
}
SliverGrid buildSliverGrid() {
return SliverGrid(
// child: WaterfallFlow.builder(
// gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
// crossAxisCount: 2,
// mainAxisSpacing: 20.w,
// crossAxisSpacing: 20.w,
// ),
// padding: EdgeInsets.all(32.w),
// itemBuilder: (context, index) {
// final item = _hotItems[index];
// return GoodsCard(item: item);
// },
// itemCount: _hotItems.length,
// ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
///Item
delegate: new SliverChildBuilderDelegate(
(BuildContext context, int index) {
///Item
//return GoodsCard(item: _hotItems[index]);
return Container(
width: 200.w,
height: 200.w,
color: Colors.blue,
);
},
///Item
childCount: 20,//_hotItems.length,
),
);
}
_actionsWidget() {
return <Widget>[
GestureDetector(
onTap: () {
//Get.to(() => BeeSearch());
},
child: Image.asset(R.ASSETS_ICONS_SHOP_CAR_PNG,
height: 40.w, width: 40.w),
),
Padding(
padding: const EdgeInsets.only( left: 12),
child: GestureDetector(
onTap: () {
//Get.to(() => BeeSearch());
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Image.asset(
R.ASSETS_ICONS_CATEGORY_PNG,
width: 48.w,
height: 48.w,
),
4.hb,
'分类'.text.size(20.sp).black.make(),
],
),
child: Image.asset(R.ASSETS_ICONS_SHOP_ORDER_PNG,
height: 40.w, width: 40.w),
),
],
body: NestedScrollView(
headerSliverBuilder: (context, value) {
var gridItems = Material(
color: Colors.white,
clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(8.w),
child: GridView(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
childAspectRatio: 1,
),
shrinkWrap: true,
children:
_marketModels.map((e) => CategoryCard(model: e)).toList(),
),
];
}
Widget _buildTitle() {
final appProvider = Provider.of<AppProvider>(context);
double iconSize = 18.w;
MaterialButton ges = MaterialButton(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
height: 74.w,
shape: StadiumBorder(),
elevation: 0,
minWidth: double.infinity,
color: Colors.white,
onPressed: () {
Get.to(() => BeeSearch());
},
child: Row(
children: [
Icon(
Icons.search,
size: 32.w,
color: Color(0xFF666666),
),
);
return [
SliverAppBar(
//AppBar top Widget height
//bottom height: 48
// flexibleSpace ( - )/4*2 + + bottom + top
// *
//expandedHeight:
//(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w,
//
expandedHeight: (mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2,
backgroundColor: Colors.transparent,
elevation: 0,
flexibleSpace: FlexibleSpaceBar(
background: Container(
color: Color(0xFFF9F9F9),
padding: EdgeInsets.only(
top: 16.w,
left: 32.w,
right: 32.w,
bottom: 16.w, //bottom
),
child: Column(
10.wb,
'请输入关键字'.text.size(28.sp).color(ktextSubColor).make().expand(),
],
),
);
return Container(
height: kToolbarHeight,
// child: ges,
//color: Colors.blue,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children:[
Container(
height: 40.w,
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(
// height: 58.w,
// child: Row(
// children: [
// Text(
// '热搜:',
// style: TextStyle(
// fontSize: 20.sp,
// ),
// ),
// 20.wb,
// ListView.separated(
// scrollDirection: Axis.horizontal,
// separatorBuilder: (_, __) => 20.wb,
// itemBuilder: (context, index) {
// final item = _hotItems[index];
// return MaterialButton(
// padding:
// EdgeInsets.symmetric(horizontal: 40.w),
// minWidth: 0,
// shape: StadiumBorder(
// side: BorderSide(
// color: ktextSubColor,
// width: 1,
// ),
// ),
// materialTapTargetSize:
// MaterialTapTargetSize.shrinkWrap,
// onPressed: () {
// Get.to(() => GoodsDetailPage(id: item.id));
// },
// child: Text(
// item.title,
// style: TextStyle(
// color: ktextSubColor,
// ),
// ),
// );
// },
// itemCount: _hotItems.length,
// ).expand(),
// ],
// ),
// ),
// 10.hb,
gridItems.expand(),
],
),
),
),
pinned: true,
toolbarHeight: 0,
// bottom: PreferredSize(
// child: Material(
// color: Color(0xFFF9F9F9),
// child: Align(
// alignment: Alignment.centerLeft,
// child: BeeTabBar(
// scrollable: true,
// controller: _tabController,
// tabs: ['社区商城', '二手市场'],
// ),
// ),
// ),
// preferredSize: Size.fromHeight(48),
// ),
if (appProvider.location != null)
Padding(
padding:EdgeInsets.only(right: 5.w),
child: Image.asset(
R.ASSETS_ICONS_SHOP_LOCATION_PNG,
width: 48.w,
height: 48.w,
//color: Colors.white,
),
),
Text(
appProvider.location?['city']==null?'':appProvider.location?['city'] as String? ?? '',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 28.sp,
color: Colors.white,
),
//textAlign: TextAlign.center,
),
]),
// Expanded(
// child: ges,
// )
],
),
];
},
body: EasyRefresh(
firstRefresh: false,
enableControlFinishLoad: false,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _refreshController,
onRefresh: () async {
_pageNum = 1;
await updateMarketInfo();
setState(() {});
},
onLoad: () async {
_pageNum++;
await loadMarketInfo();
if (_pageCount <= _pageNum) {
_refreshController.finishLoad(noMore: false);
}
setState(() {});
},
child: WaterfallFlow.builder(
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
final item = _hotItems[index];
return GoodsCard(item: item);
},
itemCount: _hotItems.length,
// child: ges,
),
// 20.hb,
//ges,
],
),
);
}
FlexibleSpaceBar _flexibleSpaceBar(context) {
return FlexibleSpaceBar(
collapseMode: CollapseMode.pin,
background: Container(
//
height: double.infinity,
color: Color(0xFFF9F9F9),
// color: Colors.white,
child: Stack(
children: <Widget>[
AnimatedHomeBackground(
key: _animatedBackgroundState,
height: 530.w,
backgroundColor: Colors.white ,
),
Column(
children: <Widget>[
// Container(
// color: Colors.blue,
// width: 300,
// height: 300,
// ),
// HomeWeatherWidget(
// backgroundColor: Colors.white.withAlpha(0),
// homeWeatherModel: _homeWeatherModel,
// ),
// _bannerView(),
// _buildGoodsCards(),
// kingCoinListModelList != null
// ? _buttonTitle(context)
// : SizedBox(),
// _activityImageTitle(),
// _activityImageRow(),
// _activityT4Image(),
// HomeCountdownWidget(
// height: timeHeight,
// controller: _homeCountdownController,
// promotionList: _promotionList,
// ),
],
),
],
)),
);
}
_goodsTitle(){
return Container(
height: 90.w,
alignment: Alignment.centerLeft,
color: Color(0xFFF9F9F9),
width: MediaQuery.of(context).size.width,
child: Container(
alignment: Alignment.centerLeft,
height: 60.w,
child: TabBar(
onTap: (index) {
// _presenter.fetchList(_category.id, 0, _sortType);
setState(() {});
},
isScrollable: true,
labelPadding: EdgeInsets.zero,
controller: _tabController,
labelColor: Color(0xFFF9F9F9),
indicatorPadding: EdgeInsets.symmetric(horizontal: 40.w),
indicatorSize: TabBarIndicatorSize.label,
unselectedLabelColor: Colors.black54,
labelStyle: TextStyle(color: Colors.black54),
indicatorColor: Color(0xFFE52E2E),
tabs: _tabItems()),
),
);
}
List<Widget> _tabItems() {
return [_tabItem(0,'综合推荐'),_tabItem(1,'销量'),_tabItem(2,'价格')];
}
_tabItem(int index,String text) {
bool isChoose = index == _tabController.index;
// Color textColor = index == _tabController.index
// ? getCurrentThemeColor()
// : Colors.black.withOpacity(0.9);
return Tab(
child: Container(
alignment: Alignment.center,
width: 150.w,
// color: Colors.white,
color: Color(0xFFF9F9F9),
padding: EdgeInsets.only(left: 10.w, right: 10.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
text,
style: TextStyle(
fontWeight: isChoose?FontWeight.bold:FontWeight.normal,
fontSize: isChoose?32.sp:28.sp,
color: isChoose?Color(0xFF000000):Color(0xFF666666)),
),
],
),
),
);

@ -0,0 +1,300 @@
// import 'package:aku_community/base/base_style.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/market/display_category_model.dart';
import 'package:aku_community/models/market/goods_item.dart';
import 'package:aku_community/models/market/market_category_model.dart';
import 'package:aku_community/ui/market/category/category_card.dart';
import 'package:aku_community/ui/market/category/category_page.dart';
import 'package:aku_community/ui/market/goods/goods_card.dart';
import 'package:aku_community/ui/market/order/my_order_page.dart';
import 'package:aku_community/ui/market/search/search_goods_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/utils/network/base_list_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
// import 'package:aku_community/ui/market/goods/goods_detail_page.dart';
// import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart';
class MarketPage111 extends StatefulWidget {
MarketPage111({Key? key}) : super(key: key);
@override
_MarketPageState createState() => _MarketPageState();
}
class _MarketPageState extends State<MarketPage111>
with AutomaticKeepAliveClientMixin {
List<MarketCategoryModel> _marketModels = [];
List<GoodsItem> _hotItems = [];
late EasyRefreshController _refreshController;
int _pageNum = 1;
int _size = 4;
int _pageCount = 0;
Future updateMarketInfo() async {
BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: {
"pageNum": _pageNum,
"size": _size,
});
if (baseListModel.tableList!.isNotEmpty) {
_hotItems = (baseListModel.tableList as List)
.map((e) => GoodsItem.fromJson(e))
.toList();
}
_pageCount = baseListModel.pageCount!;
}
Future loadMarketInfo() async {
BaseListModel baseListModel =
await NetUtil().getList(API.market.hotTop, params: {
"pageNum": _pageNum,
"size": _size,
});
if (baseListModel.tableList!.isNotEmpty) {
_hotItems.addAll((baseListModel.tableList as List)
.map((e) => GoodsItem.fromJson(e))
.toList());
}
_pageCount = baseListModel.pageCount!;
}
@override
void initState() {
super.initState();
_refreshController = EasyRefreshController();
Future.delayed(Duration(milliseconds: 0), () async {
_marketModels = await DisplayCategoryModel.top8;
await updateMarketInfo();
setState(() {});
});
}
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
super.build(context);
final mediaWidth = MediaQuery.of(context).size.width;
return BeeScaffold(
leading: IconButton(
icon: Icon(CupertinoIcons.search),
onPressed: () {
Get.to(() => SearchGoodsPage());
},
),
title: '商城',
actions: [
MaterialButton(
minWidth: 108.w,
padding: EdgeInsets.zero,
onPressed: () async {
// Get.to(() => SecondHandPage());
Get.to(() => MyOrderPage());
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Image.asset(
R.ASSETS_ICONS_SECOND_HAND_PNG,
width: 48.w,
height: 48.w,
),
4.hb,
// '二手'.text.size(20.sp).black.make(),
'订单'.text.size(20.sp).black.make(),
],
),
),
MaterialButton(
minWidth: 108.w,
padding: EdgeInsets.zero,
onPressed: () async {
final cancel = BotToast.showLoading();
List<MarketCategoryModel> models =
await DisplayCategoryModel.fetchCategory(0);
cancel();
Get.to(() => CategoryPage(models: models));
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Image.asset(
R.ASSETS_ICONS_CATEGORY_PNG,
width: 48.w,
height: 48.w,
),
4.hb,
'分类'.text.size(20.sp).black.make(),
],
),
),
],
body:
NestedScrollView(
headerSliverBuilder: (context, value) {
var gridItems = Material(
color: Colors.white,
clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(8.w),
child: GridView(
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
childAspectRatio: 1,
),
shrinkWrap: true,
children:
_marketModels.map((e) => CategoryCard(model: e)).toList(),
),
);
return [
SliverAppBar(
//AppBar top Widget height
//bottom height: 48
// flexibleSpace ( - )/4*2 + + bottom + top
// *
//expandedHeight:
//(mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2 + 48 + 68.w,
//
expandedHeight: (mediaWidth - 32.w * 2) / 4 * 2 + 16.w * 2,
backgroundColor: Colors.transparent,
elevation: 0,
flexibleSpace: FlexibleSpaceBar(
background: Container(
color: Color(0xFFF9F9F9),
padding: EdgeInsets.only(
top: 16.w,
left: 32.w,
right: 32.w,
bottom: 16.w, //bottom
),
child: Column(
children: [
// SizedBox(
// height: 58.w,
// child: Row(
// children: [
// Text(
// '热搜:',
// style: TextStyle(
// fontSize: 20.sp,
// ),
// ),
// 20.wb,
// ListView.separated(
// scrollDirection: Axis.horizontal,
// separatorBuilder: (_, __) => 20.wb,
// itemBuilder: (context, index) {
// final item = _hotItems[index];
// return MaterialButton(
// padding:
// EdgeInsets.symmetric(horizontal: 40.w),
// minWidth: 0,
// shape: StadiumBorder(
// side: BorderSide(
// color: ktextSubColor,
// width: 1,
// ),
// ),
// materialTapTargetSize:
// MaterialTapTargetSize.shrinkWrap,
// onPressed: () {
// Get.to(() => GoodsDetailPage(id: item.id));
// },
// child: Text(
// item.title,
// style: TextStyle(
// color: ktextSubColor,
// ),
// ),
// );
// },
// itemCount: _hotItems.length,
// ).expand(),
// ],
// ),
// ),
// 10.hb,
gridItems.expand(),
],
),
),
),
pinned: true,
toolbarHeight: 0,
// bottom: PreferredSize(
// child: Material(
// color: Color(0xFFF9F9F9),
// child: Align(
// alignment: Alignment.centerLeft,
// child: BeeTabBar(
// scrollable: true,
// controller: _tabController,
// tabs: ['社区商城', '二手市场'],
// ),
// ),
// ),
// preferredSize: Size.fromHeight(48),
// ),
),
];
},
body: EasyRefresh(
firstRefresh: false,
enableControlFinishLoad: false,
header: MaterialHeader(),
footer: MaterialFooter(),
controller: _refreshController,
onRefresh: () async {
_pageNum = 1;
await updateMarketInfo();
setState(() {});
},
onLoad: () async {
_pageNum++;
await loadMarketInfo();
if (_pageCount <= _pageNum) {
_refreshController.finishLoad(noMore: false);
}
setState(() {});
},
child: WaterfallFlow.builder(
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 20.w,
crossAxisSpacing: 20.w,
),
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
final item = _hotItems[index];
return GoodsCard(item: item);
},
itemCount: _hotItems.length,
),
),
),
);
}
@override
bool get wantKeepAlive => true;
}

@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
class AnimatedHomeBackground extends StatefulWidget {
final double height;
final Color backgroundColor;
AnimatedHomeBackground({Key? key, required this.height, required this.backgroundColor})
: super(key: key);
@override
AnimatedHomeBackgroundState createState() => AnimatedHomeBackgroundState();
}
class AnimatedHomeBackgroundState extends State<AnimatedHomeBackground> {
late Color displayColor;
@override
void initState() {
super.initState();
displayColor = widget.backgroundColor;
}
changeColor(Color color) {
setState(() {
displayColor = color;
});
}
@override
Widget build(BuildContext context) {
return AnimatedContainer(
duration: Duration(milliseconds: 500),
height: widget.height,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(bottom: Radius.circular(64)),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
// displayColor,
// displayColor,
//Color(0xFFF8F7F8),
Color(0xFFC5483A),
Color(0xFFC24739),
],
),
),
);
}
}

@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import 'package:aku_community/provider/app_provider.dart';
import 'package:aku_community/utils/headers.dart';
class MarketAppBar extends StatefulWidget with PreferredSizeWidget {
final List<Widget>? actions;
final Widget? flexibleSpace;
final PreferredSizeWidget bottom;
MarketAppBar({Key? key,this.actions, this.flexibleSpace, required this.bottom})
: super(key: key);
@override
_MarketAppBarState createState() => _MarketAppBarState();
@override
Size get preferredSize => Size.fromHeight(530.w);
}
class _MarketAppBarState extends State<MarketAppBar> {
Color _bgColor = Colors.white;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context);
return PreferredSize(
preferredSize: Size.fromHeight(60.w),
child: AppBar(
titleSpacing: 10.0,
title: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (appProvider.location != null)
Padding(
padding: const EdgeInsets.only(right: 5),
child: Image.asset(
R.ASSETS_ICONS_SHOP_LOCATION_PNG,
width: 24.w,
height: 24.w,
),
),
Text(
appProvider.location?['city']==null?'':appProvider.location?['city'] as String? ?? '',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 28.sp,
color: Colors.white,
),
textAlign: TextAlign.center,
),
]),
backgroundColor: Colors.transparent,
actions: widget.actions,
flexibleSpace: widget.flexibleSpace,
bottom: widget.bottom,
),
);
}
}

@ -0,0 +1,20 @@
class TextUtils {
///
///
///white
static bool isEmpty(String str, {bool whiteSpace = false}) {
if (whiteSpace) {
return str == null || str.trim().length == 0;
}
return str == null || str.length == 0;
}
static bool isNotEmpty(String str, {bool whiteSpace = false}) {
return !isEmpty(str, whiteSpace: whiteSpace);
}
static bool verifyPhone(phone) {
return new RegExp("^^1\\d{10}\$").hasMatch(phone);
}
}

@ -0,0 +1,36 @@
class AlarmModel {
String? alarmNo;
String? alarmType;
String? deviceName;
String? deviceNo;
String? time;
int? type;
AlarmModel(
{this.alarmNo,
this.alarmType,
this.deviceName,
this.deviceNo,
this.time,
this.type});
AlarmModel.fromJson(Map<String, dynamic> json) {
alarmNo = json['alarmNo'];
alarmType = json['alarmType'];
deviceName = json['deviceName'];
deviceNo = json['deviceNo'];
time = json['time'];
type = json['type'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['alarmNo'] = this.alarmNo;
data['alarmType'] = this.alarmType;
data['deviceName'] = this.deviceName;
data['deviceNo'] = this.deviceNo;
data['time'] = this.time;
data['type'] = this.type;
return data;
}
}

@ -1,27 +1,32 @@
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:aku_community/extensions/num_ext.dart';
import 'package:aku_community/pages/tab_navigator.dart';
import 'package:aku_community/utils/developer_util.dart';
import 'package:aku_community/utils/headers.dart';
import 'AlarmModel.dart';
class FireDialog {
static fireAlarm(String content) async {
var json = jsonDecode(content);
AlarmModel alarmModel = AlarmModel.fromJson(json);
await Get.dialog(
CupertinoAlertDialog(
title: Text('发生火灾'),
title: getImage(alarmModel),
content: Column(
children: [
Text(content),
Text(getTitle(alarmModel)),
10.hb,
Icon(
CupertinoIcons.bell_fill,
color: Colors.red,
size: 48.w,
),
Text(getContent(alarmModel)),
],
),
actions: [
@ -41,4 +46,51 @@ class FireDialog {
barrierDismissible: false,
);
}
static String getTitle(AlarmModel alarmModel){
switch(alarmModel.type){
case 1:
return '发现火灾!请立刻组织疏散人群!';
case 2:
return '设备故障';
case 3:
return '管家端APP报警';
default:
return '';
}
}
static String getContent(AlarmModel alarmModel){
switch(alarmModel.type){
case 1:
return '${alarmModel.time},${alarmModel.deviceName}附近出现了火灾报警,请各位业主、租户保持镇静,不要慌乱,有序开始撤离!';
case 2:
return '${alarmModel.time},小区内有设备${alarmModel.deviceName}发生了报警,请物业负责人员尽快前往现场排查故障!';
case 3:
return '注意:\n${alarmModel.time},${alarmModel.deviceNo}${alarmModel.deviceName}'+
'在管家端app上点击了"一键报警",请尽快联系他沟通情况。\n'+
'${alarmModel.deviceName}联系方式:${alarmModel.alarmNo}\n'+
'如未能联系到${alarmModel.deviceName}。可择情报警'
;
default:
return '';
}
}
static Widget getImage(AlarmModel alarmModel){
switch(alarmModel.type){
case 1:
return Image.asset(R.ASSETS_ICONS_FIRE_ALARM_PNG,width: 110.w,height: 110.w,fit: BoxFit.fill,);
case 2:
return Image.asset(R.ASSETS_ICONS_DEVICE_ALARM_PNG,width: 110.w,height: 110.w,fit: BoxFit.fill,);
case 3:
return Image.asset(R.ASSETS_ICONS_APP_ALARM_PNG,width: 110.w,height: 110.w,fit: BoxFit.fill,);
default:
return SizedBox();
}
}
}

@ -0,0 +1,56 @@
import 'package:flutter/material.dart';
class HomeSliverAppBar extends StatefulWidget {
final List<Widget>? actions;
final Widget? title;
final backgroundColor;
final Widget? flexibleSpace;
final PreferredSizeWidget? bottom;
final double? expandedHeight;
HomeSliverAppBar(
{Key? key,
this.actions,
this.title,
this.backgroundColor,
this.flexibleSpace,
this.bottom,
this.expandedHeight})
: super(key: key);
@override
HomeSliverAppBarState createState() => HomeSliverAppBarState();
}
class HomeSliverAppBarState extends State<HomeSliverAppBar> {
Color _displayColor = Colors.blue;
updateColor(Color color) {
setState(() {
_displayColor = color;
});
}
@override
void initState() {
super.initState();
_displayColor = widget.backgroundColor;
}
@override
Widget build(BuildContext context) {
return SliverAppBar(
titleSpacing: 3,
actions: widget.actions,
title: widget.title,
floating: true,
pinned: true,
snap: true,
elevation: 0,
backgroundColor: _displayColor,
flexibleSpace: widget.flexibleSpace,
collapsedHeight: kToolbarHeight+10,
expandedHeight: widget.expandedHeight,
bottom: widget.bottom,
);
}
}

@ -70,7 +70,7 @@ packages:
name: async
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.6.1"
version: "2.5.0"
auto_size_text_pk:
dependency: transitive
description:
@ -1093,7 +1093,7 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
version: "1.8.0"
sp_util:
dependency: transitive
description:
@ -1163,7 +1163,7 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
version: "0.2.19"
timing:
dependency: transitive
description:

Loading…
Cancel
Save