implements google map
This commit is contained in:
436
lib/src/ui/map/google_map.dart
Normal file
436
lib/src/ui/map/google_map.dart
Normal file
@@ -0,0 +1,436 @@
|
||||
// // import 'package:flutter/material.dart';
|
||||
// // import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
// // import 'package:geolocator/geolocator.dart';
|
||||
// // import 'package:geocoding/geocoding.dart';
|
||||
|
||||
// // class MapScreen extends StatefulWidget {
|
||||
// // @override
|
||||
// // _MapScreenState createState() => _MapScreenState();
|
||||
// // }
|
||||
|
||||
// // class _MapScreenState extends State<MapScreen> {
|
||||
// // late GoogleMapController mapController;
|
||||
// // LatLng _selectedLocation = LatLng(20.5937, 78.9629); // Default: India
|
||||
// // String _address = "Select a location";
|
||||
// // String _pincode = "";
|
||||
|
||||
// // @override
|
||||
// // void initState() {
|
||||
// // super.initState();
|
||||
// // _determinePosition();
|
||||
// // }
|
||||
|
||||
// // // Get current location
|
||||
// // Future<void> _determinePosition() async {
|
||||
// // LocationPermission permission = await Geolocator.requestPermission();
|
||||
// // if (permission == LocationPermission.denied) {
|
||||
// // return;
|
||||
// // }
|
||||
// // Position position = await Geolocator.getCurrentPosition();
|
||||
// // setState(() {
|
||||
// // _selectedLocation = LatLng(position.latitude, position.longitude);
|
||||
// // });
|
||||
// // _getAddressFromLatLng(position.latitude, position.longitude);
|
||||
// // }
|
||||
|
||||
// // // Get Address from LatLng
|
||||
// // Future<void> _getAddressFromLatLng(double lat, double lng) async {
|
||||
// // try {
|
||||
// // List<Placemark> placemarks = await placemarkFromCoordinates(lat, lng);
|
||||
// // Placemark place = placemarks[0];
|
||||
// // setState(() {
|
||||
// // _address =
|
||||
// // "${place.street}, ${place.locality}, ${place.administrativeArea}";
|
||||
// // _pincode = place.postalCode ?? "";
|
||||
// // });
|
||||
// // } catch (e) {
|
||||
// // print(e);
|
||||
// // }
|
||||
// // }
|
||||
|
||||
// // // On map tapped
|
||||
// // void _onMapTapped(LatLng tappedPoint)
|
||||
// // {
|
||||
// // setState(()
|
||||
// // {
|
||||
// // _selectedLocation = tappedPoint;
|
||||
// // });
|
||||
// // _getAddressFromLatLng(tappedPoint.latitude, tappedPoint.longitude);
|
||||
// // }
|
||||
|
||||
// // @override
|
||||
// // Widget build(BuildContext context) {
|
||||
// // return Scaffold(
|
||||
// // appBar: AppBar(title: Text("Pick Location")),
|
||||
// // body: Column(
|
||||
// // children: [
|
||||
// // Expanded(
|
||||
// // child: GoogleMap(
|
||||
// // initialCameraPosition: CameraPosition(
|
||||
// // target: _selectedLocation,
|
||||
// // zoom: 5,
|
||||
// // ),
|
||||
// // onMapCreated: (controller) {
|
||||
// // mapController = controller;
|
||||
// // },
|
||||
// // markers: {
|
||||
// // Marker(
|
||||
// // markerId: MarkerId("selectedLocation"),
|
||||
// // position: _selectedLocation,
|
||||
// // )
|
||||
// // },
|
||||
// // onTap: _onMapTapped,
|
||||
// // ),
|
||||
// // ),
|
||||
// // Container(
|
||||
// // padding: EdgeInsets.all(16),
|
||||
// // decoration: BoxDecoration(
|
||||
// // color: Colors.white,
|
||||
// // boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 10)],
|
||||
// // ),
|
||||
// // child: Column(
|
||||
// // crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// // children: [
|
||||
// // Text("Selected Address:",
|
||||
// // style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
// // SizedBox(height: 5),
|
||||
// // Text(_address, style: TextStyle(fontSize: 16)),
|
||||
// // SizedBox(height: 10),
|
||||
// // TextField(
|
||||
// // decoration: InputDecoration(labelText: "Enter Pincode"),
|
||||
// // onChanged: (value) {
|
||||
// // setState(()
|
||||
// // {
|
||||
// // _pincode = value;
|
||||
// // });
|
||||
// // },
|
||||
// // ),
|
||||
// // SizedBox(height: 10),
|
||||
// // ElevatedButton(
|
||||
// // onPressed: ()
|
||||
// // {
|
||||
// // Navigator.pop(context,
|
||||
// // {
|
||||
// // "location": _selectedLocation,
|
||||
// // "address": _address,
|
||||
// // "pincode": _pincode
|
||||
// // });
|
||||
// // },
|
||||
// // child: Text("Confirm Location"),
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
// // ),
|
||||
// // ],
|
||||
// // ),
|
||||
// // );
|
||||
// // }
|
||||
// // }
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
|
||||
class MapScreen extends StatefulWidget {
|
||||
@override
|
||||
_MapScreenState createState() => _MapScreenState();
|
||||
}
|
||||
|
||||
class _MapScreenState extends State<MapScreen> {
|
||||
late GoogleMapController mapController;
|
||||
LatLng _selectedLocation = LatLng(20.5937, 78.9629); // Default: India
|
||||
String _address = "Fetching current location...";
|
||||
String _pincode = "";
|
||||
TextEditingController _pincodeController = TextEditingController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_determinePosition();
|
||||
}
|
||||
|
||||
// Get current location
|
||||
Future<void> _determinePosition() async {
|
||||
bool serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
LocationPermission permission = await Geolocator.requestPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
return;
|
||||
}
|
||||
|
||||
Position position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.low,
|
||||
);
|
||||
LatLng currentLatLng = LatLng(position.latitude, position.longitude);
|
||||
|
||||
setState(() {
|
||||
_selectedLocation = currentLatLng;
|
||||
});
|
||||
|
||||
_getAddressFromLatLng(position.latitude, position.longitude);
|
||||
}
|
||||
|
||||
// Get Address from LatLng
|
||||
Future<void> _getAddressFromLatLng(double lat, double lng) async {
|
||||
try {
|
||||
List<Placemark> placemarks = await placemarkFromCoordinates(lat, lng);
|
||||
Placemark place = placemarks.first;
|
||||
setState(() {
|
||||
_address =
|
||||
"${place.street}, ${place.locality}, ${place.administrativeArea}";
|
||||
_pincode = place.postalCode ?? "";
|
||||
_pincodeController.text = _pincode;
|
||||
|
||||
print(
|
||||
"jhsjhdfjdsgf ${place.street}, ${place.locality}, ${place.administrativeArea} ${place.postalCode} ${place.subLocality} ${place.name} ${place.subAdministrativeArea}");
|
||||
});
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
}
|
||||
|
||||
// On map tapped
|
||||
void _onMapTapped(LatLng tappedPoint) {
|
||||
setState(() {
|
||||
_selectedLocation = tappedPoint;
|
||||
});
|
||||
_getAddressFromLatLng(tappedPoint.latitude, tappedPoint.longitude);
|
||||
}
|
||||
|
||||
// Update location based on entered pincode
|
||||
Future<void> _updateLocationFromPincode(String enteredPincode) async {
|
||||
if (enteredPincode.isEmpty) return;
|
||||
|
||||
try {
|
||||
List<Location> locations = await locationFromAddress(enteredPincode);
|
||||
if (locations.isNotEmpty) {
|
||||
Location location = locations.first;
|
||||
LatLng newLatLng = LatLng(location.latitude, location.longitude);
|
||||
|
||||
setState(() {
|
||||
_selectedLocation = newLatLng;
|
||||
});
|
||||
|
||||
_getAddressFromLatLng(location.latitude, location.longitude);
|
||||
mapController.animateCamera(CameraUpdate.newLatLng(newLatLng));
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error fetching location from pincode: $e");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text("Pick Location")),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: GoogleMap(
|
||||
initialCameraPosition: CameraPosition(
|
||||
target: _selectedLocation,
|
||||
zoom: 14,
|
||||
),
|
||||
onMapCreated: (controller) {
|
||||
mapController = controller;
|
||||
},
|
||||
markers: {
|
||||
Marker(
|
||||
markerId: MarkerId("selectedLocation"),
|
||||
position: _selectedLocation,
|
||||
)
|
||||
},
|
||||
onTap: _onMapTapped,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 10)],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Selected Address:",
|
||||
style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 5),
|
||||
Text(_address, style: TextStyle(fontSize: 16)),
|
||||
SizedBox(height: 10),
|
||||
TextField(
|
||||
controller: _pincodeController,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
labelText: "Enter Pincode",
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_pincode = value;
|
||||
});
|
||||
},
|
||||
onSubmitted:
|
||||
_updateLocationFromPincode, // Auto-update on enter
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context, {
|
||||
"location": _selectedLocation,
|
||||
"address": _address,
|
||||
"pincode": _pincode
|
||||
});
|
||||
},
|
||||
child: Text("Confirm Location"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// import 'dart:convert';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:geolocator/geolocator.dart';
|
||||
// import 'package:http/http.dart' as http;
|
||||
|
||||
// const String googleApiKey = "AIzaSyAi3_Dls63iGs7Nccgdm-4FkS0rhT03-4U"; // Replace with your API key
|
||||
|
||||
// class LocationScreen extends StatefulWidget {
|
||||
// @override
|
||||
// _LocationScreenState createState() => _LocationScreenState();
|
||||
// }
|
||||
|
||||
// class _LocationScreenState extends State<LocationScreen> {
|
||||
// String _address = "Fetching location...";
|
||||
// String _roadName = "";
|
||||
// String _colony = "";
|
||||
// String _buildingName = "";
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// _fetchCurrentLocation();
|
||||
// }
|
||||
|
||||
// // Fetch Current Location
|
||||
// Future<void> _fetchCurrentLocation() async {
|
||||
// try {
|
||||
// Position position = await Geolocator.getCurrentPosition(
|
||||
// desiredAccuracy: LocationAccuracy.bestForNavigation, // High Accuracy
|
||||
// );
|
||||
// _getAddressFromLatLng(position.latitude, position.longitude);
|
||||
// } catch (e) {
|
||||
// print("Error fetching location: $e");
|
||||
// setState(() {
|
||||
// _address = "Failed to get location.";
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Get Address from Latitude and Longitude
|
||||
// Future<void> _getAddressFromLatLng(double lat, double lng) async {
|
||||
// final String url =
|
||||
// "https://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$lng&key=$googleApiKey";
|
||||
|
||||
// try {
|
||||
// final response = await http.get(Uri.parse(url));
|
||||
|
||||
// if (response.statusCode == 200) {
|
||||
// final data = json.decode(response.body);
|
||||
// if (data["status"] == "OK") {
|
||||
// var result = data["results"][0]; // First result is most accurate
|
||||
|
||||
// String formattedAddress = result["formatted_address"];
|
||||
// List components = result["address_components"];
|
||||
|
||||
// String roadName = "";
|
||||
// String colony = "";
|
||||
// String buildingName = "";
|
||||
|
||||
// for (var component in components) {
|
||||
// List types = component["types"];
|
||||
// if (types.contains("route")) {
|
||||
// roadName = component["long_name"]; // Road Name
|
||||
// } else if (types.contains("sublocality_level_1") || types.contains("locality")) {
|
||||
// colony = component["long_name"]; // Colony Name
|
||||
// } else if (types.contains("premise") || types.contains("street_number")) {
|
||||
// buildingName = component["long_name"]; // Building Name
|
||||
// }
|
||||
// }
|
||||
|
||||
// setState(() {
|
||||
// _address = formattedAddress;
|
||||
// _roadName = roadName;
|
||||
// _colony = colony;
|
||||
// _buildingName = buildingName;
|
||||
// });
|
||||
|
||||
// print("Full Address: $formattedAddress");
|
||||
// print("Road Name: $roadName");
|
||||
// print("Colony: $colony");
|
||||
// print("Building Name: $buildingName");
|
||||
// } else {
|
||||
// setState(() {
|
||||
// _address = "No address found";
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
// setState(() {
|
||||
// _address = "Failed to fetch address";
|
||||
// });
|
||||
// }
|
||||
// } catch (e) {
|
||||
// print("Error fetching address: $e");
|
||||
// setState(() {
|
||||
// _address = "Error fetching address";
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(title: Text("Location Details")),
|
||||
// body: Padding(
|
||||
// padding: const EdgeInsets.all(16.0),
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text("Full Address:", style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
// Text(_address, style: TextStyle(fontSize: 16)),
|
||||
// SizedBox(height: 10),
|
||||
|
||||
// Text("Road Name:", style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
// Text(_roadName, style: TextStyle(fontSize: 16)),
|
||||
// SizedBox(height: 10),
|
||||
|
||||
// Text("Colony:", style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
// Text(_colony, style: TextStyle(fontSize: 16)),
|
||||
// SizedBox(height: 10),
|
||||
|
||||
// Text("Building Name:", style: TextStyle(fontWeight: FontWeight.bold)),
|
||||
// Text(_buildingName, style: TextStyle(fontSize: 16)),
|
||||
// SizedBox(height: 20),
|
||||
|
||||
// ElevatedButton(
|
||||
// onPressed: _fetchCurrentLocation,
|
||||
// child: Text("Refresh Location"),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@@ -1,177 +1,177 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:grocery_app/utils/constants/assets_constant.dart';
|
||||
import 'package:grocery_app/utils/constants/color_constant.dart';
|
||||
import 'package:grocery_app/utils/extensions/uicontext.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_svg/flutter_svg.dart';
|
||||
// import 'package:grocery_app/utils/constants/assets_constant.dart';
|
||||
// import 'package:grocery_app/utils/constants/color_constant.dart';
|
||||
// import 'package:grocery_app/utils/extensions/uicontext.dart';
|
||||
// import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
|
||||
class MapScreen extends StatefulWidget {
|
||||
const MapScreen({super.key});
|
||||
// class MapScreen extends StatefulWidget {
|
||||
// const MapScreen({super.key});
|
||||
|
||||
@override
|
||||
State<MapScreen> createState() => _MapScreenState();
|
||||
}
|
||||
// @override
|
||||
// State<MapScreen> createState() => _MapScreenState();
|
||||
// }
|
||||
|
||||
class _MapScreenState extends State<MapScreen> {
|
||||
final cSearch = TextEditingController();
|
||||
// class _MapScreenState extends State<MapScreen> {
|
||||
// final cSearch = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
leading: Center(
|
||||
child: SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
APPASSETS.back,
|
||||
height: 20,
|
||||
width: 20,
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
title: const Text(
|
||||
"Confirm Delivery Location",
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.grey.withOpacity(0.4),
|
||||
child: const Center(
|
||||
child: Text("Map"),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 15,
|
||||
left: 15,
|
||||
right: 15,
|
||||
child: Container(
|
||||
height: 50,
|
||||
width: MediaQuery.sizeOf(context).width,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
child: TextFormField(
|
||||
controller: cSearch,
|
||||
onChanged: (c) {
|
||||
setState(() {});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
fillColor: Colors.transparent,
|
||||
prefixIcon: Icon(MdiIcons.magnify),
|
||||
hintText: 'Search',
|
||||
hintStyle: context.customRegular(APPCOLOR.grey666666, 18),
|
||||
isCollapsed: true,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12, horizontal: 10),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
floatingActionButton: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 80),
|
||||
child: FloatingActionButton(
|
||||
backgroundColor: Colors.transparent,
|
||||
elevation: 0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: APPCOLOR.lightGreen,
|
||||
),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
MdiIcons.crosshairsGps,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
bottomSheet: Container(
|
||||
height: 205,
|
||||
decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(15), topRight: Radius.circular(15))),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(15),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 2,
|
||||
width: 50,
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 15,
|
||||
),
|
||||
Text(
|
||||
"Select Location",
|
||||
style: context.customExtraBold(Colors.black, 18),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
const Text("4517 wasington Ave, wasington, Manchester, Kettucy, 369525"),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return const MapScreen();
|
||||
},
|
||||
));
|
||||
},
|
||||
child: Container(
|
||||
height: 50,
|
||||
decoration: BoxDecoration(color: APPCOLOR.lightGreen, borderRadius: BorderRadius.circular(10)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
),
|
||||
Text(
|
||||
"Add New Address",
|
||||
style: context.customMedium(Colors.white, 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return Scaffold(
|
||||
// appBar: AppBar(
|
||||
// centerTitle: true,
|
||||
// leading: Center(
|
||||
// child: SizedBox(
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context).pop();
|
||||
// },
|
||||
// child: SvgPicture.asset(
|
||||
// APPASSETS.back,
|
||||
// height: 20,
|
||||
// width: 20,
|
||||
// )
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// title: const Text(
|
||||
// "Confirm Delivery Location",
|
||||
// style: TextStyle(
|
||||
// fontSize: 20,
|
||||
// fontWeight: FontWeight.w700,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// body: Stack(
|
||||
// children: [
|
||||
// Container(
|
||||
// color: Colors.grey.withOpacity(0.4),
|
||||
// child: const Center(
|
||||
// child: Text("Map"),
|
||||
// ),
|
||||
// ),
|
||||
// Positioned(
|
||||
// top: 15,
|
||||
// left: 15,
|
||||
// right: 15,
|
||||
// child: Container(
|
||||
// height: 50,
|
||||
// width: MediaQuery.sizeOf(context).width,
|
||||
// decoration: BoxDecoration(
|
||||
// color: Colors.white,
|
||||
// borderRadius: BorderRadius.circular(5),
|
||||
// ),
|
||||
// child: TextFormField(
|
||||
// controller: cSearch,
|
||||
// onChanged: (c) {
|
||||
// setState(() {});
|
||||
// },
|
||||
// decoration: InputDecoration(
|
||||
// border: InputBorder.none,
|
||||
// fillColor: Colors.transparent,
|
||||
// prefixIcon: Icon(MdiIcons.magnify),
|
||||
// hintText: 'Search',
|
||||
// hintStyle: context.customRegular(APPCOLOR.grey666666, 18),
|
||||
// isCollapsed: true,
|
||||
// contentPadding: const EdgeInsets.symmetric(vertical: 12, horizontal: 10),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// )
|
||||
// ],
|
||||
// ),
|
||||
// floatingActionButton: Padding(
|
||||
// padding: const EdgeInsets.only(bottom: 80),
|
||||
// child: FloatingActionButton(
|
||||
// backgroundColor: Colors.transparent,
|
||||
// elevation: 0,
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(
|
||||
// shape: BoxShape.circle,
|
||||
// color: APPCOLOR.lightGreen,
|
||||
// ),
|
||||
// child: Center(
|
||||
// child: Icon(
|
||||
// MdiIcons.crosshairsGps,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
// ),
|
||||
// bottomSheet: Container(
|
||||
// height: 205,
|
||||
// decoration: const BoxDecoration(color: Colors.white, borderRadius: BorderRadius.only(topLeft: Radius.circular(15), topRight: Radius.circular(15))),
|
||||
// width: MediaQuery.of(context).size.width,
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(15),
|
||||
// child: Column(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Container(
|
||||
// height: 2,
|
||||
// width: 50,
|
||||
// color: Colors.grey.withOpacity(0.5),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 15,
|
||||
// ),
|
||||
// Text(
|
||||
// "Select Location",
|
||||
// style: context.customExtraBold(Colors.black, 18),
|
||||
// ),
|
||||
// const SizedBox(
|
||||
// height: 20,
|
||||
// ),
|
||||
// const Text("4517 wasington Ave, wasington, Manchester, Kettucy, 369525"),
|
||||
// const SizedBox(
|
||||
// height: 20,
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: InkWell(
|
||||
// onTap: () {
|
||||
// Navigator.of(context).push(MaterialPageRoute(
|
||||
// builder: (context) {
|
||||
// return const MapScreen();
|
||||
// },
|
||||
// ));
|
||||
// },
|
||||
// child: Container(
|
||||
// height: 50,
|
||||
// decoration: BoxDecoration(color: APPCOLOR.lightGreen, borderRadius: BorderRadius.circular(10)),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
// children: [
|
||||
// const Icon(
|
||||
// Icons.add,
|
||||
// color: Colors.white,
|
||||
// ),
|
||||
// Text(
|
||||
// "Add New Address",
|
||||
// style: context.customMedium(Colors.white, 16),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// )),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -27,7 +27,7 @@ class _OnBoardingScreenState extends State<OnBoardingScreen> {
|
||||
|
||||
skipFunction() {
|
||||
SharedPrefUtils.setFreshInstall(isFresh: false).then(
|
||||
(value) => context.clearAndPush(routePath: MyRoutes.LOGIN, args: 0),
|
||||
(value) => context.clearAndPush(routePath: MyRoutes.BOTTOMNAV, args: 0),
|
||||
);
|
||||
|
||||
// Navigator.pushReplacement(context, MaterialPageRoute(
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'package:grocery_app/src/common_widget/network_image.dart';
|
||||
import 'package:grocery_app/src/logic/provider/home_provider.dart';
|
||||
import 'package:grocery_app/src/ui/card_checkout/card_checkout_screen.dart';
|
||||
import 'package:grocery_app/src/ui/edit_profile/edit_profile_screen.dart';
|
||||
import 'package:grocery_app/src/ui/map/google_map.dart';
|
||||
import 'package:grocery_app/src/ui/mapscreen/map_screen.dart';
|
||||
import 'package:grocery_app/src/ui/message/message_screen.dart';
|
||||
import 'package:grocery_app/src/ui/notification/notification_screen.dart';
|
||||
import 'package:grocery_app/src/ui/rating_review/rating_review_screen.dart';
|
||||
@@ -140,7 +142,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
},
|
||||
body: Column(
|
||||
children: [
|
||||
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -253,14 +254,24 @@ class _ProfileScreenState extends State<ProfileScreen> {
|
||||
title: const Text('Grocery List'),
|
||||
trailing: Icon(MdiIcons.chevronRight),
|
||||
),
|
||||
ListTile(
|
||||
onTap: () {
|
||||
Navigator.of(context).push(MaterialPageRoute(
|
||||
builder: (context) {
|
||||
return MapScreen();
|
||||
},
|
||||
));
|
||||
},
|
||||
leading: Icon(MdiIcons.basketOutline),
|
||||
title: const Text('Map List'),
|
||||
trailing: Icon(MdiIcons.chevronRight),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
InkWell(
|
||||
onTap: ()
|
||||
{
|
||||
onTap: () {
|
||||
print("fjnghkjfjghj");
|
||||
Provider.of<ProductProvider>(context, listen: false)
|
||||
.customerLogOut(context);
|
||||
|
||||
Reference in New Issue
Block a user