BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -14,8 +14,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../constant/assets.dart';
|
||||
import '../../utils/utils.dart';
|
||||
|
||||
@@ -41,7 +40,13 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 25),
|
||||
child: Text(
|
||||
"Enable Location for a Personalized Experience".tr(),
|
||||
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
@@ -49,14 +54,21 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 50),
|
||||
child: Text(
|
||||
"Allow location access to discover beauty stores and services near you.".tr(),
|
||||
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
|
||||
"Allow location access to discover beauty stores and services near you."
|
||||
.tr(),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark600
|
||||
: AppThemeData.grey600,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
borderRadius: 10.r,
|
||||
title: "Use current location".tr(),
|
||||
onPress: () async {
|
||||
Constant.checkPermission(
|
||||
@@ -66,34 +78,51 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
ShippingAddress addressModel = ShippingAddress();
|
||||
try {
|
||||
await Geolocator.requestPermission();
|
||||
Position newLocalData = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
|
||||
await placemarkFromCoordinates(newLocalData.latitude, newLocalData.longitude).then((valuePlaceMaker) {
|
||||
Position newLocalData =
|
||||
await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high,
|
||||
);
|
||||
await placemarkFromCoordinates(
|
||||
newLocalData.latitude,
|
||||
newLocalData.longitude,
|
||||
).then((valuePlaceMaker) {
|
||||
Placemark placeMark = valuePlaceMaker[0];
|
||||
addressModel.addressAs = "Home";
|
||||
addressModel.location = UserLocation(latitude: newLocalData.latitude, longitude: newLocalData.longitude);
|
||||
addressModel.location = UserLocation(
|
||||
latitude: newLocalData.latitude,
|
||||
longitude: newLocalData.longitude,
|
||||
);
|
||||
String currentLocation =
|
||||
"${placeMark.name}, ${placeMark.subLocality}, ${placeMark.locality}, ${placeMark.administrativeArea}, ${placeMark.postalCode}, ${placeMark.country}";
|
||||
addressModel.locality = currentLocation;
|
||||
});
|
||||
|
||||
Constant.selectedLocation = addressModel;
|
||||
Constant.currentLocation = await Utils.getCurrentLocation();
|
||||
Constant.currentLocation =
|
||||
await Utils.getCurrentLocation();
|
||||
|
||||
ShowToastDialog.closeLoader();
|
||||
|
||||
Get.offAll(const ServiceListScreen());
|
||||
} catch (e) {
|
||||
await placemarkFromCoordinates(19.228825, 72.854118).then((valuePlaceMaker) {
|
||||
await placemarkFromCoordinates(
|
||||
19.228825,
|
||||
72.854118,
|
||||
).then((valuePlaceMaker) {
|
||||
Placemark placeMark = valuePlaceMaker[0];
|
||||
addressModel.addressAs = "Home";
|
||||
addressModel.location = UserLocation(latitude: 19.228825, longitude: 72.854118);
|
||||
addressModel.location = UserLocation(
|
||||
latitude: 19.228825,
|
||||
longitude: 72.854118,
|
||||
);
|
||||
String currentLocation =
|
||||
"${placeMark.name}, ${placeMark.subLocality}, ${placeMark.locality}, ${placeMark.administrativeArea}, ${placeMark.postalCode}, ${placeMark.country}";
|
||||
addressModel.locality = currentLocation;
|
||||
});
|
||||
|
||||
Constant.selectedLocation = addressModel;
|
||||
Constant.currentLocation = await Utils.getCurrentLocation();
|
||||
Constant.currentLocation =
|
||||
await Utils.getCurrentLocation();
|
||||
|
||||
ShowToastDialog.closeLoader();
|
||||
|
||||
@@ -107,7 +136,7 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
borderRadius: 10.r,
|
||||
title: "Set from map".tr(),
|
||||
onPress: () async {
|
||||
Constant.checkPermission(
|
||||
@@ -117,7 +146,9 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
ShippingAddress addressModel = ShippingAddress();
|
||||
try {
|
||||
await Geolocator.requestPermission();
|
||||
await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
|
||||
await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.high,
|
||||
);
|
||||
ShowToastDialog.closeLoader();
|
||||
if (Constant.selectedMapType == 'osm') {
|
||||
final result = await Get.to(() => MapPickerPage());
|
||||
@@ -129,18 +160,29 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
|
||||
addressModel.addressAs = "Home";
|
||||
addressModel.locality = address.toString();
|
||||
addressModel.location = UserLocation(latitude: lat, longitude: lng);
|
||||
addressModel.location = UserLocation(
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
);
|
||||
Constant.selectedLocation = addressModel;
|
||||
Get.offAll(const ServiceListScreen());
|
||||
}
|
||||
} else {
|
||||
Get.to(LocationPickerScreen())!.then((value) async {
|
||||
if (value != null) {
|
||||
SelectedLocationModel selectedLocationModel = value;
|
||||
SelectedLocationModel selectedLocationModel =
|
||||
value;
|
||||
|
||||
addressModel.addressAs = "Home";
|
||||
addressModel.locality = Utils.formatAddress(selectedLocation: selectedLocationModel);
|
||||
addressModel.location = UserLocation(latitude: selectedLocationModel.latLng!.latitude, longitude: selectedLocationModel.latLng!.longitude);
|
||||
addressModel.locality = Utils.formatAddress(
|
||||
selectedLocation: selectedLocationModel,
|
||||
);
|
||||
addressModel.location = UserLocation(
|
||||
latitude:
|
||||
selectedLocationModel.latLng!.latitude,
|
||||
longitude:
|
||||
selectedLocationModel.latLng!.longitude,
|
||||
);
|
||||
Constant.selectedLocation = addressModel;
|
||||
|
||||
Get.offAll(const ServiceListScreen());
|
||||
@@ -148,10 +190,16 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
await placemarkFromCoordinates(19.228825, 72.854118).then((valuePlaceMaker) {
|
||||
await placemarkFromCoordinates(
|
||||
19.228825,
|
||||
72.854118,
|
||||
).then((valuePlaceMaker) {
|
||||
Placemark placeMark = valuePlaceMaker[0];
|
||||
addressModel.addressAs = "Home";
|
||||
addressModel.location = UserLocation(latitude: 19.228825, longitude: 72.854118);
|
||||
addressModel.location = UserLocation(
|
||||
latitude: 19.228825,
|
||||
longitude: 72.854118,
|
||||
);
|
||||
String currentLocation =
|
||||
"${placeMark.name}, ${placeMark.subLocality}, ${placeMark.locality}, ${placeMark.administrativeArea}, ${placeMark.postalCode}, ${placeMark.country}";
|
||||
addressModel.locality = currentLocation;
|
||||
@@ -181,7 +229,16 @@ class LocationPermissionScreen extends StatelessWidget {
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Text("Enter Manually location".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||
child: Text(
|
||||
"Enter Manually location".tr(),
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user