BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../controllers/home_parcel_controller.dart';
|
||||
import '../../controllers/theme_controller.dart';
|
||||
import '../../models/banner_model.dart';
|
||||
@@ -46,8 +46,20 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
child: Container(
|
||||
height: 42,
|
||||
width: 42,
|
||||
decoration: BoxDecoration(shape: BoxShape.circle, color: AppThemeData.grey50),
|
||||
child: Center(child: Padding(padding: const EdgeInsets.only(left: 5), child: Icon(Icons.arrow_back_ios, color: AppThemeData.grey900, size: 20))),
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppThemeData.grey50,
|
||||
),
|
||||
child: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Icon(
|
||||
Icons.arrow_back_ios,
|
||||
color: AppThemeData.grey900,
|
||||
size: 20,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -60,9 +72,21 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
Get.offAll(const LoginScreen());
|
||||
},
|
||||
child: Text("Login".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
|
||||
child: Text(
|
||||
"Login".tr(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 14,
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Text(Constant.userModel!.fullName(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
|
||||
: Text(
|
||||
Constant.userModel!.fullName(),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 14,
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
if (Constant.userModel != null) {
|
||||
@@ -75,9 +99,12 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
} else {
|
||||
Constant.checkPermission(
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
ShowToastDialog.showLoader(
|
||||
"Please wait...".tr(),
|
||||
);
|
||||
|
||||
ShippingAddress shippingAddress = ShippingAddress();
|
||||
ShippingAddress shippingAddress =
|
||||
ShippingAddress();
|
||||
|
||||
try {
|
||||
await Geolocator.requestPermission();
|
||||
@@ -85,40 +112,71 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
ShowToastDialog.closeLoader();
|
||||
|
||||
if (Constant.selectedMapType == 'osm') {
|
||||
final result = await Get.to(() => MapPickerPage());
|
||||
final result = await Get.to(
|
||||
() => MapPickerPage(),
|
||||
);
|
||||
if (result != null) {
|
||||
final firstPlace = result;
|
||||
final lat = firstPlace.coordinates.latitude;
|
||||
final lng = firstPlace.coordinates.longitude;
|
||||
final lat =
|
||||
firstPlace.coordinates.latitude;
|
||||
final lng =
|
||||
firstPlace.coordinates.longitude;
|
||||
final address = firstPlace.address;
|
||||
|
||||
shippingAddress.addressAs = "Home";
|
||||
shippingAddress.locality = address.toString();
|
||||
shippingAddress.location = UserLocation(latitude: lat, longitude: lng);
|
||||
shippingAddress.locality =
|
||||
address.toString();
|
||||
shippingAddress.location = UserLocation(
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
);
|
||||
|
||||
Constant.selectedLocation = shippingAddress;
|
||||
Constant.selectedLocation =
|
||||
shippingAddress;
|
||||
Get.back();
|
||||
}
|
||||
} else {
|
||||
Get.to(LocationPickerScreen())!.then((value) async {
|
||||
Get.to(LocationPickerScreen())!.then((
|
||||
value,
|
||||
) async {
|
||||
if (value != null) {
|
||||
SelectedLocationModel selectedLocationModel = value;
|
||||
SelectedLocationModel
|
||||
selectedLocationModel = value;
|
||||
|
||||
shippingAddress.addressAs = "Home";
|
||||
shippingAddress.location = UserLocation(latitude: selectedLocationModel.latLng!.latitude, longitude: selectedLocationModel.latLng!.longitude);
|
||||
shippingAddress.locality = "Picked from Map";
|
||||
shippingAddress
|
||||
.location = UserLocation(
|
||||
latitude:
|
||||
selectedLocationModel
|
||||
.latLng!
|
||||
.latitude,
|
||||
longitude:
|
||||
selectedLocationModel
|
||||
.latLng!
|
||||
.longitude,
|
||||
);
|
||||
shippingAddress.locality =
|
||||
"Picked from Map";
|
||||
|
||||
Constant.selectedLocation = shippingAddress;
|
||||
Constant.selectedLocation =
|
||||
shippingAddress;
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
await placemarkFromCoordinates(19.228825, 72.854118).then((valuePlaceMaker) {
|
||||
await placemarkFromCoordinates(
|
||||
19.228825,
|
||||
72.854118,
|
||||
).then((valuePlaceMaker) {
|
||||
Placemark placeMark = valuePlaceMaker[0];
|
||||
shippingAddress.location = UserLocation(latitude: 19.228825, longitude: 72.854118);
|
||||
shippingAddress.location = UserLocation(
|
||||
latitude: 19.228825,
|
||||
longitude: 72.854118,
|
||||
);
|
||||
String currentLocation =
|
||||
"${placeMark.name}, ${placeMark.subLocality}, ${placeMark.locality}, ${placeMark.administrativeArea}, ${placeMark.postalCode}, ${placeMark.country}";
|
||||
shippingAddress.locality = currentLocation;
|
||||
shippingAddress.locality =
|
||||
currentLocation;
|
||||
});
|
||||
|
||||
Constant.selectedLocation = shippingAddress;
|
||||
@@ -133,7 +191,10 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
Constant.selectedLocation.getFullAddress(),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900),
|
||||
style: AppThemeData.boldTextStyle(
|
||||
fontSize: 18,
|
||||
color: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -160,22 +221,46 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("What are you sending?".tr(), style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
|
||||
Text(
|
||||
"What are you sending?".tr(),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
color: isDark ? AppThemeData.greyDark50 : AppThemeData.grey50,
|
||||
border: Border.all(color: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark50
|
||||
: AppThemeData.grey50,
|
||||
border: Border.all(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.greyDark200
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.parcelCategory.length,
|
||||
shrinkWrap: true,
|
||||
physics: const ScrollPhysics(),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
itemBuilder: (context, index) {
|
||||
return buildItems(item: controller.parcelCategory[index], isDark: isDark);
|
||||
return buildItems(
|
||||
item: controller.parcelCategory[index],
|
||||
isDark: isDark,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -199,16 +284,36 @@ class HomeParcelScreen extends StatelessWidget {
|
||||
if (Constant.userModel == null) {
|
||||
Get.to(const LoginScreen());
|
||||
} else {
|
||||
Get.to(const BookParcelScreen(), arguments: {'parcelCategory': item});
|
||||
Get.to(
|
||||
const BookParcelScreen(),
|
||||
arguments: {'parcelCategory': item},
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
NetworkImageWidget(imageUrl: item.image ?? '', height: 38, width: 38),
|
||||
NetworkImageWidget(
|
||||
imageUrl: item.image ?? '',
|
||||
height: 38,
|
||||
width: 38,
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Expanded(child: Text(item.title ?? '', style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16))),
|
||||
Icon(Icons.arrow_forward_ios, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800, size: 20),
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.title ?? '',
|
||||
style: AppThemeData.semiBoldTextStyle(
|
||||
color:
|
||||
isDark ? AppThemeData.greyDark900 : AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800,
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -256,7 +361,13 @@ class BannerView extends StatelessWidget {
|
||||
final banner = bannerList[index];
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
child: SizedBox(width: MediaQuery.of(context).size.width * 0.8, child: NetworkImageWidget(imageUrl: banner.photo ?? '', fit: BoxFit.cover)),
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: banner.photo ?? '',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
@@ -266,7 +377,18 @@ class BannerView extends StatelessWidget {
|
||||
return Row(
|
||||
children: List.generate(bannerList.length, (index) {
|
||||
bool isSelected = currentPage.value == index;
|
||||
return Expanded(child: Container(height: 4, decoration: BoxDecoration(color: isSelected ? AppThemeData.grey300 : AppThemeData.grey100, borderRadius: BorderRadius.circular(5))));
|
||||
return Expanded(
|
||||
child: Container(
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isSelected
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey100,
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user