|
|
|
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_html/style.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
|
|
|
|
|
|
|
|
|
class AddAddressPage extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
|
_AddAddressState createState() => _AddAddressState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _AddAddressState extends State<AddAddressPage> {
|
|
|
|
|
|
|
|
|
|
void onMapCreated(controller){
|
|
|
|
|
setState(() {
|
|
|
|
|
mapController= controller;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
void _getAddressFromLatLng() {}
|
|
|
|
|
_onMapTypeButtonPressed(){}
|
|
|
|
|
_onAddMarkerButtonPressed(){}
|
|
|
|
|
|
|
|
|
|
LatLng _initialPosition;
|
|
|
|
|
GoogleMapController mapController;
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
// TODO: implement initState
|
|
|
|
|
_initialPosition = LatLng(24.662617030, 46.7334844);
|
|
|
|
|
super.initState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _onMapCreated(GoogleMapController controller) {
|
|
|
|
|
mapController = controller;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
centerTitle: true,
|
|
|
|
|
title: Text(TranslationBase.of(context).addNewAddress, style: TextStyle(color:Colors.white)),
|
|
|
|
|
backgroundColor: Colors.green,
|
|
|
|
|
),
|
|
|
|
|
body: Stack(
|
|
|
|
|
children: <Widget> [
|
|
|
|
|
GoogleMap(
|
|
|
|
|
zoomControlsEnabled: true,
|
|
|
|
|
myLocationButtonEnabled: true,
|
|
|
|
|
myLocationEnabled: true,
|
|
|
|
|
onMapCreated: _onMapCreated,
|
|
|
|
|
onCameraMove: (object) {
|
|
|
|
|
// widget.currentLat = object.target.latitude;
|
|
|
|
|
// widget.currentLong = object.target.longitude;
|
|
|
|
|
},
|
|
|
|
|
onCameraIdle: _getAddressFromLatLng,
|
|
|
|
|
padding: EdgeInsets.only(bottom: 90.0),
|
|
|
|
|
initialCameraPosition: CameraPosition(
|
|
|
|
|
target: _initialPosition,
|
|
|
|
|
zoom: 13.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// Align(
|
|
|
|
|
// alignment: Alignment.topRight,
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children:<Widget> [
|
|
|
|
|
// button(_onMapTypeButtonPressed,Icons.map),
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height:16.0,
|
|
|
|
|
// ),
|
|
|
|
|
// button(_onAddMarkerButtonPressed, Icons.add_location)
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
]
|
|
|
|
|
),
|
|
|
|
|
bottomSheet: InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (context) {
|
|
|
|
|
return AddAddressPage();
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
height: 50.0,
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
style: BorderStyle.solid,
|
|
|
|
|
width: 1.0
|
|
|
|
|
),
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
borderRadius: BorderRadius.circular(10.0)
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Text(TranslationBase.of(context).confirmLocation,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 15.0,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Widget button(Function function, IconData icon){
|
|
|
|
|
// return FloatingActionButton(
|
|
|
|
|
// onPressed: function,
|
|
|
|
|
// materialTapTargetSize: MaterialTapTargetSize.padded,
|
|
|
|
|
// backgroundColor: Colors.red,
|
|
|
|
|
// child: Icon(
|
|
|
|
|
// icon,
|
|
|
|
|
// size: 18.0,
|
|
|
|
|
// ),);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|