parent
c5feb7e9b7
commit
11172fd6a2
@ -1,73 +0,0 @@
|
||||
import 'package:aku_new_community/base/base_style.dart';
|
||||
import 'package:aku_new_community/const/resource.dart';
|
||||
import 'package:aku_new_community/constants/api.dart';
|
||||
import 'package:aku_new_community/constants/saas_api.dart';
|
||||
import 'package:aku_new_community/model/common/img_model.dart';
|
||||
import 'package:aku_new_community/models/geographic_information/geographic_information_model.dart';
|
||||
import 'package:aku_new_community/utils/network/base_model.dart';
|
||||
import 'package:aku_new_community/utils/network/net_util.dart';
|
||||
import 'package:aku_new_community/widget/bee_scaffold.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';
|
||||
|
||||
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 = true;
|
||||
|
||||
@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.success && 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: SAASAPI.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),
|
||||
)),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
@ -1,73 +1,70 @@
|
||||
import 'package:aku_new_community/base/base_style.dart';
|
||||
import 'package:aku_new_community/const/resource.dart';
|
||||
import 'package:aku_new_community/constants/api.dart';
|
||||
import 'package:aku_new_community/constants/saas_api.dart';
|
||||
import 'package:aku_new_community/model/common/img_model.dart';
|
||||
import 'package:aku_new_community/models/geographic_information/geographic_information_model.dart';
|
||||
import 'package:aku_new_community/utils/network/base_model.dart';
|
||||
import 'package:aku_new_community/pages/one_alarm/alarm_detail_page.dart';
|
||||
import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart';
|
||||
import 'package:aku_new_community/provider/app_provider.dart';
|
||||
import 'package:aku_new_community/utils/headers.dart';
|
||||
import 'package:aku_new_community/utils/network/net_util.dart';
|
||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||
import 'package:amap_flutter_base/amap_flutter_base.dart';
|
||||
import 'package:amap_flutter_map/amap_flutter_map.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:flutter_icons/flutter_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
|
||||
class GeographicInformationPage extends StatefulWidget {
|
||||
GeographicInformationPage({
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
GeographicInformationPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_GeographicInformationPageState createState() =>
|
||||
_GeographicInformationPageState();
|
||||
_GeographicInformationPageState createState() => _GeographicInformationPageState();
|
||||
}
|
||||
|
||||
class _GeographicInformationPageState extends State<GeographicInformationPage> {
|
||||
GeographicInformationModel _model = GeographicInformationModel.init();
|
||||
bool _onload = false;
|
||||
AMapController? _mapController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
PermissionUtil.getLocationPermission();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_mapController?.disponse();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appProvider = Provider.of<AppProvider>(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.success && 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: SAASAPI.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),
|
||||
)),
|
||||
],
|
||||
),
|
||||
));
|
||||
title: '地理信息',
|
||||
body: AMapWidget(
|
||||
privacyStatement: AMapPrivacyStatement(
|
||||
hasContains: true, hasShow: true, hasAgree: true),
|
||||
onMapCreated: (controller) {
|
||||
final appProvider =
|
||||
Provider.of<AppProvider>(context, listen: false);
|
||||
LatLng _target = LatLng(
|
||||
(appProvider.location?['latitude'] ?? 0) as double,
|
||||
(appProvider.location?['longitude'] ?? 0) as double,
|
||||
);
|
||||
_mapController = controller;
|
||||
_mapController!.moveCamera(
|
||||
CameraUpdate.newCameraPosition(
|
||||
CameraPosition(target: _target, zoom: 18),
|
||||
),
|
||||
);
|
||||
},
|
||||
myLocationStyleOptions: MyLocationStyleOptions(
|
||||
true,
|
||||
circleFillColor: Theme.of(context).primaryColor.withOpacity(0.2),
|
||||
circleStrokeColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue