parent
f623ea1f65
commit
7baefdc458
@ -0,0 +1,138 @@
|
||||
import 'package:aku_new_community/utils/headers.dart';
|
||||
import 'package:aku_new_community/widget/bee_divider.dart';
|
||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||
import 'package:aku_new_community/widget/buttons/bee_long_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AddAppointmentAddressPage extends StatefulWidget {
|
||||
const AddAppointmentAddressPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AddAppointmentAddressPageState createState() =>
|
||||
_AddAppointmentAddressPageState();
|
||||
}
|
||||
|
||||
class _AddAppointmentAddressPageState extends State<AddAppointmentAddressPage> {
|
||||
TextEditingController _controller = TextEditingController();
|
||||
TextEditingController _tagController = TextEditingController();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_controller.dispose();
|
||||
_tagController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '添加预约地址',
|
||||
body: SafeArea(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.all(32.w),
|
||||
child: Column(
|
||||
children: [
|
||||
//TODO:封装高德search api插件 以获取poi数据 暂时手动输入
|
||||
// GestureDetector(
|
||||
// onTap: () {},
|
||||
// child: Material(
|
||||
// color: Colors.transparent,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// width: 170.w,
|
||||
// child: '所在地'
|
||||
// .text
|
||||
// .size(28.sp)
|
||||
// .color(Colors.black.withOpacity(0.65))
|
||||
// .make(),
|
||||
// ),
|
||||
// '${S.of(context)?.tempPlotName}(默认)'
|
||||
// .text
|
||||
// .size(28.sp)
|
||||
// .color(Colors.black.withOpacity(0.65))
|
||||
// .make(),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 170.w,
|
||||
child: '标志建筑'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.make(),
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
autofocus: false,
|
||||
controller: _tagController,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '请输入标志建筑',
|
||||
contentPadding: EdgeInsets.zero,
|
||||
isDense: true,
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.black.withOpacity(0.45),
|
||||
fontSize: 28.sp,
|
||||
)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
|
||||
32.hb,
|
||||
BeeDivider.horizontal(),
|
||||
32.hb,
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 170.w,
|
||||
child: '具体地址'
|
||||
.text
|
||||
.size(28.sp)
|
||||
.color(Colors.black.withOpacity(0.65))
|
||||
.make(),
|
||||
),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
autofocus: false,
|
||||
controller: _controller,
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '请输入具体地址',
|
||||
contentPadding: EdgeInsets.zero,
|
||||
isDense: true,
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.black.withOpacity(0.45),
|
||||
fontSize: 28.sp,
|
||||
)),
|
||||
)),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
56.hb,
|
||||
BeeLongButton(
|
||||
onPressed: () {
|
||||
Get.back(result: {
|
||||
'address': _tagController.text,
|
||||
'addressDetail': _controller.text,
|
||||
});
|
||||
},
|
||||
text: '提交'),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
||||
import 'package:aku_new_community/widget/others/bee_search_text_field.dart';
|
||||
import 'package:aku_new_community/widget/others/user_tool.dart';
|
||||
import 'package:amap_flutter_base/amap_flutter_base.dart';
|
||||
import 'package:amap_flutter_map/amap_flutter_map.dart';
|
||||
// import 'package:amap_search_fluttify/amap_search_fluttify.dart' as search;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
class LocationView extends StatefulWidget {
|
||||
const LocationView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_LocationViewState createState() => _LocationViewState();
|
||||
}
|
||||
|
||||
class _LocationViewState extends State<LocationView> {
|
||||
AMapController? _mapController;
|
||||
var poiList = [];
|
||||
LatLng? _target;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Future.delayed(Duration(seconds: 0), () async {
|
||||
var location = await Permission.locationWhenInUse.isGranted;
|
||||
if (!location) {
|
||||
await Permission.locationWhenInUse.request();
|
||||
}
|
||||
_target = LatLng(
|
||||
(UserTool.appProveider.location?['latitude'] ?? 0) as double,
|
||||
(UserTool.appProveider.location?['longitude'] ?? 0) as double,
|
||||
);
|
||||
// poiList = await search.AmapSearch.instance.searchAround(search.LatLng(
|
||||
// (UserTool.appProveider.location?['latitude'] ?? 0) as double,
|
||||
// (UserTool.appProveider.location?['longitude'] ?? 0) as double,
|
||||
// ));
|
||||
// print(poiList.length);
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: BeeSearchTextField(),
|
||||
body: Stack(
|
||||
children: [
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import 'package:aku_new_community/base/base_style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/src/extensions/string_ext.dart';
|
||||
|
||||
class BeeLongButton extends StatelessWidget {
|
||||
final VoidCallback? onPressed;
|
||||
final String text;
|
||||
const BeeLongButton({Key? key, required this.onPressed, required this.text})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
elevation: 0,
|
||||
height: 93.w,
|
||||
disabledColor: Colors.black.withOpacity(0.06),
|
||||
disabledTextColor: Colors.black.withOpacity(0.25),
|
||||
textColor: Colors.black.withOpacity(0.85),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(65.w)),
|
||||
color: kPrimaryColor,
|
||||
onPressed: onPressed,
|
||||
child: text.text.size(32.sp).bold.make(),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue