After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 553 B |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 5.8 KiB |
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -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),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
@ -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,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -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,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|