BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -9,8 +9,7 @@ import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
@@ -30,20 +29,27 @@ class AllAdvertisementScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
"Highlights for you".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: controller.advertisementList.isEmpty
|
||||
? Constant.showEmptyView(message: "Highlights for you not found.".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Highlights for you not found.".tr(),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: ListView.builder(
|
||||
@@ -51,7 +57,10 @@ class AllAdvertisementScreen extends StatelessWidget {
|
||||
itemCount: controller.advertisementList.length,
|
||||
padding: EdgeInsets.all(0),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return AdvertisementCard(controller: controller, model: controller.advertisementList[index]);
|
||||
return AdvertisementCard(
|
||||
controller: controller,
|
||||
model: controller.advertisementList[index],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -65,7 +74,11 @@ class AdvertisementCard extends StatelessWidget {
|
||||
final AdvertisementModel model;
|
||||
final AdvertisementListController controller;
|
||||
|
||||
const AdvertisementCard({super.key, required this.controller, required this.model});
|
||||
const AdvertisementCard({
|
||||
super.key,
|
||||
required this.controller,
|
||||
required this.model,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -74,9 +87,14 @@ class AdvertisementCard extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(model.vendorId!);
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
|
||||
model.vendorId!,
|
||||
);
|
||||
ShowToastDialog.closeLoader();
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: 16),
|
||||
@@ -84,7 +102,14 @@ class AdvertisementCard extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? AppThemeData.info600 : AppThemeData.surface,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: isDark ? 6 : 2, spreadRadius: 0, offset: Offset(0, isDark ? 3 : 1))],
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
blurRadius: isDark ? 6 : 2,
|
||||
spreadRadius: 0,
|
||||
offset: Offset(0, isDark ? 3 : 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -93,18 +118,32 @@ class AdvertisementCard extends StatelessWidget {
|
||||
children: [
|
||||
model.type == 'restaurant_promotion'
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
|
||||
child: NetworkImageWidget(imageUrl: model.coverImage ?? '', height: 150, width: double.infinity, fit: BoxFit.cover),
|
||||
borderRadius: BorderRadius.vertical(
|
||||
top: Radius.circular(16),
|
||||
),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: model.coverImage ?? '',
|
||||
height: 150,
|
||||
width: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
: VideoAdvWidget(url: model.video ?? '', height: 150, width: double.infinity),
|
||||
if (model.type != 'video_promotion' && model.vendorId != null && (model.showRating == true || model.showReview == true))
|
||||
: VideoAdvWidget(
|
||||
url: model.video ?? '',
|
||||
height: 150,
|
||||
width: double.infinity,
|
||||
),
|
||||
if (model.type != 'video_promotion' &&
|
||||
model.vendorId != null &&
|
||||
(model.showRating == true || model.showReview == true))
|
||||
Positioned(
|
||||
bottom: 8,
|
||||
right: 8,
|
||||
child: FutureBuilder(
|
||||
future: FireStoreUtils.getVendorById(model.vendorId!),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const SizedBox();
|
||||
} else {
|
||||
if (snapshot.hasError) {
|
||||
@@ -114,16 +153,42 @@ class AdvertisementCard extends StatelessWidget {
|
||||
} else {
|
||||
VendorModel vendorModel = snapshot.data!;
|
||||
return Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.primary600 : AppThemeData.primary50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary600
|
||||
: AppThemeData.primary50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(120),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
if (model.showRating == true) SvgPicture.asset("assets/icons/ic_star.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
if (model.showRating == true) const SizedBox(width: 5),
|
||||
if (model.showRating == true)
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppThemeData.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
if (model.showRating == true)
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${model.showRating == true ? Constant.calculateReview(reviewCount: vendorModel.reviewsCount!.toStringAsFixed(0), reviewSum: vendorModel.reviewsSum.toString()) : ''}${model.showRating == true && model.showReview == true ? ' ' : ''}${model.showReview == true ? '(${vendorModel.reviewsCount!.toStringAsFixed(0)})' : ''}",
|
||||
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -142,7 +207,15 @@ class AdvertisementCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (model.type == 'restaurant_promotion')
|
||||
ClipRRect(borderRadius: BorderRadius.circular(30), child: NetworkImageWidget(imageUrl: model.profileImage ?? '', height: 50, width: 50, fit: BoxFit.cover)),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: model.profileImage ?? '',
|
||||
height: 50,
|
||||
width: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -150,12 +223,26 @@ class AdvertisementCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
model.title ?? '',
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16, fontWeight: FontWeight.bold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
model.description ?? '',
|
||||
style: TextStyle(fontSize: 14, fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey400 : AppThemeData.grey600),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontFamily: AppThemeData.medium,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey600,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
),
|
||||
@@ -166,25 +253,74 @@ class AdvertisementCard extends StatelessWidget {
|
||||
? Obx(
|
||||
() => IconButton(
|
||||
icon:
|
||||
controller.favouriteList.where((p0) => p0.restaurantId == model.vendorId).isNotEmpty
|
||||
? SvgPicture.asset("assets/icons/ic_like_fill.svg")
|
||||
: SvgPicture.asset("assets/icons/ic_like.svg", colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey400 : AppThemeData.grey600, BlendMode.srcIn)),
|
||||
controller.favouriteList
|
||||
.where(
|
||||
(p0) =>
|
||||
p0.restaurantId == model.vendorId,
|
||||
)
|
||||
.isNotEmpty
|
||||
? SvgPicture.asset(
|
||||
"assets/icons/ic_like_fill.svg",
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
"assets/icons/ic_like.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey600,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
if (controller.favouriteList.where((p0) => p0.restaurantId == model.vendorId).isNotEmpty) {
|
||||
FavouriteModel favouriteModel = FavouriteModel(restaurantId: model.vendorId, userId: FireStoreUtils.getCurrentUid());
|
||||
controller.favouriteList.removeWhere((item) => item.restaurantId == model.vendorId);
|
||||
await FireStoreUtils.removeFavouriteRestaurant(favouriteModel);
|
||||
if (controller.favouriteList
|
||||
.where(
|
||||
(p0) => p0.restaurantId == model.vendorId,
|
||||
)
|
||||
.isNotEmpty) {
|
||||
FavouriteModel favouriteModel = FavouriteModel(
|
||||
restaurantId: model.vendorId,
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
controller.favouriteList.removeWhere(
|
||||
(item) => item.restaurantId == model.vendorId,
|
||||
);
|
||||
await FireStoreUtils.removeFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
} else {
|
||||
FavouriteModel favouriteModel = FavouriteModel(restaurantId: model.vendorId, userId: FireStoreUtils.getCurrentUid());
|
||||
FavouriteModel favouriteModel = FavouriteModel(
|
||||
restaurantId: model.vendorId,
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
controller.favouriteList.add(favouriteModel);
|
||||
await FireStoreUtils.setFavouriteRestaurant(favouriteModel);
|
||||
await FireStoreUtils.setFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.primary600 : AppThemeData.primary50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5))),
|
||||
child: Padding(padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), child: Icon(Icons.arrow_forward, size: 20, color: AppThemeData.primary300)),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary600
|
||||
: AppThemeData.primary50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.arrow_forward,
|
||||
size: 20,
|
||||
color: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ import 'package:customer/widget/my_separator.dart';
|
||||
import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
|
||||
@@ -23,12 +23,22 @@ class CouponListScreen extends StatelessWidget {
|
||||
init: CartController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Coupon Code".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
title: Text(
|
||||
"Coupon Code".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(55),
|
||||
child: Padding(
|
||||
@@ -37,23 +47,44 @@ class CouponListScreen extends StatelessWidget {
|
||||
hintText: 'Enter coupon code'.tr(),
|
||||
controller: controller.couponCodeController.value,
|
||||
suffix: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (controller.couponCodeController.value.text.isEmpty) {
|
||||
ShowToastDialog.showToast("Please enter coupon code".tr());
|
||||
if (controller
|
||||
.couponCodeController
|
||||
.value
|
||||
.text
|
||||
.isEmpty) {
|
||||
ShowToastDialog.showToast(
|
||||
"Please enter coupon code".tr(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
CouponModel? matchedCoupon = controller.couponList.firstWhereOrNull((coupon) => coupon.code!.toLowerCase() == controller.couponCodeController.value.text.toLowerCase());
|
||||
CouponModel? matchedCoupon = controller.couponList
|
||||
.firstWhereOrNull(
|
||||
(coupon) =>
|
||||
coupon.code!.toLowerCase() ==
|
||||
controller.couponCodeController.value.text
|
||||
.toLowerCase(),
|
||||
);
|
||||
if (matchedCoupon != null) {
|
||||
double couponAmount = Constant.calculateDiscount(amount: controller.subTotal.value.toString(), offerModel: matchedCoupon);
|
||||
double couponAmount = Constant.calculateDiscount(
|
||||
amount: controller.subTotal.value.toString(),
|
||||
offerModel: matchedCoupon,
|
||||
);
|
||||
|
||||
if (couponAmount < controller.subTotal.value) {
|
||||
controller.selectedCouponModel.value = matchedCoupon;
|
||||
controller.selectedCouponModel.value =
|
||||
matchedCoupon;
|
||||
controller.calculatePrice();
|
||||
Get.back();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Coupon code not applied".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Coupon code not applied".tr(),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("Invalid Coupon".tr());
|
||||
@@ -62,7 +93,14 @@ class CouponListScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
"Apply".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -76,17 +114,32 @@ class CouponListScreen extends StatelessWidget {
|
||||
itemBuilder: (context, index) {
|
||||
CouponModel couponModel = controller.couponList[index];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Container(
|
||||
height: Responsive.height(16, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10))),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(10), bottomLeft: Radius.circular(10)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(10),
|
||||
bottomLeft: Radius.circular(10),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.asset("assets/images/ic_coupon_image.png", height: Responsive.height(16, context), fit: BoxFit.fill),
|
||||
Image.asset(
|
||||
"assets/images/ic_coupon_image.png",
|
||||
height: Responsive.height(16, context),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Align(
|
||||
@@ -96,7 +149,14 @@ class CouponListScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr()}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -106,51 +166,98 @@ class CouponListScreen extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 18,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
DottedBorder(
|
||||
options: RoundedRectDottedBorderOptions(strokeWidth: 1, radius: const Radius.circular(6), color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
options: RoundedRectDottedBorderOptions(
|
||||
strokeWidth: 1,
|
||||
radius: const Radius.circular(6),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Text(
|
||||
"${couponModel.code}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Expanded(child: SizedBox(height: 10)),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
double couponAmount = Constant.calculateDiscount(amount: controller.subTotal.value.toString(), offerModel: couponModel);
|
||||
double couponAmount =
|
||||
Constant.calculateDiscount(
|
||||
amount:
|
||||
controller.subTotal.value
|
||||
.toString(),
|
||||
offerModel: couponModel,
|
||||
);
|
||||
|
||||
if (couponAmount < controller.subTotal.value) {
|
||||
controller.selectedCouponModel.value = couponModel;
|
||||
if (couponAmount <
|
||||
controller.subTotal.value) {
|
||||
controller.selectedCouponModel.value =
|
||||
couponModel;
|
||||
controller.calculatePrice();
|
||||
Get.back();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Coupon code not applied".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Coupon code not applied".tr(),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
"Tap To Apply".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200),
|
||||
MySeparator(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"${couponModel.description}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -10,8 +10,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../dash_board_screens/dash_board_screen.dart';
|
||||
|
||||
@@ -26,8 +25,14 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
init: OrderPlacingController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, centerTitle: false, titleSpacing: 0),
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
@@ -41,16 +46,41 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
Text(
|
||||
"Order Placed".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 34,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Hang tight — your items are being delivered quickly and safely!".tr(),
|
||||
"Hang tight — your items are being delivered quickly and safely!"
|
||||
.tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
@@ -60,13 +90,26 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_location.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_location.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppThemeData.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Order ID".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -75,7 +118,13 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
Text(
|
||||
controller.orderModel.value.id.toString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -90,21 +139,51 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Center(child: Image.asset("assets/images/ic_timer.gif", height: 140)),
|
||||
Center(
|
||||
child: Image.asset(
|
||||
"assets/images/ic_timer.gif",
|
||||
height: 140,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"Placing your order".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 34, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 34,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Take a moment to review your order before proceeding to checkout.".tr(),
|
||||
"Take a moment to review your order before proceeding to checkout."
|
||||
.tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
@@ -114,22 +193,42 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_location.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_location.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppThemeData.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Delivery Address".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
controller.orderModel.value.address!.getFullAddress(),
|
||||
controller.orderModel.value.address!
|
||||
.getFullAddress(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -137,7 +236,15 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
@@ -147,13 +254,27 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_book.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn), height: 22),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_book.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppThemeData.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
height: 22,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Order Summary".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -161,21 +282,47 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
const SizedBox(height: 5),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: controller.orderModel.value.products!.length,
|
||||
itemCount:
|
||||
controller
|
||||
.orderModel
|
||||
.value
|
||||
.products!
|
||||
.length,
|
||||
itemBuilder: (context, index) {
|
||||
CartProductModel cartProductModel = controller.orderModel.value.products![index];
|
||||
CartProductModel cartProductModel =
|
||||
controller
|
||||
.orderModel
|
||||
.value
|
||||
.products![index];
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"${cartProductModel.quantity} x".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 14,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${cartProductModel.name}".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 14,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -196,30 +343,39 @@ class OrderPlacingScreen extends StatelessWidget {
|
||||
child:
|
||||
controller.isPlacing.value
|
||||
? RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
borderRadius: 10.r,
|
||||
title: "Track Order".tr(),
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
fontSizes: 16,
|
||||
onPress: () async {
|
||||
if (Constant.sectionConstantModel!.serviceTypeFlag == "ecommerce-service") {
|
||||
if (Constant.sectionConstantModel!.serviceTypeFlag ==
|
||||
"ecommerce-service") {
|
||||
Get.offAll(const DashBoardEcommerceScreen());
|
||||
DashBoardEcommerceController controller = Get.put(DashBoardEcommerceController());
|
||||
DashBoardEcommerceController controller = Get.put(
|
||||
DashBoardEcommerceController(),
|
||||
);
|
||||
controller.selectedIndex.value = 3;
|
||||
} else {
|
||||
Get.offAll(const DashBoardScreen());
|
||||
DashBoardController controller = Get.put(DashBoardController());
|
||||
DashBoardController controller = Get.put(
|
||||
DashBoardController(),
|
||||
);
|
||||
controller.selectedIndex.value = 3;
|
||||
}
|
||||
},
|
||||
)
|
||||
: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
borderRadius: 10.r,
|
||||
title: "Track Order".tr(),
|
||||
height: 5.5,
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
textColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
textColor:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
fontSizes: 16,
|
||||
onPress: () async {},
|
||||
),
|
||||
|
||||
@@ -5,8 +5,7 @@ import 'package:customer/themes/round_button_fill.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../wallet_screen/wallet_screen.dart';
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ import 'package:customer/controllers/cashback_controller.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
|
||||
class CashbackOffersListScreen extends StatelessWidget {
|
||||
@@ -21,8 +20,17 @@ class CashbackOffersListScreen extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Cashback Offers".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text(
|
||||
"Cashback Offers".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
@@ -35,9 +43,18 @@ class CashbackOffersListScreen extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(16),
|
||||
margin: const EdgeInsets.symmetric(vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 6, offset: const Offset(0, 3))],
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 6,
|
||||
offset: const Offset(0, 3),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -47,25 +64,57 @@ class CashbackOffersListScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.cashbackList[index].title ?? '',
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
controller.cashbackList[index].cashbackType == 'Percent'
|
||||
controller.cashbackList[index].cashbackType ==
|
||||
'Percent'
|
||||
? "${controller.cashbackList[index].cashbackAmount}%"
|
||||
: Constant.amountShow(amount: "${controller.cashbackList[index].cashbackAmount}"),
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
: Constant.amountShow(
|
||||
amount:
|
||||
"${controller.cashbackList[index].cashbackAmount}",
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
"${"Min spent".tr()} ${Constant.amountShow(amount: "${controller.cashbackList[index].minimumPurchaseAmount ?? 0.0}")} | ${"Valid till".tr()} ${Constant.timestampToDateTime2(controller.cashbackList[index].endDate!)}",
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontSize: 14),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${"Maximum cashback up to".tr()} ${Constant.amountShow(amount: "${controller.cashbackList[index].maximumDiscount ?? 0.0}")}",
|
||||
style: TextStyle(color: isDark ? AppThemeData.primary200 : AppThemeData.primary300, fontFamily: AppThemeData.regular, fontSize: 14),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary200
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -6,8 +6,7 @@ import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:customer/utils/preferences.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import 'package:get/get.dart' hide Trans;import '../../../controllers/theme_controller.dart';
|
||||
import '../../../service/localization_service.dart';
|
||||
|
||||
class ChangeLanguageScreen extends StatelessWidget {
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
@@ -33,13 +33,18 @@ class ChatScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
controller.restaurantName.value,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
@@ -53,18 +58,28 @@ class ChatScreen extends StatelessWidget {
|
||||
controller: controller.scrollController,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemBuilder: (context, documentSnapshots, index) {
|
||||
ConversationModel inboxModel = ConversationModel.fromJson(documentSnapshots[index].data() as Map<String, dynamic>);
|
||||
return chatItemView(isDark, inboxModel.senderId == FireStoreUtils.getCurrentUid(), inboxModel);
|
||||
ConversationModel inboxModel = ConversationModel.fromJson(
|
||||
documentSnapshots[index].data() as Map<String, dynamic>,
|
||||
);
|
||||
return chatItemView(
|
||||
isDark,
|
||||
inboxModel.senderId == FireStoreUtils.getCurrentUid(),
|
||||
inboxModel,
|
||||
);
|
||||
},
|
||||
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
|
||||
onEmpty: Constant.showEmptyView(
|
||||
message: "No Conversion found".tr(),
|
||||
),
|
||||
// orderBy is compulsory to enable pagination
|
||||
query: FirebaseFirestore.instance
|
||||
.collection(
|
||||
controller.chatType.value == "Driver"
|
||||
? 'chat_driver'
|
||||
: controller.chatType.value == "Provider" || controller.chatType.value == "provider"
|
||||
: controller.chatType.value == "Provider" ||
|
||||
controller.chatType.value == "provider"
|
||||
? 'chat_provider'
|
||||
: controller.chatType.value == "worker" || controller.chatType.value == "Worker"
|
||||
: controller.chatType.value == "worker" ||
|
||||
controller.chatType.value == "Worker"
|
||||
? 'chat_worker'
|
||||
: 'chat_store',
|
||||
)
|
||||
@@ -79,7 +94,10 @@ class ChatScreen extends StatelessWidget {
|
||||
Container(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
@@ -90,7 +108,9 @@ class ChatScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
onCameraClick(context, controller);
|
||||
},
|
||||
child: SvgPicture.asset("assets/icons/ic_picture_one.svg"),
|
||||
child: SvgPicture.asset(
|
||||
"assets/icons/ic_picture_one.svg",
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
child: Padding(
|
||||
@@ -98,18 +118,39 @@ class ChatScreen extends StatelessWidget {
|
||||
child: TextField(
|
||||
textInputAction: TextInputAction.send,
|
||||
keyboardType: TextInputType.text,
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
textCapitalization:
|
||||
TextCapitalization.sentences,
|
||||
controller: controller.messageController.value,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.only(top: 3, left: 10),
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 3,
|
||||
left: 10,
|
||||
),
|
||||
focusedBorder: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
hintText: 'Type message here....'.tr(),
|
||||
),
|
||||
onSubmitted: (value) async {
|
||||
if (controller.messageController.value.text.isNotEmpty) {
|
||||
controller.sendMessage(controller.messageController.value.text, null, '', 'text');
|
||||
Timer(const Duration(milliseconds: 500), () => controller.scrollController.jumpTo(controller.scrollController.position.maxScrollExtent));
|
||||
if (controller
|
||||
.messageController
|
||||
.value
|
||||
.text
|
||||
.isNotEmpty) {
|
||||
controller.sendMessage(
|
||||
controller.messageController.value.text,
|
||||
null,
|
||||
'',
|
||||
'text',
|
||||
);
|
||||
Timer(
|
||||
const Duration(milliseconds: 500),
|
||||
() => controller.scrollController.jumpTo(
|
||||
controller
|
||||
.scrollController
|
||||
.position
|
||||
.maxScrollExtent,
|
||||
),
|
||||
);
|
||||
controller.messageController.value.clear();
|
||||
}
|
||||
},
|
||||
@@ -118,16 +159,36 @@ class ChatScreen extends StatelessWidget {
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (controller.messageController.value.text.isNotEmpty) {
|
||||
controller.sendMessage(controller.messageController.value.text, null, '', 'text');
|
||||
if (controller
|
||||
.messageController
|
||||
.value
|
||||
.text
|
||||
.isNotEmpty) {
|
||||
controller.sendMessage(
|
||||
controller.messageController.value.text,
|
||||
null,
|
||||
'',
|
||||
'text',
|
||||
);
|
||||
controller.messageController.value.clear();
|
||||
// Timer(const Duration(milliseconds: 500), () => controller.scrollController.jumpTo(controller.scrollController.position.maxScrollExtent));
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(left: 10),
|
||||
decoration: BoxDecoration(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200, borderRadius: BorderRadius.circular(30)),
|
||||
child: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_send.svg")),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: SvgPicture.asset(
|
||||
"assets/icons/ic_send.svg",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -157,23 +218,53 @@ class ChatScreen extends StatelessWidget {
|
||||
data.messageType == "text"
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12), bottomLeft: Radius.circular(12)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
bottomLeft: Radius.circular(12),
|
||||
),
|
||||
color: AppThemeData.primary300,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
child: Text(data.message.toString(), style: const TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: AppThemeData.grey50)),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
data.message.toString(),
|
||||
style: const TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: AppThemeData.grey50,
|
||||
),
|
||||
),
|
||||
)
|
||||
: data.messageType == "image"
|
||||
? ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12), bottomLeft: Radius.circular(12)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
bottomLeft: Radius.circular(12),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(FullScreenImageViewer(imageUrl: data.url!.url));
|
||||
Get.to(
|
||||
FullScreenImageViewer(
|
||||
imageUrl: data.url!.url,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Hero(tag: data.url!.url, child: NetworkImageWidget(imageUrl: data.url!.url, height: 100, width: 100, fit: BoxFit.cover)),
|
||||
child: Hero(
|
||||
tag: data.url!.url,
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: data.url!.url,
|
||||
height: 100,
|
||||
width: 100,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -183,13 +274,25 @@ class ChatScreen extends StatelessWidget {
|
||||
heroTag: data.id,
|
||||
backgroundColor: AppThemeData.primary300,
|
||||
onPressed: () {
|
||||
Get.to(FullScreenVideoViewer(heroTag: data.id.toString(), videoUrl: data.url!.url));
|
||||
Get.to(
|
||||
FullScreenVideoViewer(
|
||||
heroTag: data.id.toString(),
|
||||
videoUrl: data.url!.url,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Icon(Icons.play_arrow, color: Colors.white),
|
||||
child: const Icon(
|
||||
Icons.play_arrow,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
DateFormat('MMM d, yyyy hh:mm aa').format(DateTime.fromMillisecondsSinceEpoch(data.createdAt!.millisecondsSinceEpoch)),
|
||||
DateFormat('MMM d, yyyy hh:mm aa').format(
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
data.createdAt!.millisecondsSinceEpoch,
|
||||
),
|
||||
),
|
||||
style: const TextStyle(color: Colors.grey, fontSize: 12),
|
||||
),
|
||||
],
|
||||
@@ -201,25 +304,61 @@ class ChatScreen extends StatelessWidget {
|
||||
data.messageType == "text"
|
||||
? Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12), bottomRight: Radius.circular(12)),
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
bottomRight: Radius.circular(12),
|
||||
),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
data.message.toString(),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
child: Text(data.message.toString(), style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey100 : AppThemeData.grey800)),
|
||||
)
|
||||
: data.messageType == "image"
|
||||
? ConstrainedBox(
|
||||
constraints: const BoxConstraints(minWidth: 50, maxWidth: 200),
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: 50,
|
||||
maxWidth: 200,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12), bottomRight: Radius.circular(12)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
bottomRight: Radius.circular(12),
|
||||
),
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(FullScreenImageViewer(imageUrl: data.url!.url));
|
||||
Get.to(
|
||||
FullScreenImageViewer(
|
||||
imageUrl: data.url!.url,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Hero(tag: data.url!.url, child: NetworkImageWidget(imageUrl: data.url!.url)),
|
||||
child: Hero(
|
||||
tag: data.url!.url,
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: data.url!.url,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -230,13 +369,25 @@ class ChatScreen extends StatelessWidget {
|
||||
heroTag: data.id,
|
||||
backgroundColor: AppThemeData.primary300,
|
||||
onPressed: () {
|
||||
Get.to(FullScreenVideoViewer(heroTag: data.id.toString(), videoUrl: data.url!.url));
|
||||
Get.to(
|
||||
FullScreenVideoViewer(
|
||||
heroTag: data.id.toString(),
|
||||
videoUrl: data.url!.url,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Icon(Icons.play_arrow, color: Colors.white),
|
||||
child: const Icon(
|
||||
Icons.play_arrow,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
DateFormat('MMM d, yyyy hh:mm aa').format(DateTime.fromMillisecondsSinceEpoch(data.createdAt!.millisecondsSinceEpoch)),
|
||||
DateFormat('MMM d, yyyy hh:mm aa').format(
|
||||
DateTime.fromMillisecondsSinceEpoch(
|
||||
data.createdAt!.millisecondsSinceEpoch,
|
||||
),
|
||||
),
|
||||
style: const TextStyle(color: Colors.grey, fontSize: 12),
|
||||
),
|
||||
],
|
||||
@@ -252,9 +403,14 @@ class ChatScreen extends StatelessWidget {
|
||||
isDefaultAction: false,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
XFile? image = await controller.imagePicker.pickImage(source: ImageSource.gallery);
|
||||
XFile? image = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
);
|
||||
if (image != null) {
|
||||
Url url = await FireStoreUtils.uploadChatImageToFireStorage(File(image.path), context);
|
||||
Url url = await FireStoreUtils.uploadChatImageToFireStorage(
|
||||
File(image.path),
|
||||
context,
|
||||
);
|
||||
controller.sendMessage('', url, '', 'image');
|
||||
}
|
||||
},
|
||||
@@ -264,11 +420,22 @@ class ChatScreen extends StatelessWidget {
|
||||
isDefaultAction: false,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
XFile? galleryVideo = await controller.imagePicker.pickVideo(source: ImageSource.gallery);
|
||||
XFile? galleryVideo = await controller.imagePicker.pickVideo(
|
||||
source: ImageSource.gallery,
|
||||
);
|
||||
if (galleryVideo != null) {
|
||||
ChatVideoContainer? videoContainer = await FireStoreUtils.uploadChatVideoToFireStorage(context, File(galleryVideo.path));
|
||||
ChatVideoContainer? videoContainer =
|
||||
await FireStoreUtils.uploadChatVideoToFireStorage(
|
||||
context,
|
||||
File(galleryVideo.path),
|
||||
);
|
||||
if (videoContainer != null) {
|
||||
controller.sendMessage('', videoContainer.videoUrl, videoContainer.thumbnailUrl, 'video');
|
||||
controller.sendMessage(
|
||||
'',
|
||||
videoContainer.videoUrl,
|
||||
videoContainer.thumbnailUrl,
|
||||
'video',
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -278,9 +445,14 @@ class ChatScreen extends StatelessWidget {
|
||||
isDestructiveAction: false,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
XFile? image = await controller.imagePicker.pickImage(source: ImageSource.camera);
|
||||
XFile? image = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
);
|
||||
if (image != null) {
|
||||
Url url = await FireStoreUtils.uploadChatImageToFireStorage(File(image.path), context);
|
||||
Url url = await FireStoreUtils.uploadChatImageToFireStorage(
|
||||
File(image.path),
|
||||
context,
|
||||
);
|
||||
controller.sendMessage('', url, '', 'image');
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7,8 +7,7 @@ import 'package:customer/themes/responsive.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
@@ -25,10 +24,19 @@ class DriverInboxScreen extends StatelessWidget {
|
||||
final isDark = themeController.isDark.value;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Driver Inbox".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
title: Text(
|
||||
"Driver Inbox".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: FirestorePagination(
|
||||
//item builder type is compulsory.
|
||||
@@ -40,8 +48,12 @@ class DriverInboxScreen extends StatelessWidget {
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
|
||||
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
|
||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
|
||||
UserModel? customer = await FireStoreUtils.getUserProfile(
|
||||
inboxModel.customerId.toString(),
|
||||
);
|
||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(
|
||||
inboxModel.restaurantId.toString(),
|
||||
);
|
||||
ShowToastDialog.closeLoader();
|
||||
|
||||
Get.to(
|
||||
@@ -62,15 +74,23 @@ class DriverInboxScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 5),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: inboxModel.restaurantProfileImage.toString(),
|
||||
imageUrl:
|
||||
inboxModel.restaurantProfileImage.toString(),
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.height(6, context),
|
||||
width: Responsive.width(12, context),
|
||||
@@ -87,13 +107,29 @@ class DriverInboxScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
"${inboxModel.restaurantName}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.timestampToDate(inboxModel.createdAt!),
|
||||
Constant.timestampToDate(
|
||||
inboxModel.createdAt!,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, fontSize: 16, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -101,7 +137,14 @@ class DriverInboxScreen extends StatelessWidget {
|
||||
Text(
|
||||
"${inboxModel.lastMessage}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 14, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey200
|
||||
: AppThemeData.grey700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -116,7 +159,10 @@ class DriverInboxScreen extends StatelessWidget {
|
||||
shrinkWrap: true,
|
||||
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
|
||||
// orderBy is compulsory to enable pagination
|
||||
query: FirebaseFirestore.instance.collection('chat_driver').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
|
||||
query: FirebaseFirestore.instance
|
||||
.collection('chat_driver')
|
||||
.where("customerId", isEqualTo: FireStoreUtils.getCurrentUid())
|
||||
.orderBy('createdAt', descending: true),
|
||||
//Change types customerId
|
||||
viewType: ViewType.list,
|
||||
initialLoader: Constant.loader(),
|
||||
|
||||
@@ -10,8 +10,7 @@ import 'package:customer/widget/firebase_pagination/src/fireStore_pagination.dar
|
||||
import 'package:customer/widget/firebase_pagination/src/models/view_type.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
@@ -26,10 +25,19 @@ class RestaurantInboxScreen extends StatelessWidget {
|
||||
final isDark = themeController.isDark.value;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Store Inbox".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
title: Text(
|
||||
"Store Inbox".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: FirestorePagination(
|
||||
//item builder type is compulsory.
|
||||
@@ -41,9 +49,15 @@ class RestaurantInboxScreen extends StatelessWidget {
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
|
||||
UserModel? customer = await FireStoreUtils.getUserProfile(inboxModel.customerId.toString());
|
||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(inboxModel.restaurantId.toString());
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(restaurantUser!.vendorID.toString());
|
||||
UserModel? customer = await FireStoreUtils.getUserProfile(
|
||||
inboxModel.customerId.toString(),
|
||||
);
|
||||
UserModel? restaurantUser = await FireStoreUtils.getUserProfile(
|
||||
inboxModel.restaurantId.toString(),
|
||||
);
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
|
||||
restaurantUser!.vendorID.toString(),
|
||||
);
|
||||
ShowToastDialog.closeLoader();
|
||||
|
||||
Get.to(
|
||||
@@ -64,15 +78,23 @@ class RestaurantInboxScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 5),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: inboxModel.restaurantProfileImage.toString(),
|
||||
imageUrl:
|
||||
inboxModel.restaurantProfileImage.toString(),
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.height(6, context),
|
||||
width: Responsive.width(12, context),
|
||||
@@ -89,13 +111,29 @@ class RestaurantInboxScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
"${inboxModel.restaurantName}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.timestampToDate(inboxModel.createdAt!),
|
||||
Constant.timestampToDate(
|
||||
inboxModel.createdAt!,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, fontSize: 16, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -103,7 +141,14 @@ class RestaurantInboxScreen extends StatelessWidget {
|
||||
Text(
|
||||
"${inboxModel.lastMessage}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 14, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey200
|
||||
: AppThemeData.grey700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -118,7 +163,10 @@ class RestaurantInboxScreen extends StatelessWidget {
|
||||
shrinkWrap: true,
|
||||
onEmpty: Constant.showEmptyView(message: "No Conversion found".tr()),
|
||||
// orderBy is compulsory to enable pagination
|
||||
query: FirebaseFirestore.instance.collection('chat_store').where("customerId", isEqualTo: FireStoreUtils.getCurrentUid()).orderBy('createdAt', descending: true),
|
||||
query: FirebaseFirestore.instance
|
||||
.collection('chat_store')
|
||||
.where("customerId", isEqualTo: FireStoreUtils.getCurrentUid())
|
||||
.orderBy('createdAt', descending: true),
|
||||
//Change types customerId
|
||||
viewType: ViewType.list,
|
||||
initialLoader: Constant.loader(),
|
||||
|
||||
@@ -4,8 +4,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
|
||||
class DashBoardScreen extends StatelessWidget {
|
||||
@@ -26,12 +25,19 @@ class DashBoardScreen extends StatelessWidget {
|
||||
showUnselectedLabels: true,
|
||||
showSelectedLabels: true,
|
||||
selectedFontSize: 12,
|
||||
selectedLabelStyle: const TextStyle(fontFamily: AppThemeData.bold),
|
||||
unselectedLabelStyle: const TextStyle(fontFamily: AppThemeData.bold),
|
||||
selectedLabelStyle: const TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
unselectedLabelStyle: const TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
currentIndex: controller.selectedIndex.value,
|
||||
backgroundColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
selectedItemColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
unselectedItemColor: isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
selectedItemColor:
|
||||
isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
unselectedItemColor:
|
||||
isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||
onTap: (int index) {
|
||||
if (index == 0) {
|
||||
Get.put(DashBoardController());
|
||||
@@ -41,17 +47,71 @@ class DashBoardScreen extends StatelessWidget {
|
||||
items:
|
||||
Constant.walletSetting == false
|
||||
? [
|
||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 0,
|
||||
assetIcon: "assets/icons/ic_home.svg",
|
||||
label: 'Home'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 1,
|
||||
assetIcon: "assets/icons/ic_fav.svg",
|
||||
label: 'Favourites'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 2,
|
||||
assetIcon: "assets/icons/ic_orders.svg",
|
||||
label: 'Orders'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 3,
|
||||
assetIcon: "assets/icons/ic_profile.svg",
|
||||
label: 'Profile'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
]
|
||||
: [
|
||||
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home.svg", label: 'Home'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_fav.svg", label: 'Favourites'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet.svg", label: 'Wallet'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_orders.svg", label: 'Orders'.tr(), controller: controller),
|
||||
navigationBarItem(isDark, index: 4, assetIcon: "assets/icons/ic_profile.svg", label: 'Profile'.tr(), controller: controller),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 0,
|
||||
assetIcon: "assets/icons/ic_home.svg",
|
||||
label: 'Home'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 1,
|
||||
assetIcon: "assets/icons/ic_fav.svg",
|
||||
label: 'Favourites'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 2,
|
||||
assetIcon: "assets/icons/ic_wallet.svg",
|
||||
label: 'Wallet'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 3,
|
||||
assetIcon: "assets/icons/ic_orders.svg",
|
||||
label: 'Orders'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
navigationBarItem(
|
||||
isDark,
|
||||
index: 4,
|
||||
assetIcon: "assets/icons/ic_profile.svg",
|
||||
label: 'Profile'.tr(),
|
||||
controller: controller,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -60,7 +120,13 @@ class DashBoardScreen extends StatelessWidget {
|
||||
});
|
||||
}
|
||||
|
||||
BottomNavigationBarItem navigationBarItem(isDark, {required int index, required String label, required String assetIcon, required DashBoardController controller}) {
|
||||
BottomNavigationBarItem navigationBarItem(
|
||||
isDark, {
|
||||
required int index,
|
||||
required String label,
|
||||
required String assetIcon,
|
||||
required DashBoardController controller,
|
||||
}) {
|
||||
return BottomNavigationBarItem(
|
||||
icon: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
@@ -23,10 +23,16 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text(
|
||||
"Dine in Bookings".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
@@ -45,25 +51,55 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"${'Order'.tr()} ${Constant.orderId(orderId: controller.bookingModel.value.id.toString())}",
|
||||
style: TextStyle(fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${controller.bookingModel.value.totalGuest} ${'Peoples'.tr()}",
|
||||
style: TextStyle(fontSize: 14, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: Constant.statusColor(status: controller.bookingModel.value.status),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
color: Constant.statusColor(
|
||||
status: controller.bookingModel.value.status,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 6,
|
||||
),
|
||||
child: Text(
|
||||
"${controller.bookingModel.value.status}",
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -71,7 +107,15 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
@@ -79,19 +123,47 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_building.svg"),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_building.svg",
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
controller.bookingModel.value.vendor!.title.toString(),
|
||||
style: TextStyle(fontSize: 18, color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.title
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
controller.bookingModel.value.vendor!.location.toString(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.location
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -107,9 +179,23 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
onTap: () {
|
||||
launchUrl(
|
||||
Constant.createCoordinatesUrl(
|
||||
controller.bookingModel.value.vendor!.latitude ?? 0.0,
|
||||
controller.bookingModel.value.vendor!.longitude ?? 0.0,
|
||||
controller.bookingModel.value.vendor!.title,
|
||||
controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.latitude ??
|
||||
0.0,
|
||||
controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.longitude ??
|
||||
0.0,
|
||||
controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.title,
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -117,19 +203,44 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
"View in Map".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: AppThemeData.primary300,
|
||||
decorationColor:
|
||||
AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.symmetric(horizontal: 16), child: SizedBox(height: 16, child: VerticalDivider(width: 1))),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: SizedBox(
|
||||
height: 16,
|
||||
child: VerticalDivider(width: 1),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
if (controller.bookingModel.value.vendor!.phonenumber!.isNotEmpty) {
|
||||
final Uri launchUri = Uri(scheme: 'tel', path: controller.bookingModel.value.vendor!.phonenumber);
|
||||
if (controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.phonenumber!
|
||||
.isNotEmpty) {
|
||||
final Uri launchUri = Uri(
|
||||
scheme: 'tel',
|
||||
path:
|
||||
controller
|
||||
.bookingModel
|
||||
.value
|
||||
.vendor!
|
||||
.phonenumber,
|
||||
);
|
||||
launchUrl(launchUri);
|
||||
}
|
||||
},
|
||||
@@ -137,11 +248,15 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
"Call Now".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
decoration: TextDecoration.underline,
|
||||
decorationColor: AppThemeData.primary300,
|
||||
decorationColor:
|
||||
AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -156,11 +271,26 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Text(
|
||||
"Booking Details".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
@@ -171,14 +301,28 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Name".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${controller.bookingModel.value.guestFirstName} ${controller.bookingModel.value.guestLastName}",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -190,14 +334,28 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Phone number".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${controller.bookingModel.value.guestPhone}",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -209,14 +367,30 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Date and Time".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
Constant.timestampToDateTime(controller.bookingModel.value.date!),
|
||||
Constant.timestampToDateTime(
|
||||
controller.bookingModel.value.date!,
|
||||
),
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -228,14 +402,28 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Guest".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${controller.bookingModel.value.totalGuest}",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -247,14 +435,28 @@ class DineInBookingDetails extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Discount".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${controller.bookingModel.value.discount} %",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/app_them_data.dart';
|
||||
import '../../../widget/my_separator.dart';
|
||||
@@ -26,10 +26,16 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text(
|
||||
"Dine in Bookings".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
@@ -40,7 +46,15 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(120),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
@@ -54,16 +68,28 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
decoration:
|
||||
controller.isFeature.value == false
|
||||
? null
|
||||
: ShapeDecoration(color: AppThemeData.primary300, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120))),
|
||||
: ShapeDecoration(
|
||||
color: AppThemeData.primary300,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
"Upcoming".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
controller.isFeature.value == false
|
||||
controller.isFeature.value ==
|
||||
false
|
||||
? isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500
|
||||
@@ -85,16 +111,28 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
decoration:
|
||||
controller.isFeature.value == true
|
||||
? null
|
||||
: ShapeDecoration(color: AppThemeData.primary300, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120))),
|
||||
: ShapeDecoration(
|
||||
color: AppThemeData.primary300,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
"History".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
controller.isFeature.value == true
|
||||
controller.isFeature.value ==
|
||||
true
|
||||
? isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500
|
||||
@@ -119,26 +157,45 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
child:
|
||||
controller.isFeature.value
|
||||
? controller.featureList.isEmpty
|
||||
? Constant.showEmptyView(message: "Upcoming Booking not found.".tr())
|
||||
? Constant.showEmptyView(
|
||||
message:
|
||||
"Upcoming Booking not found.".tr(),
|
||||
)
|
||||
: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
scrollDirection: Axis.vertical,
|
||||
itemCount: controller.featureList.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
DineInBookingModel dineBookingModel = controller.featureList[index];
|
||||
return itemView(isDark, context, dineBookingModel);
|
||||
itemCount:
|
||||
controller.featureList.length,
|
||||
itemBuilder: (
|
||||
BuildContext context,
|
||||
int index,
|
||||
) {
|
||||
DineInBookingModel dineBookingModel =
|
||||
controller.featureList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
dineBookingModel,
|
||||
);
|
||||
},
|
||||
)
|
||||
: controller.historyList.isEmpty
|
||||
? Constant.showEmptyView(message: "History not found.".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "History not found.".tr(),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: controller.historyList.length,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
DineInBookingModel dineBookingModel = controller.historyList[index];
|
||||
return itemView(isDark, context, dineBookingModel);
|
||||
DineInBookingModel dineBookingModel =
|
||||
controller.historyList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
dineBookingModel,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -150,15 +207,27 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
InkWell itemView(isDark, BuildContext context, DineInBookingModel orderModel) {
|
||||
InkWell itemView(
|
||||
isDark,
|
||||
BuildContext context,
|
||||
DineInBookingModel orderModel,
|
||||
) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const DineInBookingDetails(), arguments: {"bookingModel": orderModel});
|
||||
Get.to(
|
||||
const DineInBookingDetails(),
|
||||
arguments: {"bookingModel": orderModel},
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
@@ -169,12 +238,24 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
child: Stack(
|
||||
children: [
|
||||
NetworkImageWidget(imageUrl: orderModel.vendor!.photo.toString(), fit: BoxFit.cover, height: Responsive.height(10, context), width: Responsive.width(20, context)),
|
||||
NetworkImageWidget(
|
||||
imageUrl: orderModel.vendor!.photo.toString(),
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.height(10, context),
|
||||
width: Responsive.width(20, context),
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(10, context),
|
||||
width: Responsive.width(20, context),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(begin: const Alignment(0.00, 1.00), end: const Alignment(0, -1), colors: [Colors.black.withOpacity(0), AppThemeData.grey900]),
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.00, 1.00),
|
||||
end: const Alignment(0, -1),
|
||||
colors: [
|
||||
Colors.black.withOpacity(0),
|
||||
AppThemeData.grey900,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -188,33 +269,79 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
Text(
|
||||
orderModel.status.toString(),
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(color: Constant.statusColor(status: orderModel.status.toString()), fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500, fontSize: 12),
|
||||
style: TextStyle(
|
||||
color: Constant.statusColor(
|
||||
status: orderModel.status.toString(),
|
||||
),
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
orderModel.vendor!.title.toString(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
Constant.timestampToDateTime(orderModel.createdAt!),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 14), child: MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
child: MySeparator(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: Text("Name".tr(), style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400))),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Name".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${orderModel.guestFirstName} ${orderModel.guestLastName}",
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -224,18 +351,40 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text("Guest Number".tr(), style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400)),
|
||||
child: Text(
|
||||
"Guest Number".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Text(
|
||||
orderModel.totalGuest.toString(),
|
||||
textAlign: TextAlign.end,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 14), child: MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
child: MySeparator(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -244,7 +393,14 @@ class DineInBookingScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
orderModel.vendor!.location.toString(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
@@ -27,8 +27,17 @@ class BookTableScreen extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text("Book Table".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text(
|
||||
"Book Table".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -37,25 +46,55 @@ class BookTableScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Numbers of Guests".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(4, context),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(200), side: BorderSide(color: isDark ? AppThemeData.grey600 : AppThemeData.grey300)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(200),
|
||||
side: BorderSide(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey600
|
||||
: AppThemeData.grey300,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@@ -69,7 +108,9 @@ class BookTableScreen extends StatelessWidget {
|
||||
child: const Icon(Icons.remove),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Text(
|
||||
controller.noOfQuantity.toString(),
|
||||
textAlign: TextAlign.start,
|
||||
@@ -79,7 +120,10 @@ class BookTableScreen extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? AppThemeData.grey100 : AppThemeData.grey800,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -87,7 +131,10 @@ class BookTableScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
controller.noOfQuantity.value += 1;
|
||||
},
|
||||
child: Icon(Icons.add, color: AppThemeData.primary300),
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -99,7 +146,13 @@ class BookTableScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
@@ -107,12 +160,22 @@ class BookTableScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"When are you visiting?".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 120,
|
||||
child: ListView.builder(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
),
|
||||
physics: const BouncingScrollPhysics(),
|
||||
itemCount: controller.dateList.length,
|
||||
scrollDirection: Axis.horizontal,
|
||||
@@ -120,11 +183,17 @@ class BookTableScreen extends StatelessWidget {
|
||||
return Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 2.0, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 2.0,
|
||||
vertical: 8,
|
||||
),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.selectedDate.value = controller.dateList[index].date;
|
||||
controller.timeSet(controller.dateList[index].date);
|
||||
controller.selectedDate.value =
|
||||
controller.dateList[index].date;
|
||||
controller.timeSet(
|
||||
controller.dateList[index].date,
|
||||
);
|
||||
},
|
||||
child: Obx(
|
||||
() => Container(
|
||||
@@ -135,41 +204,93 @@ class BookTableScreen extends StatelessWidget {
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color:
|
||||
controller.selectedDate.value == controller.dateList[index].date
|
||||
? AppThemeData.primary300
|
||||
controller
|
||||
.selectedDate
|
||||
.value ==
|
||||
controller
|
||||
.dateList[index]
|
||||
.date
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
: AppThemeData
|
||||
.grey100,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderRadius:
|
||||
BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
padding: const EdgeInsets.all(
|
||||
8.0,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
Constant.calculateDifference(controller.dateList[index].date.toDate()) == 0
|
||||
Constant.calculateDifference(
|
||||
controller
|
||||
.dateList[index]
|
||||
.date
|
||||
.toDate(),
|
||||
) ==
|
||||
0
|
||||
? "Today".tr()
|
||||
: Constant.calculateDifference(controller.dateList[index].date.toDate()) == 1
|
||||
: Constant.calculateDifference(
|
||||
controller
|
||||
.dateList[index]
|
||||
.date
|
||||
.toDate(),
|
||||
) ==
|
||||
1
|
||||
? "Tomorrow".tr()
|
||||
: DateFormat('EEE').format(controller.dateList[index].date.toDate()),
|
||||
: DateFormat(
|
||||
'EEE',
|
||||
).format(
|
||||
controller
|
||||
.dateList[index]
|
||||
.date
|
||||
.toDate(),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w500,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey400
|
||||
: AppThemeData
|
||||
.grey500,
|
||||
fontFamily:
|
||||
AppThemeData.regular,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
DateFormat('d MMM').format(controller.dateList[index].date.toDate()).toString(),
|
||||
DateFormat('d MMM')
|
||||
.format(
|
||||
controller
|
||||
.dateList[index]
|
||||
.date
|
||||
.toDate(),
|
||||
)
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey400
|
||||
: AppThemeData
|
||||
.grey500,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -185,8 +306,10 @@ class BookTableScreen extends StatelessWidget {
|
||||
right: 0,
|
||||
child: Center(
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
title: "${controller.dateList[index].discountPer}%".tr(),
|
||||
borderRadius: 10.r,
|
||||
title:
|
||||
"${controller.dateList[index].discountPer}%"
|
||||
.tr(),
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
width: 12,
|
||||
@@ -203,30 +326,69 @@ class BookTableScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Select time slot and scroll to see offers".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: isDark ? AppThemeData.grey600 : AppThemeData.grey300), borderRadius: BorderRadius.circular(12)),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey600
|
||||
: AppThemeData.grey300,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 5),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5,
|
||||
vertical: 5,
|
||||
),
|
||||
child: Wrap(
|
||||
spacing: 5.0,
|
||||
children: <Widget>[
|
||||
...controller.timeSlotList.map(
|
||||
(timeSlotList) => InputChip(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
side: BorderSide.none,
|
||||
backgroundColor: isDark ? AppThemeData.grey800 : AppThemeData.grey100,
|
||||
backgroundColor:
|
||||
isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
selectedColor: AppThemeData.primary300,
|
||||
labelStyle: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||
labelStyle: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
label: Text(
|
||||
DateFormat('hh:mm a').format(timeSlotList.time!),
|
||||
DateFormat(
|
||||
'hh:mm a',
|
||||
).format(timeSlotList.time!),
|
||||
style: TextStyle(
|
||||
color:
|
||||
controller.selectedTimeSlot.value == DateFormat('hh:mm a').format(timeSlotList.time!)
|
||||
controller
|
||||
.selectedTimeSlot
|
||||
.value ==
|
||||
DateFormat(
|
||||
'hh:mm a',
|
||||
).format(
|
||||
timeSlotList.time!,
|
||||
)
|
||||
? AppThemeData.grey50
|
||||
: isDark
|
||||
? AppThemeData.grey400
|
||||
@@ -236,11 +398,22 @@ class BookTableScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
showCheckmark: false,
|
||||
selected: controller.selectedTimeSlot.value == DateFormat('hh:mm a').format(timeSlotList.time!),
|
||||
selected:
|
||||
controller.selectedTimeSlot.value ==
|
||||
DateFormat(
|
||||
'hh:mm a',
|
||||
).format(timeSlotList.time!),
|
||||
onSelected: (value) {
|
||||
controller.selectedTimeSlot.value = DateFormat('hh:mm a').format(timeSlotList.time!);
|
||||
controller.selectedTimeDiscount.value = timeSlotList.discountPer!;
|
||||
controller.selectedTimeDiscountType.value = timeSlotList.discountType!;
|
||||
controller
|
||||
.selectedTimeSlot
|
||||
.value = DateFormat(
|
||||
'hh:mm a',
|
||||
).format(timeSlotList.time!);
|
||||
controller.selectedTimeDiscount.value =
|
||||
timeSlotList.discountPer!;
|
||||
controller
|
||||
.selectedTimeDiscountType
|
||||
.value = timeSlotList.discountType!;
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -258,55 +431,120 @@ class BookTableScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Special Occasion".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
controller.selectedOccasion.value = "";
|
||||
},
|
||||
child: Text("Clear".tr(), style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500)),
|
||||
child: Text(
|
||||
"Clear".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
for (int i = 0; i < controller.occasionList[i].length; i++)
|
||||
for (
|
||||
int i = 0;
|
||||
i < controller.occasionList[i].length;
|
||||
i++
|
||||
)
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 0.0, vertical: 0.0),
|
||||
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 0.0,
|
||||
vertical: 0.0,
|
||||
),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: 0,
|
||||
vertical: -4,
|
||||
),
|
||||
dense: true,
|
||||
title: Text(
|
||||
//'${controller.occasionList[i]}'.tr(),
|
||||
controller.getLocalizedOccasion(controller.occasionList[i]),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
controller.getLocalizedOccasion(
|
||||
controller.occasionList[i],
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
leading: Radio<String>(
|
||||
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: 0,
|
||||
vertical: -4,
|
||||
),
|
||||
value: controller.occasionList[i],
|
||||
groupValue: controller.selectedOccasion.value,
|
||||
activeColor: AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
controller.selectedOccasion.value = controller.occasionList[i];
|
||||
controller.selectedOccasion.value =
|
||||
controller.occasionList[i];
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 0.0, vertical: 0.0),
|
||||
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 0.0,
|
||||
vertical: 0.0,
|
||||
),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: 0,
|
||||
vertical: -4,
|
||||
),
|
||||
dense: true,
|
||||
title: Text(
|
||||
'Is this your first visit?'.tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
leading: Checkbox(
|
||||
visualDensity: const VisualDensity(horizontal: 0, vertical: -4),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: 0,
|
||||
vertical: -4,
|
||||
),
|
||||
value: controller.firstVisit.value,
|
||||
activeColor: AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
@@ -321,22 +559,44 @@ class BookTableScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Personal Details".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
ClipOval(
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: Constant.userModel!.profilePictureURL.toString(),
|
||||
imageUrl:
|
||||
Constant.userModel!.profilePictureURL
|
||||
.toString(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
errorWidget: Image.asset(Constant.userPlaceHolder, fit: BoxFit.cover, width: 50, height: 50),
|
||||
errorWidget: Image.asset(
|
||||
Constant.userPlaceHolder,
|
||||
fit: BoxFit.cover,
|
||||
width: 50,
|
||||
height: 50,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -345,11 +605,27 @@ class BookTableScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
Constant.userModel!.fullName(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${Constant.userModel!.email}",
|
||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -360,10 +636,20 @@ class BookTableScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Additional Requests".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
TextFieldWidget(controller: controller.additionRequestController.value, hintText: 'Add message here....'.tr(), maxLine: 5),
|
||||
TextFieldWidget(
|
||||
controller: controller.additionRequestController.value,
|
||||
hintText: 'Add message here....'.tr(),
|
||||
maxLine: 5,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
@@ -375,7 +661,7 @@ class BookTableScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
borderRadius: 10.r,
|
||||
title: "Book Now".tr(),
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/responsive.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../widget/restaurant_image_view.dart';
|
||||
@@ -119,40 +119,34 @@ class DineInRestaurantListScreen extends StatelessWidget {
|
||||
)
|
||||
.isNotEmpty) {
|
||||
FavouriteModel
|
||||
favouriteModel =
|
||||
FavouriteModel(
|
||||
restaurantId:
|
||||
vendorModel.id,
|
||||
userId:
|
||||
FireStoreUtils
|
||||
.getCurrentUid(),
|
||||
);
|
||||
favouriteModel = FavouriteModel(
|
||||
restaurantId:
|
||||
vendorModel.id,
|
||||
userId:
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
controller.favouriteList
|
||||
.removeWhere(
|
||||
(item) =>
|
||||
item.restaurantId ==
|
||||
vendorModel.id,
|
||||
);
|
||||
await FireStoreUtils
|
||||
.removeFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
await FireStoreUtils.removeFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
} else {
|
||||
FavouriteModel
|
||||
favouriteModel =
|
||||
FavouriteModel(
|
||||
restaurantId:
|
||||
vendorModel.id,
|
||||
userId:
|
||||
FireStoreUtils
|
||||
.getCurrentUid(),
|
||||
);
|
||||
favouriteModel = FavouriteModel(
|
||||
restaurantId:
|
||||
vendorModel.id,
|
||||
userId:
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
controller.favouriteList
|
||||
.add(favouriteModel);
|
||||
await FireStoreUtils
|
||||
.setFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
await FireStoreUtils.setFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Obx(
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../models/banner_model.dart';
|
||||
|
||||
@@ -5,8 +5,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../home_screen/category_restaurant_screen.dart';
|
||||
|
||||
@@ -18,55 +17,79 @@ class ViewAllCategoryDineInScreen extends StatelessWidget {
|
||||
final themeController = Get.find<ThemeController>();
|
||||
final isDark = themeController.isDark.value;
|
||||
return GetX(
|
||||
init: ViewAllCategoryController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
"Categories".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
init: ViewAllCategoryController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
"Categories".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
body: controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: Padding(
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: GridView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4, childAspectRatio: 3.5 / 6, crossAxisSpacing: 6),
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
childAspectRatio: 3.5 / 6,
|
||||
crossAxisSpacing: 6,
|
||||
),
|
||||
itemCount: controller.vendorCategoryModel.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
VendorCategoryModel vendorCategoryModel = controller.vendorCategoryModel[index];
|
||||
VendorCategoryModel vendorCategoryModel =
|
||||
controller.vendorCategoryModel[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const CategoryRestaurantScreen(), arguments: {"vendorCategoryModel": vendorCategoryModel, "dineIn": true});
|
||||
Get.to(
|
||||
const CategoryRestaurantScreen(),
|
||||
arguments: {
|
||||
"vendorCategoryModel": vendorCategoryModel,
|
||||
"dineIn": true,
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
vertical: 6,
|
||||
),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
color: isDark ? AppThemeData.grey800 : AppThemeData.grey100,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
@@ -74,23 +97,31 @@ class ViewAllCategoryDineInScreen extends StatelessWidget {
|
||||
height: 60,
|
||||
child: ClipOval(
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: vendorCategoryModel.photo.toString(),
|
||||
imageUrl:
|
||||
vendorCategoryModel.photo
|
||||
.toString(),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
'${vendorCategoryModel.title}',
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -99,7 +130,8 @@ class ViewAllCategoryDineInScreen extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
|
||||
@@ -25,7 +25,12 @@ class EditProfileScreen extends StatelessWidget {
|
||||
init: EditProfileController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(centerTitle: false, titleSpacing: 0, backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface),
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -34,11 +39,24 @@ class EditProfileScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"Profile Information".tr(),
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"View and update your personal details, contact information, and preferences.".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
"View and update your personal details, contact information, and preferences."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Center(
|
||||
@@ -47,12 +65,25 @@ class EditProfileScreen extends StatelessWidget {
|
||||
controller.profileImage.isEmpty
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
child: Image.asset(Constant.userPlaceHolder, height: Responsive.width(24, context), width: Responsive.width(24, context), fit: BoxFit.cover),
|
||||
child: Image.asset(
|
||||
Constant.userPlaceHolder,
|
||||
height: Responsive.width(24, context),
|
||||
width: Responsive.width(24, context),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
: Constant().hasValidUrl(controller.profileImage.value) == false
|
||||
: Constant().hasValidUrl(
|
||||
controller.profileImage.value,
|
||||
) ==
|
||||
false
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
child: Image.file(File(controller.profileImage.value), height: Responsive.width(24, context), width: Responsive.width(24, context), fit: BoxFit.cover),
|
||||
child: Image.file(
|
||||
File(controller.profileImage.value),
|
||||
height: Responsive.width(24, context),
|
||||
width: Responsive.width(24, context),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
)
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(60),
|
||||
@@ -61,7 +92,12 @@ class EditProfileScreen extends StatelessWidget {
|
||||
imageUrl: controller.profileImage.value,
|
||||
height: Responsive.width(24, context),
|
||||
width: Responsive.width(24, context),
|
||||
errorWidget: Image.asset(Constant.userPlaceHolder, fit: BoxFit.cover, height: Responsive.width(24, context), width: Responsive.width(24, context)),
|
||||
errorWidget: Image.asset(
|
||||
Constant.userPlaceHolder,
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.width(24, context),
|
||||
width: Responsive.width(24, context),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -80,13 +116,37 @@ class EditProfileScreen extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: TextFieldWidget(title: 'First Name'.tr(), controller: controller.firstNameController.value, hintText: 'First Name'.tr())),
|
||||
Expanded(
|
||||
child: TextFieldWidget(
|
||||
title: 'First Name'.tr(),
|
||||
controller: controller.firstNameController.value,
|
||||
hintText: 'First Name'.tr(),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(child: TextFieldWidget(title: 'Last Name'.tr(), controller: controller.lastNameController.value, hintText: 'Last Name'.tr())),
|
||||
Expanded(
|
||||
child: TextFieldWidget(
|
||||
title: 'Last Name'.tr(),
|
||||
controller: controller.lastNameController.value,
|
||||
hintText: 'Last Name'.tr(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
TextFieldWidget(title: 'Email'.tr(), textInputType: TextInputType.emailAddress, controller: controller.emailController.value, hintText: 'Email'.tr(), enable: false),
|
||||
TextFieldWidget(title: 'Phone Number'.tr(), textInputType: TextInputType.emailAddress, controller: controller.phoneNumberController.value, hintText: 'Phone Number'.tr(), enable: false),
|
||||
TextFieldWidget(
|
||||
title: 'Email'.tr(),
|
||||
textInputType: TextInputType.emailAddress,
|
||||
controller: controller.emailController.value,
|
||||
hintText: 'Email'.tr(),
|
||||
enable: false,
|
||||
),
|
||||
TextFieldWidget(
|
||||
title: 'Phone Number'.tr(),
|
||||
textInputType: TextInputType.emailAddress,
|
||||
controller: controller.phoneNumberController.value,
|
||||
hintText: 'Phone Number'.tr(),
|
||||
enable: false,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -97,7 +157,7 @@ class EditProfileScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: RoundedButtonFill(
|
||||
borderRadius: 10.r,
|
||||
borderRadius: 10.r,
|
||||
title: "Save Details".tr(),
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
@@ -114,7 +174,10 @@ class EditProfileScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future buildBottomSheet(BuildContext context, EditProfileController controller) {
|
||||
Future buildBottomSheet(
|
||||
BuildContext context,
|
||||
EditProfileController controller,
|
||||
) {
|
||||
return showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
@@ -125,7 +188,16 @@ class EditProfileScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(padding: const EdgeInsets.only(top: 15), child: Text("please select".tr(), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600))),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: Text(
|
||||
"please select".tr(),
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
@@ -135,8 +207,20 @@ class EditProfileScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.camera), icon: const Icon(Icons.camera_alt, size: 32)),
|
||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("camera".tr(), style: const TextStyle())),
|
||||
IconButton(
|
||||
onPressed:
|
||||
() => controller.pickFile(
|
||||
source: ImageSource.camera,
|
||||
),
|
||||
icon: const Icon(Icons.camera_alt, size: 32),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 3),
|
||||
child: Text(
|
||||
"camera".tr(),
|
||||
style: const TextStyle(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -146,8 +230,23 @@ class EditProfileScreen extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.gallery), icon: const Icon(Icons.photo_library_sharp, size: 32)),
|
||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("gallery".tr(), style: const TextStyle())),
|
||||
IconButton(
|
||||
onPressed:
|
||||
() => controller.pickFile(
|
||||
source: ImageSource.gallery,
|
||||
),
|
||||
icon: const Icon(
|
||||
Icons.photo_library_sharp,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 3),
|
||||
child: Text(
|
||||
"gallery".tr(),
|
||||
style: const TextStyle(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,8 +5,7 @@ import 'package:customer/themes/text_field_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
|
||||
@@ -21,14 +20,31 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
init: ForgotPasswordController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface),
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Forgot Password".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||
Text("No worries!! We’ll send you reset instructions".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.regular)),
|
||||
Text(
|
||||
"Forgot Password".tr(),
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontSize: 22,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"No worries!! We’ll send you reset instructions".tr(),
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey500,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.regular,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
TextFieldWidget(
|
||||
title: 'Email Address'.tr(),
|
||||
@@ -36,7 +52,13 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
hintText: 'Enter email address'.tr(),
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: SvgPicture.asset("assets/icons/ic_mail.svg", colorFilter: ColorFilter.mode(isDark ? AppThemeData.grey300 : AppThemeData.grey600, BlendMode.srcIn)),
|
||||
child: SvgPicture.asset(
|
||||
"assets/icons/ic_mail.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
@@ -45,8 +67,12 @@ class ForgotPasswordScreen extends StatelessWidget {
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
onPress: () async {
|
||||
if (controller.emailEditingController.value.text.trim().isEmpty) {
|
||||
ShowToastDialog.showToast("Please enter valid email".tr());
|
||||
if (controller.emailEditingController.value.text
|
||||
.trim()
|
||||
.isEmpty) {
|
||||
ShowToastDialog.showToast(
|
||||
"Please enter valid email".tr(),
|
||||
);
|
||||
} else {
|
||||
controller.forgotPassword();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
import 'history_gift_card.dart';
|
||||
@@ -29,13 +29,18 @@ class GiftCardScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
"Customize Gift Card".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
InkWell(
|
||||
@@ -69,26 +74,54 @@ class GiftCardScreen extends StatelessWidget {
|
||||
itemCount: controller.giftCardList.length,
|
||||
onPageChanged: (value) {
|
||||
controller.selectedPageIndex.value = value;
|
||||
controller.selectedGiftCard.value = controller.giftCardList[controller.selectedPageIndex.value];
|
||||
controller.selectedGiftCard.value =
|
||||
controller.giftCardList[controller
|
||||
.selectedPageIndex
|
||||
.value];
|
||||
|
||||
controller.messageController.value.text = controller.giftCardList[controller.selectedPageIndex.value].message.toString();
|
||||
controller.messageController.value.text =
|
||||
controller
|
||||
.giftCardList[controller
|
||||
.selectedPageIndex
|
||||
.value]
|
||||
.message
|
||||
.toString();
|
||||
},
|
||||
scrollDirection: Axis.horizontal,
|
||||
controller: controller.pageController,
|
||||
itemBuilder: (context, index) {
|
||||
GiftCardsModel giftCardModel = controller.giftCardList[index];
|
||||
GiftCardsModel giftCardModel =
|
||||
controller.giftCardList[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
controller.selectedGiftCard.value = giftCardModel;
|
||||
controller.messageController.value.text = controller.selectedGiftCard.value.message.toString();
|
||||
controller.selectedGiftCard.value =
|
||||
giftCardModel;
|
||||
controller.messageController.value.text =
|
||||
controller
|
||||
.selectedGiftCard
|
||||
.value
|
||||
.message
|
||||
.toString();
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), border: Border.all(color: AppThemeData.primary300)),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(
|
||||
color: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: NetworkImageWidget(imageUrl: giftCardModel.image.toString(), width: Responsive.width(80, context), fit: BoxFit.cover),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl:
|
||||
giftCardModel.image.toString(),
|
||||
width: Responsive.width(80, context),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -101,14 +134,32 @@ class GiftCardScreen extends StatelessWidget {
|
||||
title: 'Choose an amount'.tr(),
|
||||
controller: controller.amountController.value,
|
||||
hintText: 'Enter gift card amount'.tr(),
|
||||
textInputType: const TextInputType.numberWithOptions(signed: true, decimal: true),
|
||||
textInputType:
|
||||
const TextInputType.numberWithOptions(
|
||||
signed: true,
|
||||
decimal: true,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(
|
||||
RegExp('[0-9]'),
|
||||
),
|
||||
],
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 14,
|
||||
),
|
||||
child: Text(
|
||||
Constant.currencyModel!.symbol.tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontSize: 18),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
onchange: (value) {
|
||||
@@ -126,17 +177,25 @@ class GiftCardScreen extends StatelessWidget {
|
||||
return Obx(
|
||||
() => InkWell(
|
||||
onTap: () {
|
||||
controller.selectedAmount.value = controller.amountList[index];
|
||||
controller.amountController.value.text = controller.amountList[index];
|
||||
controller.selectedAmount.value =
|
||||
controller.amountList[index];
|
||||
controller.amountController.value.text =
|
||||
controller.amountList[index];
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 5,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(40)),
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(40),
|
||||
),
|
||||
border: Border.all(
|
||||
color:
|
||||
controller.selectedAmount == controller.amountList[index]
|
||||
controller.selectedAmount ==
|
||||
controller
|
||||
.amountList[index]
|
||||
? AppThemeData.primary300
|
||||
: isDark
|
||||
? AppThemeData.grey400
|
||||
@@ -144,11 +203,24 @@ class GiftCardScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
Constant.amountShow(amount: controller.amountList[index]),
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 14, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller
|
||||
.amountList[index],
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -160,7 +232,12 @@ class GiftCardScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
TextFieldWidget(title: 'Add Message (Optional)'.tr(), controller: controller.messageController.value, hintText: 'Add message here....'.tr(), maxLine: 6),
|
||||
TextFieldWidget(
|
||||
title: 'Add Message (Optional)'.tr(),
|
||||
controller: controller.messageController.value,
|
||||
hintText: 'Add message here....'.tr(),
|
||||
maxLine: 6,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -179,7 +256,10 @@ class GiftCardScreen extends StatelessWidget {
|
||||
onPress: () async {
|
||||
if (controller.amountController.value.text.isNotEmpty) {
|
||||
if (Constant.userModel == null) {
|
||||
ShowToastDialog.showToast("Please log in to the application. You are not logged in.".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Please log in to the application. You are not logged in."
|
||||
.tr(),
|
||||
);
|
||||
} else {
|
||||
giftCardBottomSheet(context, controller);
|
||||
}
|
||||
@@ -195,12 +275,17 @@ class GiftCardScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future giftCardBottomSheet(BuildContext context, GiftCardController controller) {
|
||||
Future giftCardBottomSheet(
|
||||
BuildContext context,
|
||||
GiftCardController controller,
|
||||
) {
|
||||
return showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
isDismissible: true,
|
||||
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(30))),
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(30)),
|
||||
),
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
builder:
|
||||
(context) => FractionallySizedBox(
|
||||
@@ -213,7 +298,10 @@ class GiftCardScreen extends StatelessWidget {
|
||||
() => Scaffold(
|
||||
body: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -221,17 +309,34 @@ class GiftCardScreen extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: NetworkImageWidget(imageUrl: controller.selectedGiftCard.value.image.toString(), height: Responsive.height(20, context), width: Responsive.width(100, context)),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl:
|
||||
controller.selectedGiftCard.value.image
|
||||
.toString(),
|
||||
height: Responsive.height(20, context),
|
||||
width: Responsive.width(100, context),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: ShapeDecoration(color: AppThemeData.ecommerce50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppThemeData.ecommerce50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Complete payment and share this e-gift card with loved ones using any app'.tr(),
|
||||
style: TextStyle(color: AppThemeData.ecommerce300, fontSize: 14, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
'Complete payment and share this e-gift card with loved ones using any app'
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color: AppThemeData.ecommerce300,
|
||||
fontSize: 14,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -241,48 +346,114 @@ class GiftCardScreen extends StatelessWidget {
|
||||
Text(
|
||||
"Bill Details".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 14),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 14,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Sub Total".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
AppThemeData.regular,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.amountController.value.text),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller
|
||||
.amountController
|
||||
.value
|
||||
.text,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
AppThemeData.regular,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Grand Total".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
AppThemeData.regular,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.amountController.value.text),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller
|
||||
.amountController
|
||||
.value
|
||||
.text,
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16),
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
AppThemeData.regular,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -295,9 +466,17 @@ class GiftCardScreen extends StatelessWidget {
|
||||
const SizedBox(height: 20),
|
||||
Center(
|
||||
child: Text(
|
||||
"${'Gift Card expire'.tr()} ${controller.selectedGiftCard.value.expiryDay} ${'days after purchase'.tr()}".tr(),
|
||||
"${'Gift Card expire'.tr()} ${controller.selectedGiftCard.value.expiryDay} ${'days after purchase'.tr()}"
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey500 : AppThemeData.grey400),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey500
|
||||
: AppThemeData.grey400,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -305,12 +484,17 @@ class GiftCardScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 20,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: RoundedButtonFill(
|
||||
title: "${'Pay'.tr()} ${Constant.amountShow(amount: controller.amountController.value.text)}",
|
||||
title:
|
||||
"${'Pay'.tr()} ${Constant.amountShow(amount: controller.amountController.value.text)}",
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
textColor: AppThemeData.grey50,
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:customer/models/gift_cards_order_model.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../widget/my_separator.dart';
|
||||
|
||||
@@ -19,7 +19,12 @@ class HistoryGiftCard extends StatelessWidget {
|
||||
init: HistoryGiftCardController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, centerTitle: false, titleSpacing: 0),
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
@@ -27,61 +32,114 @@ class HistoryGiftCard extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child:
|
||||
controller.giftCardsOrderList.isEmpty
|
||||
? Constant.showEmptyView(message: "Purchased Gift card not found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Purchased Gift card not found".tr(),
|
||||
)
|
||||
: ListView.builder(
|
||||
itemCount: controller.giftCardsOrderList.length,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
GiftCardsOrderModel giftCardOrderModel = controller.giftCardsOrderList[index];
|
||||
GiftCardsOrderModel giftCardOrderModel =
|
||||
controller.giftCardsOrderList[index];
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 4),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
margin: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
giftCardOrderModel.giftTitle.toString(),
|
||||
giftCardOrderModel.giftTitle
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.ecommerce300 : AppThemeData.ecommerce300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce300
|
||||
: AppThemeData
|
||||
.ecommerce300,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: giftCardOrderModel.price.toString()),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
giftCardOrderModel.price
|
||||
.toString(),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200),
|
||||
MySeparator(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Gift Code".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
giftCardOrderModel.giftCode.toString().replaceAllMapped(RegExp(r".{4}"), (match) => "${match.group(0)} "),
|
||||
giftCardOrderModel.giftCode
|
||||
.toString()
|
||||
.replaceAllMapped(
|
||||
RegExp(r".{4}"),
|
||||
(match) =>
|
||||
"${match.group(0)} ",
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@@ -93,16 +151,33 @@ class HistoryGiftCard extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Gift Pin".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
giftCardOrderModel.isPasswordShow == true
|
||||
giftCardOrderModel.isPasswordShow ==
|
||||
true
|
||||
? Text(
|
||||
giftCardOrderModel.giftPin.toString(),
|
||||
giftCardOrderModel.giftPin
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
)
|
||||
@@ -110,60 +185,107 @@ class HistoryGiftCard extends StatelessWidget {
|
||||
"****",
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
giftCardOrderModel.isPasswordShow == true
|
||||
giftCardOrderModel.isPasswordShow ==
|
||||
true
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.updateList(index);
|
||||
controller.updateList(
|
||||
index,
|
||||
);
|
||||
controller.update();
|
||||
},
|
||||
child: const Icon(Icons.visibility_off),
|
||||
child: const Icon(
|
||||
Icons.visibility_off,
|
||||
),
|
||||
)
|
||||
: InkWell(
|
||||
onTap: () {
|
||||
controller.updateList(index);
|
||||
controller.updateList(
|
||||
index,
|
||||
);
|
||||
controller.update();
|
||||
},
|
||||
child: const Icon(Icons.remove_red_eye),
|
||||
child: const Icon(
|
||||
Icons.remove_red_eye,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200),
|
||||
MySeparator(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
controller.share(
|
||||
giftCardOrderModel.giftCode.toString(),
|
||||
giftCardOrderModel.giftPin.toString(),
|
||||
giftCardOrderModel.message.toString(),
|
||||
giftCardOrderModel.price.toString(),
|
||||
giftCardOrderModel.expireDate!,
|
||||
giftCardOrderModel.giftCode
|
||||
.toString(),
|
||||
giftCardOrderModel.giftPin
|
||||
.toString(),
|
||||
giftCardOrderModel.message
|
||||
.toString(),
|
||||
giftCardOrderModel.price
|
||||
.toString(),
|
||||
giftCardOrderModel
|
||||
.expireDate!,
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData
|
||||
.grey200,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
8,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisSize:
|
||||
MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'Share'.tr(),
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.grey300 : AppThemeData.grey600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey300
|
||||
: AppThemeData
|
||||
.grey600,
|
||||
fontSize: 14,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
height: 0.11,
|
||||
),
|
||||
),
|
||||
@@ -175,11 +297,20 @@ class HistoryGiftCard extends StatelessWidget {
|
||||
),
|
||||
const Expanded(child: SizedBox()),
|
||||
Text(
|
||||
giftCardOrderModel.redeem == true ? "Redeemed".tr() : "Not Redeem".tr(),
|
||||
giftCardOrderModel.redeem == true
|
||||
? "Redeemed".tr()
|
||||
: "Not Redeem".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: giftCardOrderModel.redeem == true ? AppThemeData.success400 : AppThemeData.danger300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color:
|
||||
giftCardOrderModel.redeem ==
|
||||
true
|
||||
? AppThemeData
|
||||
.success400
|
||||
: AppThemeData
|
||||
.danger300,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -11,8 +11,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
import '../dash_board_screens/dash_board_screen.dart';
|
||||
@@ -28,7 +27,12 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
||||
init: RedeemGiftCardController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, centerTitle: false, titleSpacing: 0),
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
),
|
||||
body: InkWell(
|
||||
onTap: () {
|
||||
FocusScope.of(context).unfocus();
|
||||
@@ -40,11 +44,24 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"Redeem Gift Card".tr(),
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Enter your gift card code to enjoy discounts and special offers on your orders.".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
"Enter your gift card code to enjoy discounts and special offers on your orders."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
TextFieldWidget(
|
||||
@@ -52,14 +69,20 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
||||
controller: controller.giftCodeController.value,
|
||||
hintText: 'Enter gift code'.tr(),
|
||||
textInputType: TextInputType.number,
|
||||
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_code.svg")),
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: SvgPicture.asset("assets/icons/ic_gift_code.svg"),
|
||||
),
|
||||
),
|
||||
TextFieldWidget(
|
||||
title: 'Gift Pin'.tr(),
|
||||
controller: controller.giftPinController.value,
|
||||
hintText: 'Enter gift pin'.tr(),
|
||||
textInputType: TextInputType.number,
|
||||
prefix: Padding(padding: const EdgeInsets.all(10), child: SvgPicture.asset("assets/icons/ic_gift_pin.svg")),
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: SvgPicture.asset("assets/icons/ic_gift_pin.svg"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -83,45 +106,73 @@ class RedeemGiftCardScreen extends StatelessWidget {
|
||||
ShowToastDialog.showToast("Please Enter Gift Pin".tr());
|
||||
} else {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
await FireStoreUtils.checkRedeemCode(controller.giftCodeController.value.text.replaceAll(" ", "")).then((value) async {
|
||||
await FireStoreUtils.checkRedeemCode(
|
||||
controller.giftCodeController.value.text.replaceAll(
|
||||
" ",
|
||||
"",
|
||||
),
|
||||
).then((value) async {
|
||||
if (value != null) {
|
||||
GiftCardsOrderModel giftCodeModel = value;
|
||||
if (giftCodeModel.redeem == true) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Gift voucher already redeemed".tr());
|
||||
} else if (giftCodeModel.giftPin != controller.giftPinController.value.text) {
|
||||
ShowToastDialog.showToast(
|
||||
"Gift voucher already redeemed".tr(),
|
||||
);
|
||||
} else if (giftCodeModel.giftPin !=
|
||||
controller.giftPinController.value.text) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Gift Pin Invalid".tr());
|
||||
} else if (giftCodeModel.expireDate!.toDate().isBefore(DateTime.now())) {
|
||||
} else if (giftCodeModel.expireDate!.toDate().isBefore(
|
||||
DateTime.now(),
|
||||
)) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Gift Voucher expire".tr());
|
||||
} else {
|
||||
giftCodeModel.redeem = true;
|
||||
|
||||
WalletTransactionModel transactionModel = WalletTransactionModel(
|
||||
id: Constant.getUuid(),
|
||||
amount: double.parse(giftCodeModel.price.toString()),
|
||||
date: Timestamp.now(),
|
||||
paymentMethod: "Wallet",
|
||||
transactionUser: "user",
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
isTopup: true,
|
||||
note: "Gift Voucher",
|
||||
paymentStatus: "success",
|
||||
);
|
||||
WalletTransactionModel transactionModel =
|
||||
WalletTransactionModel(
|
||||
id: Constant.getUuid(),
|
||||
amount: double.parse(
|
||||
giftCodeModel.price.toString(),
|
||||
),
|
||||
date: Timestamp.now(),
|
||||
paymentMethod: "Wallet",
|
||||
transactionUser: "user",
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
isTopup: true,
|
||||
note: "Gift Voucher",
|
||||
paymentStatus: "success",
|
||||
);
|
||||
|
||||
await FireStoreUtils.setWalletTransaction(transactionModel).then((value) async {
|
||||
await FireStoreUtils.setWalletTransaction(
|
||||
transactionModel,
|
||||
).then((value) async {
|
||||
if (value == true) {
|
||||
await FireStoreUtils.updateUserWallet(amount: giftCodeModel.price.toString(), userId: FireStoreUtils.getCurrentUid()).then((value) async {
|
||||
await FireStoreUtils.sendTopUpMail(paymentMethod: "Gift Voucher", amount: giftCodeModel.price.toString(), tractionId: transactionModel.id.toString());
|
||||
await FireStoreUtils.placeGiftCardOrder(giftCodeModel).then((value) {
|
||||
await FireStoreUtils.updateUserWallet(
|
||||
amount: giftCodeModel.price.toString(),
|
||||
userId: FireStoreUtils.getCurrentUid(),
|
||||
).then((value) async {
|
||||
await FireStoreUtils.sendTopUpMail(
|
||||
paymentMethod: "Gift Voucher",
|
||||
amount: giftCodeModel.price.toString(),
|
||||
tractionId: transactionModel.id.toString(),
|
||||
);
|
||||
await FireStoreUtils.placeGiftCardOrder(
|
||||
giftCodeModel,
|
||||
).then((value) {
|
||||
ShowToastDialog.closeLoader();
|
||||
if (Constant.walletSetting == true) {
|
||||
Get.offAll(const DashBoardScreen());
|
||||
DashBoardController controller = Get.put(DashBoardController());
|
||||
DashBoardController controller = Get.put(
|
||||
DashBoardController(),
|
||||
);
|
||||
controller.selectedIndex.value = 2;
|
||||
}
|
||||
ShowToastDialog.showToast("Voucher redeem successfully".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Voucher redeem successfully".tr(),
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/round_button_fill.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
import '../wallet_screen/wallet_screen.dart';
|
||||
@@ -22,12 +22,22 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
init: GiftCardController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Payment Option".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
title: Text(
|
||||
"Payment Option".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -38,7 +48,12 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
Text(
|
||||
"Preferred Payment".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (controller.walletSettingModel.value.isEnabled == true)
|
||||
@@ -47,17 +62,39 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
shadows: const [BoxShadow(color: Color(0x07000000), blurRadius: 20, offset: Offset(0, 0), spreadRadius: 0)],
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
shadows: const [
|
||||
BoxShadow(
|
||||
color: Color(0x07000000),
|
||||
blurRadius: 20,
|
||||
offset: Offset(0, 0),
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(
|
||||
visible: controller.walletSettingModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.wallet, isDark, "assets/images/ic_wallet.png"),
|
||||
visible:
|
||||
controller
|
||||
.walletSettingModel
|
||||
.value
|
||||
.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.wallet,
|
||||
isDark,
|
||||
"assets/images/ic_wallet.png",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -67,40 +104,143 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
Text(
|
||||
"Other Payment Options".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
shadows: const [BoxShadow(color: Color(0x07000000), blurRadius: 20, offset: Offset(0, 0), spreadRadius: 0)],
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
shadows: const [
|
||||
BoxShadow(
|
||||
color: Color(0x07000000),
|
||||
blurRadius: 20,
|
||||
offset: Offset(0, 0),
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(visible: controller.flutterWaveModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.stripe, isDark, "assets/images/stripe.png")),
|
||||
Visibility(visible: controller.paytmModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.paypal, isDark, "assets/images/paypal.png")),
|
||||
Visibility(visible: controller.payStackModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.payStack, isDark, "assets/images/paystack.png")),
|
||||
Visibility(
|
||||
visible: controller.mercadoPagoModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.mercadoPago, isDark, "assets/images/mercado-pago.png"),
|
||||
visible:
|
||||
controller.flutterWaveModel.value.isEnable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.stripe,
|
||||
isDark,
|
||||
"assets/images/stripe.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.flutterWaveModel.value.isEnable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.flutterWave, isDark, "assets/images/flutterwave_logo.png"),
|
||||
visible:
|
||||
controller.paytmModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.paypal,
|
||||
isDark,
|
||||
"assets/images/paypal.png",
|
||||
),
|
||||
),
|
||||
Visibility(visible: controller.payFastModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.payFast, isDark, "assets/images/payfast.png")),
|
||||
Visibility(visible: controller.razorPayModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.razorpay, isDark, "assets/images/razorpay.png")),
|
||||
Visibility(visible: controller.midTransModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.midTrans, isDark, "assets/images/midtrans.png")),
|
||||
Visibility(
|
||||
visible: controller.orangeMoneyModel.value.enable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.orangeMoney, isDark, "assets/images/orange_money.png"),
|
||||
visible:
|
||||
controller.payStackModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payStack,
|
||||
isDark,
|
||||
"assets/images/paystack.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.mercadoPagoModel.value.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.mercadoPago,
|
||||
isDark,
|
||||
"assets/images/mercado-pago.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.flutterWaveModel.value.isEnable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.flutterWave,
|
||||
isDark,
|
||||
"assets/images/flutterwave_logo.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.payFastModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payFast,
|
||||
isDark,
|
||||
"assets/images/payfast.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.razorPayModel.value.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.razorpay,
|
||||
isDark,
|
||||
"assets/images/razorpay.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.midTransModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.midTrans,
|
||||
isDark,
|
||||
"assets/images/midtrans.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.orangeMoneyModel.value.enable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.orangeMoney,
|
||||
isDark,
|
||||
"assets/images/orange_money.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.xenditModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.xendit,
|
||||
isDark,
|
||||
"assets/images/xendit.png",
|
||||
),
|
||||
),
|
||||
Visibility(visible: controller.xenditModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.xendit, isDark, "assets/images/xendit.png")),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -110,7 +250,13 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
decoration: BoxDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, borderRadius: const BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
|
||||
decoration: BoxDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
@@ -121,38 +267,89 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
textColor: AppThemeData.grey50,
|
||||
fontSizes: 16,
|
||||
onPress: () async {
|
||||
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
||||
controller.stripeMakePayment(amount: controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.paypal.name) {
|
||||
controller.paypalPaymentSheet(controller.amountController.value.text, context);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payStack.name) {
|
||||
controller.payStackPayment(controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.mercadoPago.name) {
|
||||
controller.mercadoPagoMakePayment(context: context, amount: controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.flutterWave.name) {
|
||||
controller.flutterWaveInitiatePayment(context: context, amount: controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payFast.name) {
|
||||
controller.payFastPayment(context: context, amount: controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.midTrans.name) {
|
||||
controller.midtransMakePayment(context: context, amount: controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.orangeMoney.name) {
|
||||
controller.orangeMakePayment(context: context, amount: controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.xendit.name) {
|
||||
controller.xenditPayment(context, controller.amountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.wallet.name) {
|
||||
if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.stripe.name) {
|
||||
controller.stripeMakePayment(
|
||||
amount: controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.paypal.name) {
|
||||
controller.paypalPaymentSheet(
|
||||
controller.amountController.value.text,
|
||||
context,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.payStack.name) {
|
||||
controller.payStackPayment(
|
||||
controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.mercadoPago.name) {
|
||||
controller.mercadoPagoMakePayment(
|
||||
context: context,
|
||||
amount: controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.flutterWave.name) {
|
||||
controller.flutterWaveInitiatePayment(
|
||||
context: context,
|
||||
amount: controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.payFast.name) {
|
||||
controller.payFastPayment(
|
||||
context: context,
|
||||
amount: controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.midTrans.name) {
|
||||
controller.midtransMakePayment(
|
||||
context: context,
|
||||
amount: controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.orangeMoney.name) {
|
||||
controller.orangeMakePayment(
|
||||
context: context,
|
||||
amount: controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.xendit.name) {
|
||||
controller.xenditPayment(
|
||||
context,
|
||||
controller.amountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.wallet.name) {
|
||||
controller.placeOrder();
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.razorpay.name) {
|
||||
RazorPayController().createOrderRazorPay(amount: double.parse(controller.amountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
||||
if (value == null) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
} else {
|
||||
CreateRazorPayOrderModel result = value;
|
||||
controller.openCheckout(amount: controller.amountController.value.text, orderId: result.id);
|
||||
}
|
||||
});
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.razorpay.name) {
|
||||
RazorPayController()
|
||||
.createOrderRazorPay(
|
||||
amount: double.parse(
|
||||
controller.amountController.value.text,
|
||||
),
|
||||
razorpayModel: controller.razorPayModel.value,
|
||||
)
|
||||
.then((value) {
|
||||
if (value == null) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin."
|
||||
.tr(),
|
||||
);
|
||||
} else {
|
||||
CreateRazorPayOrderModel result = value;
|
||||
controller.openCheckout(
|
||||
amount: controller.amountController.value.text,
|
||||
orderId: result.id,
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ShowToastDialog.showToast("Please select payment method".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Please select payment method".tr(),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -163,7 +360,12 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Obx cardDecoration(GiftCardController controller, PaymentGateway value, isDark, String image) {
|
||||
Obx cardDecoration(
|
||||
GiftCardController controller,
|
||||
PaymentGateway value,
|
||||
isDark,
|
||||
String image,
|
||||
) {
|
||||
return Obx(
|
||||
() => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
@@ -176,8 +378,16 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(shape: RoundedRectangleBorder(side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)), borderRadius: BorderRadius.circular(8))),
|
||||
child: Padding(padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0), child: Image.asset(image)),
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0),
|
||||
child: Image.asset(image),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
value.name == "wallet"
|
||||
@@ -188,12 +398,32 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.userModel.value.walletAmount == null ? '0.0' : controller.userModel.value.walletAmount.toString()),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller.userModel.value.walletAmount == null
|
||||
? '0.0'
|
||||
: controller.userModel.value.walletAmount
|
||||
.toString(),
|
||||
),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -202,14 +432,20 @@ class SelectGiftPaymentScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Expanded(child: SizedBox()),
|
||||
Radio(
|
||||
value: value.name,
|
||||
groupValue: controller.selectedPaymentMethod.value,
|
||||
activeColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
activeColor:
|
||||
isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
controller.selectedPaymentMethod.value = value.toString();
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:customer/themes/responsive.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../widget/restaurant_image_view.dart';
|
||||
import '../restaurant_details_screen/restaurant_details_screen.dart';
|
||||
@@ -22,7 +22,12 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
init: CategoryRestaurantController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, centerTitle: false, titleSpacing: 0),
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
@@ -34,33 +39,62 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
shrinkWrap: true,
|
||||
itemCount: controller.allNearestRestaurant.length,
|
||||
itemBuilder: (context, index) {
|
||||
VendorModel vendorModel = controller.allNearestRestaurant[index];
|
||||
VendorModel vendorModel =
|
||||
controller.allNearestRestaurant[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
topRight: Radius.circular(16),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
RestaurantImageView(vendorModel: vendorModel),
|
||||
RestaurantImageView(
|
||||
vendorModel: vendorModel,
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(20, context),
|
||||
width: Responsive.width(100, context),
|
||||
height: Responsive.height(
|
||||
20,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(
|
||||
100,
|
||||
context,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(-0.00, -1.00),
|
||||
begin: const Alignment(
|
||||
-0.00,
|
||||
-1.00,
|
||||
),
|
||||
end: const Alignment(0, 1),
|
||||
colors: [Colors.black.withOpacity(0), const Color(0xFF111827)],
|
||||
colors: [
|
||||
Colors.black.withOpacity(0),
|
||||
const Color(0xFF111827),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -68,28 +102,60 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Transform.translate(
|
||||
offset: Offset(Responsive.width(-3, context), Responsive.height(17.5, context)),
|
||||
offset: Offset(
|
||||
Responsive.width(-3, context),
|
||||
Responsive.height(17.5, context),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Visibility(
|
||||
visible: (vendorModel.isSelfDelivery == true && Constant.isSelfDeliveryFeature == true),
|
||||
visible:
|
||||
(vendorModel.isSelfDelivery ==
|
||||
true &&
|
||||
Constant.isSelfDeliveryFeature ==
|
||||
true),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppThemeData.success300,
|
||||
borderRadius: BorderRadius.circular(120), // Optional
|
||||
color:
|
||||
AppThemeData
|
||||
.success300,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
), // Optional
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||
const SizedBox(width: 5),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_free_delivery.svg",
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(fontSize: 14, color: AppThemeData.success600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
AppThemeData
|
||||
.success600,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -100,22 +166,52 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.primary600 : AppThemeData.primary50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary600
|
||||
: AppThemeData
|
||||
.primary50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_star.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount!.toStringAsFixed(0), reviewSum: vendorModel.reviewsSum.toString())} (${vendorModel.reviewsCount!.toStringAsFixed(0)})",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: AppThemeData
|
||||
.primary300,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -125,22 +221,52 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
const SizedBox(width: 6),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.ecommerce600 : AppThemeData.ecommerce50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce600
|
||||
: AppThemeData
|
||||
.ecommerce50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_map_distance.svg", colorFilter: ColorFilter.mode(AppThemeData.ecommerce300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_map_distance.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.ecommerce300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.getDistance(lat1: vendorModel.latitude.toString(), lng1: vendorModel.longitude.toString(), lat2: Constant.selectedLocation.location!.latitude.toString(), lng2: Constant.selectedLocation.location!.longitude.toString())} ${Constant.distanceType}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? AppThemeData.ecommerce300 : AppThemeData.ecommerce300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce300
|
||||
: AppThemeData
|
||||
.ecommerce300,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -154,9 +280,12 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
vendorModel.title.toString(),
|
||||
@@ -166,7 +295,10 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
fontSize: 18,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -177,7 +309,10 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey400,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey400,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:dotted_border/dotted_border.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../restaurant_details_screen/restaurant_details_screen.dart';
|
||||
|
||||
@@ -25,13 +25,18 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
controller.title.value,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
@@ -47,24 +52,60 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
CouponModel offerModel = controller.couponList[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||
Get.to(
|
||||
RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16), bottomLeft: Radius.circular(16)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
bottomLeft: Radius.circular(16),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
NetworkImageWidget(imageUrl: vendorModel.photo.toString(), fit: BoxFit.cover, height: Responsive.height(16, context), width: Responsive.width(28, context)),
|
||||
NetworkImageWidget(
|
||||
imageUrl:
|
||||
vendorModel.photo.toString(),
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.height(
|
||||
16,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(28, context),
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(16, context),
|
||||
height: Responsive.height(
|
||||
16,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(28, context),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(begin: const Alignment(-0.00, -1.00), end: const Alignment(0, 1), colors: [Colors.black.withOpacity(0), const Color(0xFF111827)]),
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(
|
||||
-0.00,
|
||||
-1.00,
|
||||
),
|
||||
end: const Alignment(0, 1),
|
||||
colors: [
|
||||
Colors.black.withOpacity(0),
|
||||
const Color(0xFF111827),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
@@ -72,16 +113,37 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
left: 10,
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.ecommerce300 : AppThemeData.ecommerce300,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce300
|
||||
: AppThemeData
|
||||
.ecommerce300,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(120),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 4,
|
||||
),
|
||||
child: Text(
|
||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".toUpperCase().tr() : " off".toUpperCase().tr()}",
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 1,
|
||||
style: TextStyle(overflow: TextOverflow.ellipsis, fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50),
|
||||
style: TextStyle(
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -91,9 +153,12 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
@@ -104,19 +169,45 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_star.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount!.toStringAsFixed(0), reviewSum: vendorModel.reviewsSum.toString())} (${vendorModel.reviewsCount!.toStringAsFixed(0)})",
|
||||
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: AppThemeData
|
||||
.primary300,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -124,18 +215,33 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Icon(Icons.location_on, size: 18, color: isDark ? AppThemeData.grey300 : AppThemeData.grey600),
|
||||
Icon(
|
||||
Icons.location_on,
|
||||
size: 18,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Expanded(
|
||||
child: Text(
|
||||
vendorModel.location.toString(),
|
||||
vendorModel.location
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontFamily:
|
||||
AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12,
|
||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey400,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey400
|
||||
: AppThemeData
|
||||
.grey400,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -143,19 +249,45 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Container(
|
||||
color: isDark ? AppThemeData.primary600 : AppThemeData.primary50,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary600
|
||||
: AppThemeData.primary50,
|
||||
child: DottedBorder(
|
||||
options: RoundedRectDottedBorderOptions(
|
||||
radius: const Radius.circular(6),
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
strokeWidth: 1,
|
||||
),
|
||||
options:
|
||||
RoundedRectDottedBorderOptions(
|
||||
radius:
|
||||
const Radius.circular(
|
||||
6,
|
||||
),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: AppThemeData
|
||||
.primary300,
|
||||
strokeWidth: 1,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 2,
|
||||
),
|
||||
child: Text(
|
||||
"${offerModel.code}",
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||
style: TextStyle(
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: AppThemeData
|
||||
.primary300,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -29,7 +29,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
import 'package:latlong2/latlong.dart' as location;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -705,7 +705,8 @@ class HomeScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"New Arrivals".tr(),
|
||||
"New Arrivals"
|
||||
.tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.start,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../widget/restaurant_image_view.dart';
|
||||
import '../restaurant_details_screen/restaurant_details_screen.dart';
|
||||
@@ -26,13 +25,18 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
controller.title.value,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
@@ -44,35 +48,64 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
shrinkWrap: true,
|
||||
itemCount: controller.vendorSearchList.length,
|
||||
itemBuilder: (context, index) {
|
||||
VendorModel vendorModel = controller.vendorSearchList[index];
|
||||
VendorModel vendorModel =
|
||||
controller.vendorSearchList[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel})?.then((v) {
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
)?.then((v) {
|
||||
controller.getFavouriteRestaurant();
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16)),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
topRight: Radius.circular(16),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
RestaurantImageView(vendorModel: vendorModel),
|
||||
RestaurantImageView(
|
||||
vendorModel: vendorModel,
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(20, context),
|
||||
width: Responsive.width(100, context),
|
||||
height: Responsive.height(
|
||||
20,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(
|
||||
100,
|
||||
context,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(-0.00, -1.00),
|
||||
begin: const Alignment(
|
||||
-0.00,
|
||||
-1.00,
|
||||
),
|
||||
end: const Alignment(0, 1),
|
||||
colors: [Colors.black.withOpacity(0), const Color(0xFF111827)],
|
||||
colors: [
|
||||
Colors.black.withOpacity(0),
|
||||
const Color(0xFF111827),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -81,21 +114,60 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
top: 10,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
if (controller.favouriteList.where((p0) => p0.restaurantId == vendorModel.id).isNotEmpty) {
|
||||
FavouriteModel favouriteModel = FavouriteModel(restaurantId: vendorModel.id, userId: FireStoreUtils.getCurrentUid());
|
||||
controller.favouriteList.removeWhere((item) => item.restaurantId == vendorModel.id);
|
||||
await FireStoreUtils.removeFavouriteRestaurant(favouriteModel);
|
||||
if (controller.favouriteList
|
||||
.where(
|
||||
(p0) =>
|
||||
p0.restaurantId ==
|
||||
vendorModel.id,
|
||||
)
|
||||
.isNotEmpty) {
|
||||
FavouriteModel
|
||||
favouriteModel = FavouriteModel(
|
||||
restaurantId:
|
||||
vendorModel.id,
|
||||
userId:
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
controller.favouriteList
|
||||
.removeWhere(
|
||||
(item) =>
|
||||
item.restaurantId ==
|
||||
vendorModel.id,
|
||||
);
|
||||
await FireStoreUtils.removeFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
} else {
|
||||
FavouriteModel favouriteModel = FavouriteModel(restaurantId: vendorModel.id, userId: FireStoreUtils.getCurrentUid());
|
||||
controller.favouriteList.add(favouriteModel);
|
||||
await FireStoreUtils.setFavouriteRestaurant(favouriteModel);
|
||||
FavouriteModel
|
||||
favouriteModel = FavouriteModel(
|
||||
restaurantId:
|
||||
vendorModel.id,
|
||||
userId:
|
||||
FireStoreUtils.getCurrentUid(),
|
||||
);
|
||||
controller.favouriteList
|
||||
.add(favouriteModel);
|
||||
await FireStoreUtils.setFavouriteRestaurant(
|
||||
favouriteModel,
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Obx(
|
||||
() =>
|
||||
controller.favouriteList.where((p0) => p0.restaurantId == vendorModel.id).isNotEmpty
|
||||
? SvgPicture.asset("assets/icons/ic_like_fill.svg")
|
||||
: SvgPicture.asset("assets/icons/ic_like.svg"),
|
||||
controller.favouriteList
|
||||
.where(
|
||||
(p0) =>
|
||||
p0.restaurantId ==
|
||||
vendorModel
|
||||
.id,
|
||||
)
|
||||
.isNotEmpty
|
||||
? SvgPicture.asset(
|
||||
"assets/icons/ic_like_fill.svg",
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
"assets/icons/ic_like.svg",
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -103,28 +175,60 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Transform.translate(
|
||||
offset: Offset(Responsive.width(-3, context), Responsive.height(17.5, context)),
|
||||
offset: Offset(
|
||||
Responsive.width(-3, context),
|
||||
Responsive.height(17.5, context),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Visibility(
|
||||
visible: (vendorModel.isSelfDelivery == true && Constant.isSelfDeliveryFeature == true),
|
||||
visible:
|
||||
(vendorModel.isSelfDelivery ==
|
||||
true &&
|
||||
Constant.isSelfDeliveryFeature ==
|
||||
true),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppThemeData.success300,
|
||||
borderRadius: BorderRadius.circular(120), // Optional
|
||||
color:
|
||||
AppThemeData
|
||||
.success300,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
), // Optional
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||
const SizedBox(width: 5),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_free_delivery.svg",
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
AppThemeData
|
||||
.carRent600,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -134,22 +238,51 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.primary600 : AppThemeData.primary50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary600
|
||||
: AppThemeData
|
||||
.primary50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_star.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount!.toStringAsFixed(0), reviewSum: vendorModel.reviewsSum.toString())} (${vendorModel.reviewsCount!.toStringAsFixed(0)})",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: AppThemeData
|
||||
.primary300,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -157,22 +290,51 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.ecommerce600 : AppThemeData.ecommerce50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce600
|
||||
: AppThemeData
|
||||
.ecommerce50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_map_distance.svg", colorFilter: ColorFilter.mode(AppThemeData.ecommerce300, BlendMode.srcIn)),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_map_distance.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.ecommerce300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.getDistance(lat1: vendorModel.latitude.toString(), lng1: vendorModel.longitude.toString(), lat2: Constant.selectedLocation.location!.latitude.toString(), lng2: Constant.selectedLocation.location!.longitude.toString())} ${Constant.distanceType}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? AppThemeData.ecommerce300 : AppThemeData.ecommerce300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce300
|
||||
: AppThemeData
|
||||
.ecommerce300,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -185,9 +347,12 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
vendorModel.title.toString(),
|
||||
@@ -197,7 +362,10 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
fontSize: 18,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -208,7 +376,10 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey400,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey400,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:customer/widget/story_view/utils.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../widget/story_view/widgets/story_view.dart';
|
||||
import '../restaurant_details_screen/restaurant_details_screen.dart';
|
||||
@@ -71,9 +71,15 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
StoryView(
|
||||
key: ValueKey(widget.index),
|
||||
storyItems:
|
||||
List.generate(widget.storyList[widget.index].videoUrl.length, (i) {
|
||||
return StoryItem.pageVideo(widget.storyList[widget.index].videoUrl[i], controller: storyController);
|
||||
}).toList(),
|
||||
List.generate(
|
||||
widget.storyList[widget.index].videoUrl.length,
|
||||
(i) {
|
||||
return StoryItem.pageVideo(
|
||||
widget.storyList[widget.index].videoUrl[i],
|
||||
controller: storyController,
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
onComplete: () {
|
||||
debugPrint("--------->");
|
||||
debugPrint(widget.storyList.length.toString());
|
||||
@@ -96,15 +102,23 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
},
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).viewPadding.top + 30, left: 16, right: 16),
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).viewPadding.top + 30,
|
||||
left: 16,
|
||||
right: 16,
|
||||
),
|
||||
child: FutureBuilder(
|
||||
future: FireStoreUtils.getVendorById(widget.storyList[widget.index].vendorID.toString()),
|
||||
future: FireStoreUtils.getVendorById(
|
||||
widget.storyList[widget.index].vendorID.toString(),
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
return SizedBox();
|
||||
} else {
|
||||
if (snapshot.hasError) {
|
||||
return Center(child: Text('${"Error".tr()}: ${snapshot.error}'));
|
||||
return Center(
|
||||
child: Text('${"Error".tr()}: ${snapshot.error}'),
|
||||
);
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
} else if (snapshot.data == null) {
|
||||
return const SizedBox();
|
||||
@@ -112,13 +126,23 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
VendorModel vendorModel = snapshot.data!;
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipOval(child: NetworkImageWidget(imageUrl: vendorModel.photo.toString(), width: 50, height: 50, fit: BoxFit.cover)),
|
||||
ClipOval(
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: vendorModel.photo.toString(),
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
@@ -129,17 +153,29 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
vendorModel.title.toString(),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 16, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_star.svg"),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum.toString())} ${'reviews'.tr()}",
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(color: AppThemeData.warning300, fontSize: 12, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
||||
style: const TextStyle(
|
||||
color: AppThemeData.warning300,
|
||||
fontSize: 12,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -152,8 +188,17 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
decoration: BoxDecoration(borderRadius: BorderRadius.circular(30), color: Colors.grey),
|
||||
child: SvgPicture.asset("assets/icons/ic_close.svg", colorFilter: ColorFilter.mode(AppThemeData.grey800, BlendMode.srcIn)),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
color: Colors.grey,
|
||||
),
|
||||
child: SvgPicture.asset(
|
||||
"assets/icons/ic_close.svg",
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppThemeData.grey800,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -5,8 +5,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import 'category_restaurant_screen.dart';
|
||||
|
||||
@@ -22,10 +21,19 @@ class ViewAllCategoryScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Categories".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||
title: Text(
|
||||
"Categories".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
@@ -34,38 +42,84 @@ class ViewAllCategoryScreen extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: GridView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4, childAspectRatio: 3.5 / 6, crossAxisSpacing: 6),
|
||||
gridDelegate:
|
||||
const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
childAspectRatio: 3.5 / 6,
|
||||
crossAxisSpacing: 6,
|
||||
),
|
||||
itemCount: controller.vendorCategoryModel.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (context, index) {
|
||||
VendorCategoryModel vendorCategoryModel = controller.vendorCategoryModel[index];
|
||||
VendorCategoryModel vendorCategoryModel =
|
||||
controller.vendorCategoryModel[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const CategoryRestaurantScreen(), arguments: {"vendorCategoryModel": vendorCategoryModel, "dineIn": false});
|
||||
Get.to(
|
||||
const CategoryRestaurantScreen(),
|
||||
arguments: {
|
||||
"vendorCategoryModel": vendorCategoryModel,
|
||||
"dineIn": false,
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 4,
|
||||
vertical: 6,
|
||||
),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, strokeAlign: BorderSide.strokeAlignOutside, color: isDark ? AppThemeData.grey800 : AppThemeData.grey100),
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
strokeAlign: BorderSide.strokeAlignOutside,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(100),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(width: 60, height: 60, child: ClipOval(child: NetworkImageWidget(imageUrl: vendorCategoryModel.photo.toString(), fit: BoxFit.cover))),
|
||||
SizedBox(
|
||||
width: 60,
|
||||
height: 60,
|
||||
child: ClipOval(
|
||||
child: NetworkImageWidget(
|
||||
imageUrl:
|
||||
vendorCategoryModel.photo
|
||||
.toString(),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
'${vendorCategoryModel.title}',
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 2,
|
||||
style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 12),
|
||||
style: AppThemeData.mediumTextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart' as gmap;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
|
||||
@@ -24,17 +24,44 @@ class LiveTrackingScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface, title: Text("Live Tracking".tr()), centerTitle: false),
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text("Live Tracking".tr()),
|
||||
centerTitle: false,
|
||||
),
|
||||
body:
|
||||
Constant.selectedMapType == 'osm'
|
||||
? flutterMap.FlutterMap(
|
||||
mapController: controller.osmMapController,
|
||||
options: flutterMap.MapOptions(initialCenter: controller.driverCurrent.value, initialZoom: 14),
|
||||
options: flutterMap.MapOptions(
|
||||
initialCenter: controller.driverCurrent.value,
|
||||
initialZoom: 14,
|
||||
),
|
||||
children: [
|
||||
flutterMap.TileLayer(urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', userAgentPackageName: 'felix.fondex.uz'),
|
||||
if (controller.routePoints.isNotEmpty) flutterMap.PolylineLayer(polylines: [flutterMap.Polyline(points: controller.routePoints, strokeWidth: 5.0, color: Colors.blue)]),
|
||||
flutterMap.MarkerLayer(markers: controller.orderModel.value.id == null ? [] : controller.osmMarkers),
|
||||
flutterMap.TileLayer(
|
||||
urlTemplate:
|
||||
'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
|
||||
userAgentPackageName: 'felix.fondex.uz',
|
||||
),
|
||||
if (controller.routePoints.isNotEmpty)
|
||||
flutterMap.PolylineLayer(
|
||||
polylines: [
|
||||
flutterMap.Polyline(
|
||||
points: controller.routePoints,
|
||||
strokeWidth: 5.0,
|
||||
color: Colors.blue,
|
||||
),
|
||||
],
|
||||
),
|
||||
flutterMap.MarkerLayer(
|
||||
markers:
|
||||
controller.orderModel.value.id == null
|
||||
? []
|
||||
: controller.osmMarkers,
|
||||
),
|
||||
],
|
||||
)
|
||||
: gmap.GoogleMap(
|
||||
@@ -43,11 +70,18 @@ class LiveTrackingScreen extends StatelessWidget {
|
||||
},
|
||||
myLocationEnabled: true,
|
||||
zoomControlsEnabled: false,
|
||||
polylines: Set<gmap.Polyline>.of(controller.polyLines.values),
|
||||
polylines: Set<gmap.Polyline>.of(
|
||||
controller.polyLines.values,
|
||||
),
|
||||
markers: Set<gmap.Marker>.of(controller.markers.values),
|
||||
initialCameraPosition: gmap.CameraPosition(
|
||||
zoom: 14,
|
||||
target: gmap.LatLng(controller.driverUserModel.value.location?.latitude ?? 0.0, controller.driverUserModel.value.location?.longitude ?? 0.0),
|
||||
target: gmap.LatLng(
|
||||
controller.driverUserModel.value.location?.latitude ??
|
||||
0.0,
|
||||
controller.driverUserModel.value.location?.longitude ??
|
||||
0.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ import 'package:customer/themes/round_button_fill.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
import '../../../widget/my_separator.dart';
|
||||
@@ -28,7 +28,9 @@ class OrderScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
body: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).viewPadding.top),
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).viewPadding.top,
|
||||
),
|
||||
child:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
@@ -41,12 +43,30 @@ class OrderScreen extends StatelessWidget {
|
||||
children: [
|
||||
Image.asset("assets/images/login.gif", height: 120),
|
||||
const SizedBox(height: 12),
|
||||
Text("Please Log In to Continue".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||
Text(
|
||||
"Please Log In to Continue".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
fontSize: 22,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||
"You’re not logged in. Please sign in to access your account and explore all features."
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey500,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
RoundedButtonFill(
|
||||
@@ -72,15 +92,32 @@ class OrderScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"My Order".tr(),
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Keep track your delivered, In Progress and Rejected item all in just one place.".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
"Keep track your delivered, In Progress and Rejected item all in just one place."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -91,26 +128,51 @@ class OrderScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey800 : AppThemeData.grey100, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120))),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6,
|
||||
horizontal: 10,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: TabBar(
|
||||
indicator: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(50), // Creates border
|
||||
borderRadius: BorderRadius.circular(
|
||||
50,
|
||||
), // Creates border
|
||||
color: AppThemeData.primary300,
|
||||
),
|
||||
labelColor: AppThemeData.grey50,
|
||||
isScrollable: true,
|
||||
tabAlignment: TabAlignment.start,
|
||||
indicatorWeight: 0.5,
|
||||
unselectedLabelColor: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
unselectedLabelColor:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
dividerColor: Colors.transparent,
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
tabs: [
|
||||
Padding(padding: const EdgeInsets.symmetric(horizontal: 18), child: Tab(text: 'All'.tr())),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 18,
|
||||
),
|
||||
child: Tab(text: 'All'.tr()),
|
||||
),
|
||||
Tab(text: 'In Progress'.tr()),
|
||||
Tab(text: 'Delivered'.tr()),
|
||||
Tab(text: 'Cancelled'.tr()),
|
||||
@@ -123,72 +185,134 @@ class OrderScreen extends StatelessWidget {
|
||||
child: TabBarView(
|
||||
children: [
|
||||
controller.allList.isEmpty
|
||||
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Order Not Found".tr(),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getOrder(),
|
||||
onRefresh:
|
||||
() => controller.getOrder(),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.allList.length,
|
||||
itemCount:
|
||||
controller.allList.length,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
OrderModel orderModel = controller.allList[index];
|
||||
return itemView(isDark, context, orderModel, controller);
|
||||
OrderModel orderModel =
|
||||
controller.allList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
orderModel,
|
||||
controller,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
controller.inProgressList.isEmpty
|
||||
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Order Not Found".tr(),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getOrder(),
|
||||
onRefresh:
|
||||
() => controller.getOrder(),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.inProgressList.length,
|
||||
itemCount:
|
||||
controller
|
||||
.inProgressList
|
||||
.length,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
OrderModel orderModel = controller.inProgressList[index];
|
||||
return itemView(isDark, context, orderModel, controller);
|
||||
OrderModel orderModel =
|
||||
controller
|
||||
.inProgressList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
orderModel,
|
||||
controller,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
controller.deliveredList.isEmpty
|
||||
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Order Not Found".tr(),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getOrder(),
|
||||
onRefresh:
|
||||
() => controller.getOrder(),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.deliveredList.length,
|
||||
itemCount:
|
||||
controller
|
||||
.deliveredList
|
||||
.length,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
OrderModel orderModel = controller.deliveredList[index];
|
||||
return itemView(isDark, context, orderModel, controller);
|
||||
OrderModel orderModel =
|
||||
controller
|
||||
.deliveredList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
orderModel,
|
||||
controller,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
controller.cancelledList.isEmpty
|
||||
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Order Not Found".tr(),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getOrder(),
|
||||
onRefresh:
|
||||
() => controller.getOrder(),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.cancelledList.length,
|
||||
itemCount:
|
||||
controller
|
||||
.cancelledList
|
||||
.length,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
OrderModel orderModel = controller.cancelledList[index];
|
||||
return itemView(isDark, context, orderModel, controller);
|
||||
OrderModel orderModel =
|
||||
controller
|
||||
.cancelledList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
orderModel,
|
||||
controller,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
controller.rejectedList.isEmpty
|
||||
? Constant.showEmptyView(message: "Order Not Found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Order Not Found".tr(),
|
||||
)
|
||||
: RefreshIndicator(
|
||||
onRefresh: () => controller.getOrder(),
|
||||
onRefresh:
|
||||
() => controller.getOrder(),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.rejectedList.length,
|
||||
itemCount:
|
||||
controller
|
||||
.rejectedList
|
||||
.length,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
OrderModel orderModel = controller.rejectedList[index];
|
||||
return itemView(isDark, context, orderModel, controller);
|
||||
OrderModel orderModel =
|
||||
controller
|
||||
.rejectedList[index];
|
||||
return itemView(
|
||||
isDark,
|
||||
context,
|
||||
orderModel,
|
||||
controller,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -208,11 +332,21 @@ class OrderScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Padding itemView(isDark, BuildContext context, OrderModel orderModel, OrderController controller) {
|
||||
Padding itemView(
|
||||
isDark,
|
||||
BuildContext context,
|
||||
OrderModel orderModel,
|
||||
OrderController controller,
|
||||
) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
@@ -223,12 +357,24 @@ class OrderScreen extends StatelessWidget {
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
child: Stack(
|
||||
children: [
|
||||
NetworkImageWidget(imageUrl: orderModel.vendor!.photo.toString(), fit: BoxFit.cover, height: Responsive.height(10, context), width: Responsive.width(20, context)),
|
||||
NetworkImageWidget(
|
||||
imageUrl: orderModel.vendor!.photo.toString(),
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.height(10, context),
|
||||
width: Responsive.width(20, context),
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(10, context),
|
||||
width: Responsive.width(20, context),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(begin: const Alignment(0.00, 1.00), end: const Alignment(0, -1), colors: [Colors.black.withOpacity(0), AppThemeData.grey900]),
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.00, 1.00),
|
||||
end: const Alignment(0, -1),
|
||||
colors: [
|
||||
Colors.black.withOpacity(0),
|
||||
AppThemeData.grey900,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -242,17 +388,39 @@ class OrderScreen extends StatelessWidget {
|
||||
Text(
|
||||
orderModel.status.toString(),
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(color: Constant.statusColor(status: orderModel.status.toString()), fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500, fontSize: 12),
|
||||
style: TextStyle(
|
||||
color: Constant.statusColor(
|
||||
status: orderModel.status.toString(),
|
||||
),
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
orderModel.vendor!.title.toString(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
Constant.timestampToDateTime(orderModel.createdAt!),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -272,23 +440,55 @@ class OrderScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"${cartProduct.quantity} x ${cartProduct.name.toString()}",
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
double.parse(cartProduct.discountPrice.toString()) <= 0
|
||||
? (double.parse('${cartProduct.price ?? 0}') * double.parse('${cartProduct.quantity ?? 0}')).toString()
|
||||
: (double.parse('${cartProduct.discountPrice ?? 0}') * double.parse('${cartProduct.quantity ?? 0}')).toString(),
|
||||
double.parse(
|
||||
cartProduct.discountPrice.toString(),
|
||||
) <=
|
||||
0
|
||||
? (double.parse('${cartProduct.price ?? 0}') *
|
||||
double.parse(
|
||||
'${cartProduct.quantity ?? 0}',
|
||||
))
|
||||
.toString()
|
||||
: (double.parse(
|
||||
'${cartProduct.discountPrice ?? 0}',
|
||||
) *
|
||||
double.parse(
|
||||
'${cartProduct.quantity ?? 0}',
|
||||
))
|
||||
.toString(),
|
||||
),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 14), child: MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
child: MySeparator(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
orderModel.status == Constant.orderCompleted
|
||||
@@ -297,26 +497,48 @@ class OrderScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
for (var element in orderModel.products!) {
|
||||
controller.addToCart(cartProductModel: element);
|
||||
ShowToastDialog.showToast("Item Added In a cart".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Item Added In a cart".tr(),
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
"Reorder".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: orderModel.status == Constant.orderShipped || orderModel.status == Constant.orderInTransit
|
||||
: orderModel.status == Constant.orderShipped ||
|
||||
orderModel.status == Constant.orderInTransit
|
||||
? Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.to(const LiveTrackingScreen(), arguments: {"orderModel": orderModel});
|
||||
Get.to(
|
||||
const LiveTrackingScreen(),
|
||||
arguments: {"orderModel": orderModel},
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"Track Order".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary300
|
||||
: AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
@@ -324,13 +546,24 @@ class OrderScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.to(const OrderDetailsScreen(), arguments: {"orderModel": orderModel});
|
||||
Get.to(
|
||||
const OrderDetailsScreen(),
|
||||
arguments: {"orderModel": orderModel},
|
||||
);
|
||||
// Get.off(const OrderPlacingScreen(), arguments: {"orderModel": orderModel});
|
||||
},
|
||||
child: Text(
|
||||
"View Details".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, fontSize: 16),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -24,7 +24,7 @@ import 'package:firebase_auth/firebase_auth.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../terms_and_condition/terms_and_condition_screen.dart';
|
||||
@@ -44,7 +44,9 @@ class ProfileScreen extends StatelessWidget {
|
||||
return controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).viewPadding.top),
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).viewPadding.top,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
@@ -53,41 +55,106 @@ class ProfileScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"My Profile".tr(),
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Manage your personal information, preferences, and settings all in one place.".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
"Manage your personal information, preferences, and settings all in one place."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
"General Information".tr(),
|
||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Constant.userModel == null
|
||||
? const SizedBox()
|
||||
: cardDecoration(isDark, controller, "assets/images/ic_profile.svg", "Profile Information".tr(), () {
|
||||
Get.to(const EditProfileScreen());
|
||||
}),
|
||||
if (Constant.sectionConstantModel!.dineInActive == true)
|
||||
cardDecoration(isDark, controller, "assets/images/ic_dinin.svg", "Dine-In".tr(), () {
|
||||
Get.to(const DineInScreen());
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/images/ic_gift.svg", "Gift Card".tr(), () {
|
||||
Get.to(const GiftCardScreen());
|
||||
}),
|
||||
: cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/images/ic_profile.svg",
|
||||
"Profile Information".tr(),
|
||||
() {
|
||||
Get.to(const EditProfileScreen());
|
||||
},
|
||||
),
|
||||
if (Constant
|
||||
.sectionConstantModel!
|
||||
.dineInActive ==
|
||||
true)
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/images/ic_dinin.svg",
|
||||
"Dine-In".tr(),
|
||||
() {
|
||||
Get.to(const DineInScreen());
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/images/ic_gift.svg",
|
||||
"Gift Card".tr(),
|
||||
() {
|
||||
Get.to(const GiftCardScreen());
|
||||
},
|
||||
),
|
||||
if (Constant.isCashbackActive == true)
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_cashback_Offer.svg", "Cashback Offers".tr(), () {
|
||||
Get.to(const CashbackOffersListScreen());
|
||||
}),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_cashback_Offer.svg",
|
||||
"Cashback Offers".tr(),
|
||||
() {
|
||||
Get.to(
|
||||
const CashbackOffersListScreen(),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -99,19 +166,46 @@ class ProfileScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"Bookings Information".tr(),
|
||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 5,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_dinin_order.svg", "Dine-In Booking".tr(), () {
|
||||
Get.to(const DineInBookingScreen());
|
||||
}),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_dinin_order.svg",
|
||||
"Dine-In Booking".tr(),
|
||||
() {
|
||||
Get.to(
|
||||
const DineInBookingScreen(),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -122,20 +216,51 @@ class ProfileScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Preferences".tr(),
|
||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_change_language.svg", "Change Language".tr(), () {
|
||||
Get.to(const ChangeLanguageScreen());
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_light_dark.svg", "Dark Mode".tr(), () {}),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_change_language.svg",
|
||||
"Change Language".tr(),
|
||||
() {
|
||||
Get.to(const ChangeLanguageScreen());
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_light_dark.svg",
|
||||
"Dark Mode".tr(),
|
||||
() {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -143,31 +268,69 @@ class ProfileScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Social".tr(),
|
||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Constant.userModel == null
|
||||
? const SizedBox()
|
||||
: cardDecoration(isDark, controller, "assets/icons/ic_refer.svg", "Refer a Friend".tr(), () {
|
||||
Get.to(const ReferFriendScreen());
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_share.svg", "Share app".tr(), () {
|
||||
Share.share(
|
||||
'${'Check out Foodie, your ultimate food delivery application!'.tr()} \n\n${'Google Play:'.tr()} ${Constant.googlePlayLink} \n\n${'App Store:'.tr()} ${Constant.appStoreLink}',
|
||||
subject: 'Look what I made!'.tr(),
|
||||
);
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_rate.svg", "Rate the app".tr(), () {
|
||||
final InAppReview inAppReview = InAppReview.instance;
|
||||
inAppReview.requestReview();
|
||||
}),
|
||||
: cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_refer.svg",
|
||||
"Refer a Friend".tr(),
|
||||
() {
|
||||
Get.to(const ReferFriendScreen());
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_share.svg",
|
||||
"Share app".tr(),
|
||||
() {
|
||||
Share.share(
|
||||
'${'Check out Foodie, your ultimate food delivery application!'.tr()} \n\n${'Google Play:'.tr()} ${Constant.googlePlayLink} \n\n${'App Store:'.tr()} ${Constant.appStoreLink}',
|
||||
subject: 'Look what I made!'.tr(),
|
||||
);
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_rate.svg",
|
||||
"Rate the app".tr(),
|
||||
() {
|
||||
final InAppReview inAppReview =
|
||||
InAppReview.instance;
|
||||
inAppReview.requestReview();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -180,28 +343,75 @@ class ProfileScreen extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
"Communication".tr(),
|
||||
style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_chat.svg", "Store Inbox".tr(), () {
|
||||
Get.to(const RestaurantInboxScreen());
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_driver.svg", "Driver Inbox".tr(), () {
|
||||
Get.to(const DriverInboxScreen());
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_chat.svg", "Provider Inbox".tr(), () {
|
||||
Get.to(const ProviderInboxScreen());
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_restaurant_driver.svg", "Worker Inbox".tr(), () {
|
||||
Get.to(const WorkerInboxScreen());
|
||||
}),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_chat.svg",
|
||||
"Store Inbox".tr(),
|
||||
() {
|
||||
Get.to(
|
||||
const RestaurantInboxScreen(),
|
||||
);
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_driver.svg",
|
||||
"Driver Inbox".tr(),
|
||||
() {
|
||||
Get.to(const DriverInboxScreen());
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_chat.svg",
|
||||
"Provider Inbox".tr(),
|
||||
() {
|
||||
Get.to(
|
||||
const ProviderInboxScreen(),
|
||||
);
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_restaurant_driver.svg",
|
||||
"Worker Inbox".tr(),
|
||||
() {
|
||||
Get.to(const WorkerInboxScreen());
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -209,21 +419,63 @@ class ProfileScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
Text("Legal".tr(), style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500)),
|
||||
Text(
|
||||
"Legal".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 8,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_privacy_policy.svg", "Privacy Policy".tr(), () {
|
||||
Get.to(const TermsAndConditionScreen(type: "privacy"));
|
||||
}),
|
||||
cardDecoration(isDark, controller, "assets/icons/ic_tearm_condition.svg", "Terms and Conditions".tr(), () {
|
||||
Get.to(const TermsAndConditionScreen(type: "termAndCondition"));
|
||||
}),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_privacy_policy.svg",
|
||||
"Privacy Policy".tr(),
|
||||
() {
|
||||
Get.to(
|
||||
const TermsAndConditionScreen(
|
||||
type: "privacy",
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_tearm_condition.svg",
|
||||
"Terms and Conditions".tr(),
|
||||
() {
|
||||
Get.to(
|
||||
const TermsAndConditionScreen(
|
||||
type: "termAndCondition",
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -232,39 +484,74 @@ class ProfileScreen extends StatelessWidget {
|
||||
const SizedBox(height: 10),
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 6,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Constant.userModel == null
|
||||
? cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log In".tr(), () {
|
||||
Get.offAll(const LoginScreen());
|
||||
})
|
||||
: cardDecoration(isDark, controller, "assets/icons/ic_logout.svg", "Log out".tr(), () {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Log out".tr(),
|
||||
descriptions: "Are you sure you want to log out? You will need to enter your credentials to log back in.".tr(),
|
||||
positiveString: "Log out".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
positiveClick: () async {
|
||||
Constant.userModel!.fcmToken = "";
|
||||
await FireStoreUtils.updateUser(Constant.userModel!);
|
||||
Constant.userModel = null;
|
||||
await FirebaseAuth.instance.signOut();
|
||||
Get.offAll(const LoginScreen());
|
||||
},
|
||||
negativeClick: () {
|
||||
Get.back();
|
||||
},
|
||||
img: Image.asset('assets/images/ic_logout.gif', height: 50, width: 50),
|
||||
);
|
||||
},
|
||||
);
|
||||
}),
|
||||
? cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_logout.svg",
|
||||
"Log In".tr(),
|
||||
() {
|
||||
Get.offAll(const LoginScreen());
|
||||
},
|
||||
)
|
||||
: cardDecoration(
|
||||
isDark,
|
||||
controller,
|
||||
"assets/icons/ic_logout.svg",
|
||||
"Log out".tr(),
|
||||
() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Log out".tr(),
|
||||
descriptions:
|
||||
"Are you sure you want to log out? You will need to enter your credentials to log back in."
|
||||
.tr(),
|
||||
positiveString: "Log out".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
positiveClick: () async {
|
||||
Constant.userModel!.fcmToken =
|
||||
"";
|
||||
await FireStoreUtils.updateUser(
|
||||
Constant.userModel!,
|
||||
);
|
||||
Constant.userModel = null;
|
||||
await FirebaseAuth.instance
|
||||
.signOut();
|
||||
Get.offAll(
|
||||
const LoginScreen(),
|
||||
);
|
||||
},
|
||||
negativeClick: () {
|
||||
Get.back();
|
||||
},
|
||||
img: Image.asset(
|
||||
'assets/images/ic_logout.gif',
|
||||
height: 50,
|
||||
width: 50,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -273,7 +560,9 @@ class ProfileScreen extends StatelessWidget {
|
||||
Constant.userModel == null
|
||||
? const SizedBox()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 20),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 20,
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showDialog(
|
||||
@@ -281,40 +570,66 @@ class ProfileScreen extends StatelessWidget {
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Delete Account".tr(),
|
||||
descriptions: "Are you sure you want to delete your account? This action is irreversible and will permanently remove all your data.".tr(),
|
||||
descriptions:
|
||||
"Are you sure you want to delete your account? This action is irreversible and will permanently remove all your data."
|
||||
.tr(),
|
||||
positiveString: "Delete".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
positiveClick: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
await controller.deleteUserFromServer();
|
||||
await FireStoreUtils.deleteUser().then((value) {
|
||||
ShowToastDialog.showLoader(
|
||||
"Please wait...".tr(),
|
||||
);
|
||||
await controller
|
||||
.deleteUserFromServer();
|
||||
await FireStoreUtils.deleteUser().then((
|
||||
value,
|
||||
) {
|
||||
ShowToastDialog.closeLoader();
|
||||
if (value == true) {
|
||||
ShowToastDialog.showToast("Account deleted successfully".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Account deleted successfully"
|
||||
.tr(),
|
||||
);
|
||||
Get.offAll(const LoginScreen());
|
||||
} else {
|
||||
ShowToastDialog.showToast("Contact Administrator".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Contact Administrator".tr(),
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
negativeClick: () {
|
||||
Get.back();
|
||||
},
|
||||
img: Image.asset('assets/icons/delete_dialog.gif', height: 50, width: 50),
|
||||
img: Image.asset(
|
||||
'assets/icons/delete_dialog.gif',
|
||||
height: 50,
|
||||
width: 50,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_delete.svg"),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_delete.svg",
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
"Delete Account".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.danger300 : AppThemeData.danger300),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.danger300
|
||||
: AppThemeData.danger300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -324,7 +639,14 @@ class ProfileScreen extends StatelessWidget {
|
||||
child: Text(
|
||||
"V : ${Constant.appVersion}",
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 14, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -338,7 +660,13 @@ class ProfileScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Padding cardDecoration(bool isDark, MyProfileController controller, String image, String title, Function()? onPress) {
|
||||
Padding cardDecoration(
|
||||
bool isDark,
|
||||
MyProfileController controller,
|
||||
String image,
|
||||
String title,
|
||||
Function()? onPress,
|
||||
) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: InkWell(
|
||||
@@ -348,7 +676,18 @@ class ProfileScreen extends StatelessWidget {
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(image, colorFilter: title == "Log In".tr() || title == "Cashbacks".tr() ? const ColorFilter.mode(AppThemeData.success500, BlendMode.srcIn) : null, height: 24, width: 24),
|
||||
SvgPicture.asset(
|
||||
image,
|
||||
colorFilter:
|
||||
title == "Log In".tr() || title == "Cashbacks".tr()
|
||||
? const ColorFilter.mode(
|
||||
AppThemeData.success500,
|
||||
BlendMode.srcIn,
|
||||
)
|
||||
: null,
|
||||
height: 24,
|
||||
width: 24,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
@@ -362,16 +701,28 @@ class ProfileScreen extends StatelessWidget {
|
||||
? AppThemeData.danger300
|
||||
: title == "Log In".tr()
|
||||
? AppThemeData.success500
|
||||
: (isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||
: (isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800),
|
||||
),
|
||||
),
|
||||
),
|
||||
title == "Dark Mode".tr()
|
||||
? Transform.scale(
|
||||
scale: 0.8,
|
||||
child: Obx(() => CupertinoSwitch(value: controller.isDarkModeSwitch.value, activeTrackColor: AppThemeData.primary300, onChanged: controller.toggleDarkMode)),
|
||||
child: Obx(
|
||||
() => CupertinoSwitch(
|
||||
value: controller.isDarkModeSwitch.value,
|
||||
activeTrackColor: AppThemeData.primary300,
|
||||
onChanged: controller.toggleDarkMode,
|
||||
),
|
||||
),
|
||||
)
|
||||
: Icon(Icons.keyboard_arrow_right, color: isDark ? AppThemeData.greyDark700 : AppThemeData.grey700),
|
||||
: Icon(
|
||||
Icons.keyboard_arrow_right,
|
||||
color:
|
||||
isDark ? AppThemeData.greyDark700 : AppThemeData.grey700,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
@@ -27,33 +27,75 @@ class RateProductScreen extends StatelessWidget {
|
||||
init: RateProductController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Rate the item".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
title: Text(
|
||||
"Rate the item".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: Responsive.width(100, context),
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 20),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 20,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Rate for".tr(), style: TextStyle(color: isDark ? AppThemeData.grey400 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.medium)),
|
||||
Text(
|
||||
"${controller.productModel.value.name}".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 18, fontFamily: AppThemeData.semiBold),
|
||||
"Rate for".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData.grey500,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${controller.productModel.value.name}"
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
fontSize: 18,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
RatingBar.builder(
|
||||
@@ -62,42 +104,109 @@ class RateProductScreen extends StatelessWidget {
|
||||
direction: Axis.horizontal,
|
||||
itemCount: 5,
|
||||
itemSize: 26,
|
||||
unratedColor: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900,
|
||||
itemPadding: const EdgeInsets.symmetric(horizontal: 6.0),
|
||||
itemBuilder: (context, _) => const Icon(Icons.star, color: AppThemeData.warning300),
|
||||
unratedColor:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
itemPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 6.0,
|
||||
),
|
||||
itemBuilder:
|
||||
(context, _) => const Icon(
|
||||
Icons.star,
|
||||
color: AppThemeData.warning300,
|
||||
),
|
||||
onRatingUpdate: (double rate) {
|
||||
controller.ratings.value = rate;
|
||||
},
|
||||
),
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 20), child: MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 20,
|
||||
),
|
||||
child: MySeparator(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
ListView.builder(
|
||||
itemCount: controller.reviewAttributeList.length,
|
||||
itemCount:
|
||||
controller.reviewAttributeList.length,
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 2),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
controller.reviewAttributeList[index].title.toString(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16, fontFamily: AppThemeData.semiBold),
|
||||
controller
|
||||
.reviewAttributeList[index]
|
||||
.title
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontSize: 16,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
),
|
||||
RatingBar.builder(
|
||||
initialRating:
|
||||
controller.ratingModel.value.id == null ? 0.0 : controller.ratingModel.value.reviewAttributes?[controller.reviewAttributeList[index].id] ?? 0.0,
|
||||
controller
|
||||
.ratingModel
|
||||
.value
|
||||
.id ==
|
||||
null
|
||||
? 0.0
|
||||
: controller
|
||||
.ratingModel
|
||||
.value
|
||||
.reviewAttributes?[controller
|
||||
.reviewAttributeList[index]
|
||||
.id] ??
|
||||
0.0,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
itemCount: 5,
|
||||
itemSize: 18,
|
||||
unratedColor: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900,
|
||||
itemPadding: const EdgeInsets.symmetric(horizontal: 2.0),
|
||||
itemBuilder: (context, _) => const Icon(Icons.star, color: AppThemeData.warning300),
|
||||
unratedColor:
|
||||
isDark
|
||||
? AppThemeData.greyDark900
|
||||
: AppThemeData.grey900,
|
||||
itemPadding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 2.0,
|
||||
),
|
||||
itemBuilder:
|
||||
(context, _) => const Icon(
|
||||
Icons.star,
|
||||
color:
|
||||
AppThemeData.warning300,
|
||||
),
|
||||
onRatingUpdate: (double rate) {
|
||||
controller.reviewAttribute.addEntries([MapEntry(controller.reviewAttributeList[index].id.toString(), rate)]);
|
||||
controller.reviewAttribute
|
||||
.addEntries([
|
||||
MapEntry(
|
||||
controller
|
||||
.reviewAttributeList[index]
|
||||
.id
|
||||
.toString(),
|
||||
rate,
|
||||
),
|
||||
]);
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -110,34 +219,72 @@ class RateProductScreen extends StatelessWidget {
|
||||
options: RoundedRectDottedBorderOptions(
|
||||
radius: const Radius.circular(12),
|
||||
dashPattern: const [6, 6, 6, 6],
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, borderRadius: const BorderRadius.all(Radius.circular(12))),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(12),
|
||||
),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: Responsive.height(20, context),
|
||||
width: Responsive.width(90, context),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
children: [
|
||||
SvgPicture.asset('assets/icons/ic_folder.svg'),
|
||||
SvgPicture.asset(
|
||||
'assets/icons/ic_folder.svg',
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Choose a image and upload here".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.medium, fontSize: 16),
|
||||
"Choose a image and upload here"
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text("JPEG, PNG".tr(), style: TextStyle(fontSize: 12, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700, fontFamily: AppThemeData.regular)),
|
||||
Text(
|
||||
"JPEG, PNG".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey200
|
||||
: AppThemeData.grey700,
|
||||
fontFamily:
|
||||
AppThemeData.regular,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
RoundedButtonFill(
|
||||
title: "Brows Image".tr(),
|
||||
color: AppThemeData.primary50,
|
||||
width: 30,
|
||||
height: 5,
|
||||
textColor: AppThemeData.primary300,
|
||||
textColor:
|
||||
AppThemeData.primary300,
|
||||
onPress: () async {
|
||||
buildBottomSheet(context, controller);
|
||||
buildBottomSheet(
|
||||
context,
|
||||
controller,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -154,21 +301,54 @@ class RateProductScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: controller.images.length,
|
||||
itemCount:
|
||||
controller.images.length,
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.horizontal,
|
||||
scrollDirection:
|
||||
Axis.horizontal,
|
||||
// physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 5,
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
borderRadius:
|
||||
const BorderRadius.all(
|
||||
Radius.circular(
|
||||
10,
|
||||
),
|
||||
),
|
||||
child:
|
||||
(controller.images[index] is XFile)
|
||||
? Image.file(File((controller.images[index] as XFile).path), fit: BoxFit.cover, width: 80, height: 80)
|
||||
: NetworkImageWidget(imageUrl: controller.images[index]?.toString() ?? '', fit: BoxFit.cover, width: 80, height: 80),
|
||||
(controller.images[index]
|
||||
is XFile)
|
||||
? Image.file(
|
||||
File(
|
||||
(controller.images[index]
|
||||
as XFile)
|
||||
.path,
|
||||
),
|
||||
fit:
|
||||
BoxFit
|
||||
.cover,
|
||||
width: 80,
|
||||
height: 80,
|
||||
)
|
||||
: NetworkImageWidget(
|
||||
imageUrl:
|
||||
controller
|
||||
.images[index]
|
||||
?.toString() ??
|
||||
'',
|
||||
fit:
|
||||
BoxFit
|
||||
.cover,
|
||||
width: 80,
|
||||
height: 80,
|
||||
),
|
||||
// controller.images[index].runtimeType == XFile
|
||||
// ? Image.file(File(controller.images[index].path), fit: BoxFit.cover, width: 80, height: 80)
|
||||
// : NetworkImageWidget(imageUrl: controller.images[index], fit: BoxFit.cover, width: 80, height: 80),
|
||||
@@ -180,9 +360,19 @@ class RateProductScreen extends StatelessWidget {
|
||||
right: 0,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
controller.images.removeAt(index);
|
||||
controller.images
|
||||
.removeAt(
|
||||
index,
|
||||
);
|
||||
},
|
||||
child: const Icon(Icons.remove_circle, size: 28, color: AppThemeData.danger300),
|
||||
child: const Icon(
|
||||
Icons
|
||||
.remove_circle,
|
||||
size: 28,
|
||||
color:
|
||||
AppThemeData
|
||||
.danger300,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -199,26 +389,49 @@ class RateProductScreen extends StatelessWidget {
|
||||
options: RoundedRectDottedBorderOptions(
|
||||
radius: const Radius.circular(12),
|
||||
dashPattern: const [6, 6, 6, 6],
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
child: TextFormField(
|
||||
keyboardType: TextInputType.text,
|
||||
textCapitalization: TextCapitalization.sentences,
|
||||
controller: controller.commentController.value,
|
||||
textCapitalization:
|
||||
TextCapitalization.sentences,
|
||||
controller:
|
||||
controller.commentController.value,
|
||||
maxLines: 4,
|
||||
textInputAction: TextInputAction.done,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
errorStyle: const TextStyle(color: Colors.red),
|
||||
errorStyle: const TextStyle(
|
||||
color: Colors.red,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
fillColor:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
disabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
errorBorder: InputBorder.none,
|
||||
border: InputBorder.none,
|
||||
hintText: "Type comment".tr(),
|
||||
hintStyle: TextStyle(fontSize: 14, color: isDark ? AppThemeData.grey600 : AppThemeData.grey400, fontFamily: AppThemeData.regular),
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey600
|
||||
: AppThemeData.grey400,
|
||||
fontFamily: AppThemeData.regular,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -251,7 +464,10 @@ class RateProductScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Future buildBottomSheet(BuildContext context, RateProductController controller) {
|
||||
Future buildBottomSheet(
|
||||
BuildContext context,
|
||||
RateProductController controller,
|
||||
) {
|
||||
return showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
@@ -266,7 +482,15 @@ class RateProductScreen extends StatelessWidget {
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 15),
|
||||
child: Text("Please Select".tr(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.bold, fontSize: 16)),
|
||||
child: Text(
|
||||
"Please Select".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@@ -277,8 +501,17 @@ class RateProductScreen extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.camera), icon: const Icon(Icons.camera_alt, size: 32)),
|
||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("Camera".tr())),
|
||||
IconButton(
|
||||
onPressed:
|
||||
() => controller.pickFile(
|
||||
source: ImageSource.camera,
|
||||
),
|
||||
icon: const Icon(Icons.camera_alt, size: 32),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 3),
|
||||
child: Text("Camera".tr()),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -288,8 +521,20 @@ class RateProductScreen extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
IconButton(onPressed: () => controller.pickFile(source: ImageSource.gallery), icon: const Icon(Icons.photo_library_sharp, size: 32)),
|
||||
Padding(padding: const EdgeInsets.only(top: 3), child: Text("Gallery".tr())),
|
||||
IconButton(
|
||||
onPressed:
|
||||
() => controller.pickFile(
|
||||
source: ImageSource.gallery,
|
||||
),
|
||||
icon: const Icon(
|
||||
Icons.photo_library_sharp,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 3),
|
||||
child: Text("Gallery".tr()),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
@@ -30,9 +30,16 @@ class ReferFriendScreen extends StatelessWidget {
|
||||
: Container(
|
||||
width: Responsive.width(100, context),
|
||||
height: Responsive.height(100, context),
|
||||
decoration: const BoxDecoration(image: DecorationImage(image: AssetImage("assets/images/refer_friend.png"), fit: BoxFit.fill)),
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/images/refer_friend.png"),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).viewPadding.top),
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).viewPadding.top,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Column(
|
||||
@@ -42,30 +49,56 @@ class ReferFriendScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: const Icon(Icons.arrow_back, color: AppThemeData.grey50),
|
||||
child: const Icon(
|
||||
Icons.arrow_back,
|
||||
color: AppThemeData.grey50,
|
||||
),
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 60),
|
||||
Center(child: SvgPicture.asset("assets/images/referal_top.svg")),
|
||||
Center(
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/referal_top.svg",
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
"Refer your friend and earn".tr(),
|
||||
style: TextStyle(fontSize: 22, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
"${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'Each🎉'.tr()}",
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 32),
|
||||
Text(
|
||||
"Invite Friends & Businesses".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.ecommerce100
|
||||
: AppThemeData.ecommerceDark100,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -75,25 +108,60 @@ class ReferFriendScreen extends StatelessWidget {
|
||||
"${'Invite your friends to sign up with Foodie using your code, and you’ll earn'.tr()} ${Constant.amountShow(amount: Constant.sectionConstantModel!.referralAmount)} ${'after their Success the first order! 💸🍔'.tr()}"
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
gradient: const LinearGradient(begin: Alignment(0.00, -1.00), end: Alignment(0, 1), colors: [Color(0xFF271366), Color(0xFF4826B2)]),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
shadows: const [BoxShadow(color: Color(0x14FFFFFF), blurRadius: 120, offset: Offset(0, 0), spreadRadius: 0)],
|
||||
gradient: const LinearGradient(
|
||||
begin: Alignment(0.00, -1.00),
|
||||
end: Alignment(0, 1),
|
||||
colors: [
|
||||
Color(0xFF271366),
|
||||
Color(0xFF4826B2),
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(120),
|
||||
),
|
||||
shadows: const [
|
||||
BoxShadow(
|
||||
color: Color(0x14FFFFFF),
|
||||
blurRadius: 120,
|
||||
offset: Offset(0, 0),
|
||||
spreadRadius: 0,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 80, vertical: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 80,
|
||||
vertical: 16,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
controller.referralModel.value.referralCode.toString(),
|
||||
controller
|
||||
.referralModel
|
||||
.value
|
||||
.referralCode
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.ecommerce100
|
||||
: AppThemeData
|
||||
.ecommerceDark100,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -101,34 +169,74 @@ class ReferFriendScreen extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: controller.referralModel.value.referralCode.toString()));
|
||||
ShowToastDialog.showToast("Copied".tr());
|
||||
Clipboard.setData(
|
||||
ClipboardData(
|
||||
text:
|
||||
controller
|
||||
.referralModel
|
||||
.value
|
||||
.referralCode
|
||||
.toString(),
|
||||
),
|
||||
);
|
||||
ShowToastDialog.showToast(
|
||||
"Copied".tr(),
|
||||
);
|
||||
},
|
||||
child: const Icon(Icons.copy, color: AppThemeData.ecommerce100),
|
||||
child: const Icon(
|
||||
Icons.copy,
|
||||
color: AppThemeData.ecommerce100,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 40,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: Divider(thickness: 1, color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100)),
|
||||
Expanded(
|
||||
child: Divider(
|
||||
thickness: 1,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.ecommerce100
|
||||
: AppThemeData
|
||||
.ecommerceDark100,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 30,
|
||||
),
|
||||
child: Text(
|
||||
"or".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.ecommerce100
|
||||
: AppThemeData
|
||||
.ecommerceDark100,
|
||||
fontSize: 12,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(child: Divider(color: isDark ? AppThemeData.ecommerce100 : AppThemeData.ecommerceDark100)),
|
||||
Expanded(
|
||||
child: Divider(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.ecommerce100
|
||||
: AppThemeData
|
||||
.ecommerceDark100,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -11,8 +11,7 @@ import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../chat_screens/full_screen_image_viewer.dart';
|
||||
|
||||
@@ -27,12 +26,22 @@ class ReviewListScreen extends StatelessWidget {
|
||||
init: ReviewListController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Reviews".tr(), textAlign: TextAlign.start, style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
title: Text(
|
||||
"Reviews".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
body:
|
||||
controller.isLoading.value
|
||||
@@ -40,7 +49,10 @@ class ReviewListScreen extends StatelessWidget {
|
||||
: controller.ratingList.isEmpty
|
||||
? Constant.showEmptyView(message: "No Review found".tr())
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: ListView.builder(
|
||||
itemCount: controller.ratingList.length,
|
||||
itemBuilder: (context, index) {
|
||||
@@ -49,21 +61,54 @@ class ReviewListScreen extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: isDark ? AppThemeData.grey700 : AppThemeData.grey200), borderRadius: BorderRadius.circular(12)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey700
|
||||
: AppThemeData.grey200,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(ratingModel.uname.toString(), style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18, fontFamily: AppThemeData.semiBold)),
|
||||
Text(
|
||||
ratingModel.uname.toString(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 18,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: ratingModel.productId != null,
|
||||
child: FutureBuilder(
|
||||
future: FireStoreUtils.fireStore.collection(CollectionName.vendorProducts).doc(ratingModel.productId?.split('~').first).get(),
|
||||
future:
|
||||
FireStoreUtils.fireStore
|
||||
.collection(
|
||||
CollectionName.vendorProducts,
|
||||
)
|
||||
.doc(
|
||||
ratingModel.productId
|
||||
?.split('~')
|
||||
.first,
|
||||
)
|
||||
.get(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const Text('');
|
||||
} else {
|
||||
if (snapshot.hasError) {
|
||||
@@ -71,10 +116,21 @@ class ReviewListScreen extends StatelessWidget {
|
||||
} else if (snapshot.data == null) {
|
||||
return const Text('');
|
||||
} else if (snapshot.data != null) {
|
||||
ProductModel model = ProductModel.fromJson(snapshot.data!.data()!);
|
||||
ProductModel model =
|
||||
ProductModel.fromJson(
|
||||
snapshot.data!.data()!,
|
||||
);
|
||||
return Text(
|
||||
'${'Rate for'.tr()} - ${model.name ?? ''}',
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 14, fontFamily: AppThemeData.semiBold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 14,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const Text('');
|
||||
@@ -91,50 +147,101 @@ class ReviewListScreen extends StatelessWidget {
|
||||
direction: Axis.horizontal,
|
||||
itemCount: 5,
|
||||
itemSize: 18,
|
||||
itemPadding: const EdgeInsets.symmetric(horizontal: 2.0),
|
||||
itemBuilder: (context, _) => const Icon(Icons.star, color: AppThemeData.warning300),
|
||||
itemPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 2.0,
|
||||
),
|
||||
itemBuilder:
|
||||
(context, _) => const Icon(
|
||||
Icons.star,
|
||||
color: AppThemeData.warning300,
|
||||
),
|
||||
unratedColor: AppThemeData.grey400,
|
||||
onRatingUpdate: (double rate) {},
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Visibility(
|
||||
visible: ratingModel.comment != '' && ratingModel.comment != null,
|
||||
visible:
|
||||
ratingModel.comment != '' &&
|
||||
ratingModel.comment != null,
|
||||
child: Text(
|
||||
ratingModel.comment.toString(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16, fontFamily: AppThemeData.medium),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Visibility(
|
||||
visible: ratingModel.reviewAttributes != null,
|
||||
visible:
|
||||
ratingModel.reviewAttributes != null,
|
||||
child: ListView.builder(
|
||||
itemCount: ratingModel.reviewAttributes!.length,
|
||||
itemCount:
|
||||
ratingModel.reviewAttributes!.length,
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.zero,
|
||||
itemBuilder: (context, index) {
|
||||
String key = ratingModel.reviewAttributes!.keys.elementAt(index);
|
||||
dynamic value = ratingModel.reviewAttributes![key];
|
||||
String key = ratingModel
|
||||
.reviewAttributes!
|
||||
.keys
|
||||
.elementAt(index);
|
||||
dynamic value =
|
||||
ratingModel.reviewAttributes![key];
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 2),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
FutureBuilder(
|
||||
future: FireStoreUtils.fireStore.collection(CollectionName.reviewAttributes).doc(key).get(),
|
||||
future:
|
||||
FireStoreUtils.fireStore
|
||||
.collection(
|
||||
CollectionName
|
||||
.reviewAttributes,
|
||||
)
|
||||
.doc(key)
|
||||
.get(),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
if (snapshot
|
||||
.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return const Text('');
|
||||
} else {
|
||||
if (snapshot.hasError) {
|
||||
return const Text('');
|
||||
} else if (snapshot.data == null) {
|
||||
} else if (snapshot.data ==
|
||||
null) {
|
||||
return const Text('');
|
||||
} else {
|
||||
ReviewAttributeModel model = ReviewAttributeModel.fromJson(snapshot.data!.data()!);
|
||||
ReviewAttributeModel
|
||||
model =
|
||||
ReviewAttributeModel.fromJson(
|
||||
snapshot.data!
|
||||
.data()!,
|
||||
);
|
||||
return Expanded(
|
||||
child: Text(
|
||||
model.title.toString(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 16, fontFamily: AppThemeData.semiBold),
|
||||
model.title
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontSize: 16,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -143,15 +250,29 @@ class ReviewListScreen extends StatelessWidget {
|
||||
),
|
||||
RatingBar.builder(
|
||||
ignoreGestures: true,
|
||||
initialRating: value == null ? 0.0 : value ?? 0.0,
|
||||
initialRating:
|
||||
value == null
|
||||
? 0.0
|
||||
: value ?? 0.0,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
itemCount: 5,
|
||||
itemSize: 15,
|
||||
unratedColor: AppThemeData.grey400,
|
||||
itemPadding: const EdgeInsets.symmetric(horizontal: 2.0),
|
||||
itemBuilder: (context, _) => const Icon(Icons.star, color: AppThemeData.warning300),
|
||||
onRatingUpdate: (double rate) {},
|
||||
unratedColor:
|
||||
AppThemeData.grey400,
|
||||
itemPadding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 2.0,
|
||||
),
|
||||
itemBuilder:
|
||||
(context, _) => const Icon(
|
||||
Icons.star,
|
||||
color:
|
||||
AppThemeData
|
||||
.warning300,
|
||||
),
|
||||
onRatingUpdate:
|
||||
(double rate) {},
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -169,16 +290,33 @@ class ReviewListScreen extends StatelessWidget {
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(FullScreenImageViewer(imageUrl: ratingModel.photos?[index]));
|
||||
Get.to(
|
||||
FullScreenImageViewer(
|
||||
imageUrl:
|
||||
ratingModel
|
||||
.photos?[index],
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
padding: const EdgeInsets.all(
|
||||
6.0,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderRadius:
|
||||
BorderRadius.circular(10),
|
||||
child: NetworkImageWidget(
|
||||
imageUrl: ratingModel.photos?[index],
|
||||
height: Responsive.height(9, context),
|
||||
width: Responsive.height(8, context),
|
||||
imageUrl:
|
||||
ratingModel
|
||||
.photos?[index],
|
||||
height: Responsive.height(
|
||||
9,
|
||||
context,
|
||||
),
|
||||
width: Responsive.height(
|
||||
8,
|
||||
context,
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
@@ -189,8 +327,17 @@ class ReviewListScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
Constant.timestampToDateTime(ratingModel.createdAt!),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey300 : AppThemeData.grey600, fontSize: 14, fontFamily: AppThemeData.medium),
|
||||
Constant.timestampToDateTime(
|
||||
ratingModel.createdAt!,
|
||||
),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey300
|
||||
: AppThemeData.grey600,
|
||||
fontSize: 14,
|
||||
fontFamily: AppThemeData.medium,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:qr_code_dart_scan/qr_code_dart_scan.dart';
|
||||
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
@@ -24,8 +24,17 @@ class ScanQrCodeScreen extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text("Scan QR Code".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
title: Text(
|
||||
"Scan QR Code".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: QRCodeDartScanView(
|
||||
// enable scan invert qr code ( default = false)
|
||||
@@ -35,15 +44,21 @@ class ScanQrCodeScreen extends StatelessWidget {
|
||||
Get.back();
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
if (controller.allNearestRestaurant.isNotEmpty) {
|
||||
if (controller.allNearestRestaurant.where((vendor) => vendor.id == result.text).isEmpty) {
|
||||
if (controller.allNearestRestaurant
|
||||
.where((vendor) => vendor.id == result.text)
|
||||
.isEmpty) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Store is not available".tr());
|
||||
return;
|
||||
}
|
||||
VendorModel storeModel = controller.allNearestRestaurant.firstWhere((vendor) => vendor.id == result.text);
|
||||
VendorModel storeModel = controller.allNearestRestaurant
|
||||
.firstWhere((vendor) => vendor.id == result.text);
|
||||
ShowToastDialog.closeLoader();
|
||||
Get.back();
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": storeModel});
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": storeModel},
|
||||
);
|
||||
} else {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Store is not available".tr());
|
||||
|
||||
@@ -10,8 +10,7 @@ import '../../../controllers/theme_controller.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../service/fire_store_utils.dart';
|
||||
import '../../../widget/restaurant_image_view.dart';
|
||||
import '../restaurant_details_screen/restaurant_details_screen.dart';
|
||||
@@ -28,21 +27,40 @@ class SearchScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true ? "Find your favorite products and nearby stores" : "Search Item & Store".tr(),
|
||||
Constant.sectionConstantModel?.name?.toLowerCase().contains(
|
||||
'restaurants',
|
||||
) ==
|
||||
true
|
||||
? "Find your favorite products and nearby stores"
|
||||
: "Search Item & Store".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(55),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: TextFieldWidget(
|
||||
hintText: Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true ? 'Find your favorite products and nearby stores'.tr() : 'Search the store and item'.tr(),
|
||||
prefix: Padding(padding: const EdgeInsets.symmetric(horizontal: 16), child: SvgPicture.asset("assets/icons/ic_search.svg")),
|
||||
hintText:
|
||||
Constant.sectionConstantModel?.name
|
||||
?.toLowerCase()
|
||||
.contains('restaurants') ==
|
||||
true
|
||||
? 'Find your favorite products and nearby stores'.tr()
|
||||
: 'Search the store and item'.tr(),
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: SvgPicture.asset("assets/icons/ic_search.svg"),
|
||||
),
|
||||
controller: null,
|
||||
onchange: (value) {
|
||||
controller.onSearchTextChanged(value);
|
||||
@@ -55,7 +73,10 @@ class SearchScreen extends StatelessWidget {
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -68,9 +89,19 @@ class SearchScreen extends StatelessWidget {
|
||||
Text(
|
||||
"Store".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
child: Divider(),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.symmetric(vertical: 10), child: Divider()),
|
||||
],
|
||||
),
|
||||
ListView.builder(
|
||||
@@ -78,33 +109,74 @@ class SearchScreen extends StatelessWidget {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.vendorSearchList.length,
|
||||
itemBuilder: (context, index) {
|
||||
VendorModel vendorModel = controller.vendorSearchList[index];
|
||||
VendorModel vendorModel =
|
||||
controller.vendorSearchList[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Container(
|
||||
decoration: ShapeDecoration(color: isDark ? AppThemeData.grey900 : AppThemeData.grey50, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))),
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey900
|
||||
: AppThemeData.grey50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.only(topLeft: Radius.circular(16), topRight: Radius.circular(16)),
|
||||
borderRadius:
|
||||
const BorderRadius.only(
|
||||
topLeft: Radius.circular(
|
||||
16,
|
||||
),
|
||||
topRight: Radius.circular(
|
||||
16,
|
||||
),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
RestaurantImageView(vendorModel: vendorModel),
|
||||
RestaurantImageView(
|
||||
vendorModel: vendorModel,
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(20, context),
|
||||
width: Responsive.width(100, context),
|
||||
height: Responsive.height(
|
||||
20,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(
|
||||
100,
|
||||
context,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(-0.00, -1.00),
|
||||
end: const Alignment(0, 1),
|
||||
colors: [Colors.black.withOpacity(0), const Color(0xFF111827)],
|
||||
begin: const Alignment(
|
||||
-0.00,
|
||||
-1.00,
|
||||
),
|
||||
end: const Alignment(
|
||||
0,
|
||||
1,
|
||||
),
|
||||
colors: [
|
||||
Colors.black
|
||||
.withOpacity(0),
|
||||
const Color(
|
||||
0xFF111827,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -112,53 +184,124 @@ class SearchScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Transform.translate(
|
||||
offset: Offset(Responsive.width(-3, context), Responsive.height(17.5, context)),
|
||||
offset: Offset(
|
||||
Responsive.width(-3, context),
|
||||
Responsive.height(
|
||||
17.5,
|
||||
context,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
children: [
|
||||
Visibility(
|
||||
visible: (vendorModel.isSelfDelivery == true && Constant.isSelfDeliveryFeature == true),
|
||||
visible:
|
||||
(vendorModel.isSelfDelivery ==
|
||||
true &&
|
||||
Constant.isSelfDeliveryFeature ==
|
||||
true),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppThemeData.success300,
|
||||
borderRadius: BorderRadius.circular(120), // Optional
|
||||
color:
|
||||
AppThemeData
|
||||
.success300,
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
), // Optional
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||
const SizedBox(width: 5),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_free_delivery.svg",
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(fontSize: 14, color: AppThemeData.success300, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
"Free Delivery"
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color:
|
||||
AppThemeData
|
||||
.success300,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const SizedBox(
|
||||
width: 6,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.primary600 : AppThemeData.primary50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary600
|
||||
: AppThemeData
|
||||
.primary50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_star.svg", colorFilter: ColorFilter.mode(AppThemeData.primary300, BlendMode.srcIn)),
|
||||
const SizedBox(width: 5),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.primary300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount!.toStringAsFixed(0), reviewSum: vendorModel.reviewsSum.toString())} (${vendorModel.reviewsCount!.toStringAsFixed(0)})",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.primary300
|
||||
: AppThemeData
|
||||
.primary300,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -166,22 +309,54 @@ class SearchScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 7),
|
||||
padding:
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
vertical: 7,
|
||||
),
|
||||
decoration: ShapeDecoration(
|
||||
color: isDark ? AppThemeData.ecommerce600 : AppThemeData.ecommerce50,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(120)),
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce600
|
||||
: AppThemeData
|
||||
.ecommerce50,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
120,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_map_distance.svg", colorFilter: ColorFilter.mode(AppThemeData.ecommerce300, BlendMode.srcIn)),
|
||||
const SizedBox(width: 5),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_map_distance.svg",
|
||||
colorFilter:
|
||||
ColorFilter.mode(
|
||||
AppThemeData
|
||||
.ecommerce300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"${Constant.getDistance(lat1: vendorModel.latitude.toString(), lng1: vendorModel.longitude.toString(), lat2: Constant.selectedLocation.location!.latitude.toString(), lng2: Constant.selectedLocation.location!.longitude.toString())} ${Constant.distanceType}",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: isDark ? AppThemeData.ecommerce300 : AppThemeData.ecommerce300,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.ecommerce300
|
||||
: AppThemeData
|
||||
.ecommerce300,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -194,9 +369,12 @@ class SearchScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
vendorModel.title.toString(),
|
||||
@@ -204,9 +382,15 @@ class SearchScreen extends StatelessWidget {
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
fontFamily:
|
||||
AppThemeData.semiBold,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
@@ -214,10 +398,16 @@ class SearchScreen extends StatelessWidget {
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.medium,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
fontFamily:
|
||||
AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: isDark ? AppThemeData.grey400 : AppThemeData.grey400,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey400
|
||||
: AppThemeData
|
||||
.grey400,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -239,9 +429,19 @@ class SearchScreen extends StatelessWidget {
|
||||
Text(
|
||||
"Items".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
const Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
child: Divider(),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.symmetric(vertical: 10), child: Divider()),
|
||||
],
|
||||
),
|
||||
ListView.builder(
|
||||
@@ -249,15 +449,19 @@ class SearchScreen extends StatelessWidget {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.productSearchList.length,
|
||||
itemBuilder: (context, index) {
|
||||
ProductModel productModel = controller.productSearchList[index];
|
||||
ProductModel productModel =
|
||||
controller.productSearchList[index];
|
||||
return FutureBuilder(
|
||||
future: getPrice(productModel),
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.waiting) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return Constant.loader();
|
||||
} else {
|
||||
if (snapshot.hasError) {
|
||||
return Center(child: Text('Error: ${snapshot.error}'));
|
||||
return Center(
|
||||
child: Text('Error: ${snapshot.error}'),
|
||||
);
|
||||
} else if (snapshot.data == null) {
|
||||
return const SizedBox();
|
||||
} else {
|
||||
@@ -266,36 +470,79 @@ class SearchScreen extends StatelessWidget {
|
||||
String disPrice = map['disPrice'];
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
await FireStoreUtils.getVendorById(productModel.vendorID.toString()).then((value) {
|
||||
await FireStoreUtils.getVendorById(
|
||||
productModel.vendorID.toString(),
|
||||
).then((value) {
|
||||
if (value != null) {
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": value});
|
||||
Get.to(
|
||||
const RestaurantDetailsScreen(),
|
||||
arguments: {
|
||||
"vendorModel": value,
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
padding: const EdgeInsets.only(
|
||||
bottom: 20,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Constant.sectionConstantModel!.isProductDetails == false
|
||||
Constant
|
||||
.sectionConstantModel!
|
||||
.isProductDetails ==
|
||||
false
|
||||
? SizedBox()
|
||||
: productModel.nonveg == true || productModel.veg == true
|
||||
: productModel.nonveg ==
|
||||
true ||
|
||||
productModel.veg ==
|
||||
true
|
||||
? Row(
|
||||
children: [
|
||||
productModel.nonveg == true ? SvgPicture.asset("assets/icons/ic_nonveg.svg") : SvgPicture.asset("assets/icons/ic_veg.svg"),
|
||||
const SizedBox(width: 5),
|
||||
productModel.nonveg ==
|
||||
true
|
||||
? SvgPicture.asset(
|
||||
"assets/icons/ic_nonveg.svg",
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
"assets/icons/ic_veg.svg",
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
productModel.nonveg == true ? "Non Veg.".tr() : "Pure veg.".tr(),
|
||||
productModel.nonveg ==
|
||||
true
|
||||
? "Non Veg."
|
||||
.tr()
|
||||
: "Pure veg."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color: productModel.nonveg == true ? AppThemeData.danger300 : AppThemeData.success400,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
productModel.nonveg ==
|
||||
true
|
||||
? AppThemeData
|
||||
.danger300
|
||||
: AppThemeData
|
||||
.success400,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -303,56 +550,129 @@ class SearchScreen extends StatelessWidget {
|
||||
: SizedBox(),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
productModel.name.toString(),
|
||||
productModel.name
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
double.parse(disPrice) <= 0
|
||||
? Text(
|
||||
Constant.amountShow(amount: price),
|
||||
Constant.amountShow(
|
||||
amount: price,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
)
|
||||
: Row(
|
||||
children: [
|
||||
Text(
|
||||
Constant.amountShow(amount: disPrice),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
disPrice,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: price),
|
||||
Constant.amountShow(
|
||||
amount: price,
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
decoration: TextDecoration.lineThrough,
|
||||
decorationColor: isDark ? AppThemeData.grey500 : AppThemeData.grey400,
|
||||
color: isDark ? AppThemeData.grey500 : AppThemeData.grey400,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
decoration:
|
||||
TextDecoration
|
||||
.lineThrough,
|
||||
decorationColor:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey500
|
||||
: AppThemeData
|
||||
.grey400,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey500
|
||||
: AppThemeData
|
||||
.grey400,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.semiBold,
|
||||
fontWeight:
|
||||
FontWeight
|
||||
.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
SvgPicture.asset("assets/icons/ic_star.svg", colorFilter: const ColorFilter.mode(AppThemeData.warning300, BlendMode.srcIn)),
|
||||
const SizedBox(width: 5),
|
||||
SvgPicture.asset(
|
||||
"assets/icons/ic_star.svg",
|
||||
colorFilter:
|
||||
const ColorFilter.mode(
|
||||
AppThemeData
|
||||
.warning300,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: productModel.reviewsCount!.toStringAsFixed(0), reviewSum: productModel.reviewsSum.toString())} (${productModel.reviewsCount!.toStringAsFixed(0)})",
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.regular,
|
||||
fontWeight:
|
||||
FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -360,33 +680,73 @@ class SearchScreen extends StatelessWidget {
|
||||
"${productModel.description}",
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
overflow:
|
||||
TextOverflow
|
||||
.ellipsis,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData
|
||||
.grey50
|
||||
: AppThemeData
|
||||
.grey900,
|
||||
fontFamily:
|
||||
AppThemeData
|
||||
.regular,
|
||||
fontWeight:
|
||||
FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
borderRadius:
|
||||
const BorderRadius.all(
|
||||
Radius.circular(16),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
NetworkImageWidget(
|
||||
imageUrl: productModel.photo.toString(),
|
||||
imageUrl:
|
||||
productModel.photo
|
||||
.toString(),
|
||||
fit: BoxFit.cover,
|
||||
height: Responsive.height(16, context),
|
||||
width: Responsive.width(34, context),
|
||||
height: Responsive.height(
|
||||
16,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(
|
||||
34,
|
||||
context,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: Responsive.height(16, context),
|
||||
width: Responsive.width(34, context),
|
||||
height: Responsive.height(
|
||||
16,
|
||||
context,
|
||||
),
|
||||
width: Responsive.width(
|
||||
34,
|
||||
context,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(-0.00, -1.00),
|
||||
end: const Alignment(0, 1),
|
||||
colors: [Colors.black.withOpacity(0), const Color(0xFF111827)],
|
||||
begin:
|
||||
const Alignment(
|
||||
-0.00,
|
||||
-1.00,
|
||||
),
|
||||
end: const Alignment(
|
||||
0,
|
||||
1,
|
||||
),
|
||||
colors: [
|
||||
Colors.black
|
||||
.withOpacity(0),
|
||||
const Color(
|
||||
0xFF111827,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -423,24 +783,56 @@ class SearchScreen extends StatelessWidget {
|
||||
print(productModel.price);
|
||||
print(productModel.disPrice);
|
||||
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel.vendorID.toString());
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
|
||||
productModel.vendorID.toString(),
|
||||
);
|
||||
if (productModel.itemAttribute != null) {
|
||||
if (productModel.itemAttribute!.attributes!.isNotEmpty) {
|
||||
for (var element in productModel.itemAttribute!.attributes!) {
|
||||
if (element.attributeOptions!.isNotEmpty) {
|
||||
selectedVariants.add(productModel.itemAttribute!.attributes![productModel.itemAttribute!.attributes!.indexOf(element)].attributeOptions![0].toString());
|
||||
selectedIndexVariants.add('${productModel.itemAttribute!.attributes!.indexOf(element)} _${productModel.itemAttribute!.attributes![0].attributeOptions![0].toString()}');
|
||||
selectedIndexArray.add('${productModel.itemAttribute!.attributes!.indexOf(element)}_0');
|
||||
selectedVariants.add(
|
||||
productModel
|
||||
.itemAttribute!
|
||||
.attributes![productModel.itemAttribute!.attributes!.indexOf(
|
||||
element,
|
||||
)]
|
||||
.attributeOptions![0]
|
||||
.toString(),
|
||||
);
|
||||
selectedIndexVariants.add(
|
||||
'${productModel.itemAttribute!.attributes!.indexOf(element)} _${productModel.itemAttribute!.attributes![0].attributeOptions![0].toString()}',
|
||||
);
|
||||
selectedIndexArray.add(
|
||||
'${productModel.itemAttribute!.attributes!.indexOf(element)}_0',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (productModel.itemAttribute!.variants!.where((element) => element.variantSku == selectedVariants.join('-')).isNotEmpty) {
|
||||
price = Constant.productCommissionPrice(vendorModel!, productModel.itemAttribute!.variants!.where((element) => element.variantSku == selectedVariants.join('-')).first.variantPrice ?? '0');
|
||||
if (productModel.itemAttribute!.variants!
|
||||
.where((element) => element.variantSku == selectedVariants.join('-'))
|
||||
.isNotEmpty) {
|
||||
price = Constant.productCommissionPrice(
|
||||
vendorModel!,
|
||||
productModel.itemAttribute!.variants!
|
||||
.where(
|
||||
(element) =>
|
||||
element.variantSku == selectedVariants.join('-'),
|
||||
)
|
||||
.first
|
||||
.variantPrice ??
|
||||
'0',
|
||||
);
|
||||
disPrice = Constant.productCommissionPrice(vendorModel, '0');
|
||||
}
|
||||
} else {
|
||||
price = Constant.productCommissionPrice(vendorModel!, productModel.price.toString());
|
||||
disPrice = Constant.productCommissionPrice(vendorModel, productModel.disPrice.toString());
|
||||
price = Constant.productCommissionPrice(
|
||||
vendorModel!,
|
||||
productModel.price.toString(),
|
||||
);
|
||||
disPrice = Constant.productCommissionPrice(
|
||||
vendorModel,
|
||||
productModel.disPrice.toString(),
|
||||
);
|
||||
}
|
||||
|
||||
return {'price': price, 'disPrice': disPrice};
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:customer/constant/constant.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
|
||||
@@ -26,18 +26,39 @@ class TermsAndConditionScreen extends StatelessWidget {
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Icon(Icons.chevron_left_outlined, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
child: Icon(
|
||||
Icons.chevron_left_outlined,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
type == "privacy" ? "Privacy Policy".tr() : "Terms & Conditions".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontFamily: AppThemeData.bold, fontSize: 18),
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.grey100 : AppThemeData.grey800,
|
||||
fontFamily: AppThemeData.bold,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
elevation: 0,
|
||||
bottom: PreferredSize(preferredSize: const Size.fromHeight(4.0), child: Container(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200, height: 4.0)),
|
||||
bottom: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(4.0),
|
||||
child: Container(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
height: 4.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
|
||||
child: SingleChildScrollView(child: Html(shrinkWrap: true, data: type == "privacy" ? Constant.privacyPolicy : Constant.termsAndConditions)),
|
||||
child: SingleChildScrollView(
|
||||
child: Html(
|
||||
shrinkWrap: true,
|
||||
data:
|
||||
type == "privacy"
|
||||
? Constant.privacyPolicy
|
||||
: Constant.termsAndConditions,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:customer/themes/text_field_widget.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import '../../../themes/show_toast_dialog.dart';
|
||||
|
||||
@@ -25,10 +25,19 @@ class PaymentListScreen extends StatelessWidget {
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text("Top up Wallet".tr(), style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500)),
|
||||
title: Text(
|
||||
"Top up Wallet".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -40,40 +49,152 @@ class PaymentListScreen extends StatelessWidget {
|
||||
title: 'Amount'.tr(),
|
||||
hintText: 'Enter Amount'.tr(),
|
||||
controller: controller.topUpAmountController.value,
|
||||
textInputType: const TextInputType.numberWithOptions(decimal: true, signed: true),
|
||||
prefix: Padding(padding: const EdgeInsets.all(12.0), child: Text(Constant.currencyModel!.symbol.toString(), style: const TextStyle(fontSize: 20, color: AppThemeData.grey800))),
|
||||
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]'))],
|
||||
textInputType: const TextInputType.numberWithOptions(
|
||||
decimal: true,
|
||||
signed: true,
|
||||
),
|
||||
prefix: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Text(
|
||||
Constant.currencyModel!.symbol.toString(),
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
color: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.allow(RegExp('[0-9]')),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
"Select Top up Options".tr(),
|
||||
style: TextStyle(fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color:
|
||||
isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(borderRadius: const BorderRadius.all(Radius.circular(20)), color: isDark ? AppThemeData.grey900 : AppThemeData.grey50),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
color:
|
||||
isDark ? AppThemeData.grey900 : AppThemeData.grey50,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Visibility(visible: controller.stripeModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.stripe, isDark, "assets/images/stripe.png")),
|
||||
Visibility(visible: controller.payPalModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.paypal, isDark, "assets/images/paypal.png")),
|
||||
Visibility(visible: controller.payStackModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.payStack, isDark, "assets/images/paystack.png")),
|
||||
Visibility(
|
||||
visible: controller.mercadoPagoModel.value.isEnabled == true,
|
||||
child: cardDecoration(controller, PaymentGateway.mercadoPago, isDark, "assets/images/mercado-pago.png"),
|
||||
visible:
|
||||
controller.stripeModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.stripe,
|
||||
isDark,
|
||||
"assets/images/stripe.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.flutterWaveModel.value.isEnable == true,
|
||||
child: cardDecoration(controller, PaymentGateway.flutterWave, isDark, "assets/images/flutterwave_logo.png"),
|
||||
visible:
|
||||
controller.payPalModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.paypal,
|
||||
isDark,
|
||||
"assets/images/paypal.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.payStackModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payStack,
|
||||
isDark,
|
||||
"assets/images/paystack.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.mercadoPagoModel.value.isEnabled ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.mercadoPago,
|
||||
isDark,
|
||||
"assets/images/mercado-pago.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.flutterWaveModel.value.isEnable ==
|
||||
true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.flutterWave,
|
||||
isDark,
|
||||
"assets/images/flutterwave_logo.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.payFastModel.value.isEnable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.payFast,
|
||||
isDark,
|
||||
"assets/images/payfast.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.razorPayModel.value.isEnabled == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.razorpay,
|
||||
isDark,
|
||||
"assets/images/razorpay.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.midTransModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.midTrans,
|
||||
isDark,
|
||||
"assets/images/midtrans.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible:
|
||||
controller.orangeMoneyModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.orangeMoney,
|
||||
isDark,
|
||||
"assets/images/orange_money.png",
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: controller.xenditModel.value.enable == true,
|
||||
child: cardDecoration(
|
||||
controller,
|
||||
PaymentGateway.xendit,
|
||||
isDark,
|
||||
"assets/images/xendit.png",
|
||||
),
|
||||
),
|
||||
Visibility(visible: controller.payFastModel.value.isEnable == true, child: cardDecoration(controller, PaymentGateway.payFast, isDark, "assets/images/payfast.png")),
|
||||
Visibility(visible: controller.razorPayModel.value.isEnabled == true, child: cardDecoration(controller, PaymentGateway.razorpay, isDark, "assets/images/razorpay.png")),
|
||||
Visibility(visible: controller.midTransModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.midTrans, isDark, "assets/images/midtrans.png")),
|
||||
Visibility(visible: controller.orangeMoneyModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.orangeMoney, isDark, "assets/images/orange_money.png")),
|
||||
Visibility(visible: controller.xenditModel.value.enable == true, child: cardDecoration(controller, PaymentGateway.xendit, isDark, "assets/images/xendit.png")),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -96,40 +217,101 @@ class PaymentListScreen extends StatelessWidget {
|
||||
if (controller.topUpAmountController.value.text.isEmpty) {
|
||||
ShowToastDialog.showToast("Please Enter Amount".tr());
|
||||
} else {
|
||||
if (double.parse(controller.topUpAmountController.value.text) >= double.parse(Constant.minimumAmountToDeposit.toString())) {
|
||||
if (controller.selectedPaymentMethod.value == PaymentGateway.stripe.name) {
|
||||
controller.stripeMakePayment(amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.paypal.name) {
|
||||
controller.paypalPaymentSheet(controller.topUpAmountController.value.text, context);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payStack.name) {
|
||||
controller.payStackPayment(controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.mercadoPago.name) {
|
||||
controller.mercadoPagoMakePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.flutterWave.name) {
|
||||
controller.flutterWaveInitiatePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.payFast.name) {
|
||||
controller.payFastPayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.midTrans.name) {
|
||||
controller.midtransMakePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.orangeMoney.name) {
|
||||
controller.orangeMakePayment(context: context, amount: controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.xendit.name) {
|
||||
controller.xenditPayment(context, controller.topUpAmountController.value.text);
|
||||
} else if (controller.selectedPaymentMethod.value == PaymentGateway.razorpay.name) {
|
||||
RazorPayController().createOrderRazorPay(amount: double.parse(controller.topUpAmountController.value.text), razorpayModel: controller.razorPayModel.value).then((value) {
|
||||
if (value == null) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
|
||||
} else {
|
||||
CreateRazorPayOrderModel result = value;
|
||||
controller.openCheckout(amount: controller.topUpAmountController.value.text, orderId: result.id);
|
||||
}
|
||||
});
|
||||
if (double.parse(
|
||||
controller.topUpAmountController.value.text,
|
||||
) >=
|
||||
double.parse(
|
||||
Constant.minimumAmountToDeposit.toString(),
|
||||
)) {
|
||||
if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.stripe.name) {
|
||||
controller.stripeMakePayment(
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.paypal.name) {
|
||||
controller.paypalPaymentSheet(
|
||||
controller.topUpAmountController.value.text,
|
||||
context,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.payStack.name) {
|
||||
controller.payStackPayment(
|
||||
controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.mercadoPago.name) {
|
||||
controller.mercadoPagoMakePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.flutterWave.name) {
|
||||
controller.flutterWaveInitiatePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.payFast.name) {
|
||||
controller.payFastPayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.midTrans.name) {
|
||||
controller.midtransMakePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.orangeMoney.name) {
|
||||
controller.orangeMakePayment(
|
||||
context: context,
|
||||
amount: controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.xendit.name) {
|
||||
controller.xenditPayment(
|
||||
context,
|
||||
controller.topUpAmountController.value.text,
|
||||
);
|
||||
} else if (controller.selectedPaymentMethod.value ==
|
||||
PaymentGateway.razorpay.name) {
|
||||
RazorPayController()
|
||||
.createOrderRazorPay(
|
||||
amount: double.parse(
|
||||
controller.topUpAmountController.value.text,
|
||||
),
|
||||
razorpayModel: controller.razorPayModel.value,
|
||||
)
|
||||
.then((value) {
|
||||
if (value == null) {
|
||||
Get.back();
|
||||
ShowToastDialog.showToast(
|
||||
"Something went wrong, please contact admin."
|
||||
.tr(),
|
||||
);
|
||||
} else {
|
||||
CreateRazorPayOrderModel result = value;
|
||||
controller.openCheckout(
|
||||
amount:
|
||||
controller
|
||||
.topUpAmountController
|
||||
.value
|
||||
.text,
|
||||
orderId: result.id,
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ShowToastDialog.showToast("Please select payment method".tr());
|
||||
ShowToastDialog.showToast(
|
||||
"Please select payment method".tr(),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
ShowToastDialog.showToast("${'Please Enter minimum amount of'.tr()} ${Constant.amountShow(amount: Constant.minimumAmountToDeposit)}");
|
||||
ShowToastDialog.showToast(
|
||||
"${'Please Enter minimum amount of'.tr()} ${Constant.amountShow(amount: Constant.minimumAmountToDeposit)}",
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -141,7 +323,12 @@ class PaymentListScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Obx cardDecoration(WalletController controller, PaymentGateway value, isDark, String image) {
|
||||
Obx cardDecoration(
|
||||
WalletController controller,
|
||||
PaymentGateway value,
|
||||
isDark,
|
||||
String image,
|
||||
) {
|
||||
return Obx(
|
||||
() => Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
@@ -154,22 +341,35 @@ class PaymentListScreen extends StatelessWidget {
|
||||
Container(
|
||||
width: 50,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(shape: RoundedRectangleBorder(side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)), borderRadius: BorderRadius.circular(8))),
|
||||
child: Padding(padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0), child: Image.asset(image)),
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFFE5E7EB)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(value.name == "payFast" ? 0 : 8.0),
|
||||
child: Image.asset(image),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
value.name.capitalizeString(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontSize: 16,
|
||||
color: isDark ? AppThemeData.grey50 : AppThemeData.grey900,
|
||||
),
|
||||
),
|
||||
),
|
||||
const Expanded(child: SizedBox()),
|
||||
Radio(
|
||||
value: value.name,
|
||||
groupValue: controller.selectedPaymentMethod.value,
|
||||
activeColor: isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
activeColor:
|
||||
isDark ? AppThemeData.primary300 : AppThemeData.primary300,
|
||||
onChanged: (value) {
|
||||
controller.selectedPaymentMethod.value = value.toString();
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ import '../../rental_service/rental_order_details_screen.dart';
|
||||
import '../order_list_screen/order_details_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
|
||||
class WalletScreen extends StatelessWidget {
|
||||
const WalletScreen({super.key});
|
||||
@@ -36,7 +36,8 @@ class WalletScreen extends StatelessWidget {
|
||||
init: WalletController(),
|
||||
builder: (controller) {
|
||||
return Scaffold(
|
||||
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
backgroundColor:
|
||||
isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
|
||||
body:
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
@@ -49,12 +50,30 @@ class WalletScreen extends StatelessWidget {
|
||||
children: [
|
||||
Image.asset("assets/images/login.gif", height: 120),
|
||||
const SizedBox(height: 12),
|
||||
Text("Please Log In to Continue".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||
Text(
|
||||
"Please Log In to Continue".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
fontSize: 22,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"You’re not logged in. Please sign in to access your account and explore all features.".tr(),
|
||||
"You’re not logged in. Please sign in to access your account and explore all features."
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey500,
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
RoundedButtonFill(
|
||||
@@ -71,7 +90,9 @@ class WalletScreen extends StatelessWidget {
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: EdgeInsets.only(top: MediaQuery.of(context).viewPadding.top),
|
||||
padding: EdgeInsets.only(
|
||||
top: MediaQuery.of(context).viewPadding.top,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
@@ -79,20 +100,39 @@ class WalletScreen extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"My Wallet".tr(),
|
||||
style: TextStyle(fontSize: 24, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Keep track of your balance, transactions, and payment methods all in one place.".tr(),
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontFamily: AppThemeData.regular, fontWeight: FontWeight.w400),
|
||||
"Keep track of your balance, transactions, and payment methods all in one place."
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey900,
|
||||
fontFamily: AppThemeData.regular,
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -102,34 +142,66 @@ class WalletScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
),
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
image: DecorationImage(image: AssetImage("assets/images/wallet.png"), fit: BoxFit.fill),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(20),
|
||||
),
|
||||
image: DecorationImage(
|
||||
image: AssetImage(
|
||||
"assets/images/wallet.png",
|
||||
),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 20,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
"My Wallet".tr(),
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: isDark ? AppThemeData.primary100 : AppThemeData.primary100,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.primary100
|
||||
: AppThemeData.primary100,
|
||||
fontSize: 16,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.regular,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: controller.userModel.value.walletAmount.toString()),
|
||||
Constant.amountShow(
|
||||
amount:
|
||||
controller
|
||||
.userModel
|
||||
.value
|
||||
.walletAmount
|
||||
.toString(),
|
||||
),
|
||||
maxLines: 1,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 40, overflow: TextOverflow.ellipsis, fontFamily: AppThemeData.bold),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey50
|
||||
: AppThemeData.grey50,
|
||||
fontSize: 40,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 80),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 80,
|
||||
),
|
||||
child: RoundedButtonFill(
|
||||
title: "Top up".tr(),
|
||||
color: AppThemeData.warning300,
|
||||
@@ -149,15 +221,30 @@ class WalletScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child:
|
||||
controller.walletTransactionList.isEmpty
|
||||
? Constant.showEmptyView(message: "Transaction not found".tr())
|
||||
? Constant.showEmptyView(
|
||||
message: "Transaction not found".tr(),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.zero,
|
||||
itemCount: controller.walletTransactionList.length,
|
||||
itemCount:
|
||||
controller
|
||||
.walletTransactionList
|
||||
.length,
|
||||
itemBuilder: (context, index) {
|
||||
WalletTransactionModel walletTractionModel = controller.walletTransactionList[index];
|
||||
return transactionCard(controller, isDark, walletTractionModel);
|
||||
WalletTransactionModel
|
||||
walletTractionModel =
|
||||
controller
|
||||
.walletTransactionList[index];
|
||||
return transactionCard(
|
||||
controller,
|
||||
isDark,
|
||||
walletTractionModel,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -170,32 +257,54 @@ class WalletScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Column transactionCard(WalletController controller, isDark, WalletTransactionModel transactionModel) {
|
||||
Column transactionCard(
|
||||
WalletController controller,
|
||||
isDark,
|
||||
WalletTransactionModel transactionModel,
|
||||
) {
|
||||
return Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
final orderId = transactionModel.orderId.toString();
|
||||
final orderData = await FireStoreUtils.getOrderByIdFromAllCollections(orderId);
|
||||
final orderData =
|
||||
await FireStoreUtils.getOrderByIdFromAllCollections(orderId);
|
||||
|
||||
if (orderData != null) {
|
||||
final collection = orderData['collection_name'];
|
||||
|
||||
switch (collection) {
|
||||
case CollectionName.parcelOrders:
|
||||
Get.to(const ParcelOrderDetails(), arguments: ParcelOrderModel.fromJson(orderData));
|
||||
Get.to(
|
||||
const ParcelOrderDetails(),
|
||||
arguments: ParcelOrderModel.fromJson(orderData),
|
||||
);
|
||||
break;
|
||||
case CollectionName.providerOrders:
|
||||
Get.to(const OnDemandOrderDetailsScreen(), arguments: OnProviderOrderModel.fromJson(orderData));
|
||||
Get.to(
|
||||
const OnDemandOrderDetailsScreen(),
|
||||
arguments: OnProviderOrderModel.fromJson(orderData),
|
||||
);
|
||||
break;
|
||||
case CollectionName.rentalOrders:
|
||||
Get.to(() => RentalOrderDetailsScreen(), arguments: RentalOrderModel.fromJson(orderData));
|
||||
Get.to(
|
||||
() => RentalOrderDetailsScreen(),
|
||||
arguments: RentalOrderModel.fromJson(orderData),
|
||||
);
|
||||
break;
|
||||
case CollectionName.rides:
|
||||
Get.to(const CabOrderDetails(), arguments: {"cabOrderModel": CabOrderModel.fromJson(orderData)});
|
||||
Get.to(
|
||||
const CabOrderDetails(),
|
||||
arguments: {
|
||||
"cabOrderModel": CabOrderModel.fromJson(orderData),
|
||||
},
|
||||
);
|
||||
break;
|
||||
case CollectionName.vendorOrders:
|
||||
Get.to(const OrderDetailsScreen(), arguments: {"orderModel": OrderModel.fromJson(orderData)});
|
||||
Get.to(
|
||||
const OrderDetailsScreen(),
|
||||
arguments: {"orderModel": OrderModel.fromJson(orderData)},
|
||||
);
|
||||
break;
|
||||
default:
|
||||
ShowToastDialog.showToast("Order details not available".tr());
|
||||
@@ -220,14 +329,31 @@ class WalletScreen extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(side: BorderSide(width: 1, color: isDark ? AppThemeData.grey800 : AppThemeData.grey100), borderRadius: BorderRadius.circular(8)),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(
|
||||
width: 1,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey800
|
||||
: AppThemeData.grey100,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child:
|
||||
transactionModel.isTopup == false
|
||||
? SvgPicture.asset("assets/icons/ic_debit.svg", height: 16, width: 16)
|
||||
: SvgPicture.asset("assets/icons/ic_credit.svg", height: 16, width: 16),
|
||||
? SvgPicture.asset(
|
||||
"assets/icons/ic_debit.svg",
|
||||
height: 16,
|
||||
width: 16,
|
||||
)
|
||||
: SvgPicture.asset(
|
||||
"assets/icons/ic_credit.svg",
|
||||
height: 16,
|
||||
width: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
@@ -240,19 +366,44 @@ class WalletScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
transactionModel.note.toString(),
|
||||
style: TextStyle(fontSize: 16, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600, color: isDark ? AppThemeData.grey100 : AppThemeData.grey800),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey100
|
||||
: AppThemeData.grey800,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Constant.amountShow(amount: transactionModel.amount.toString()),
|
||||
style: TextStyle(fontSize: 16, fontFamily: AppThemeData.medium, color: transactionModel.isTopup == true ? AppThemeData.success400 : AppThemeData.danger300),
|
||||
Constant.amountShow(
|
||||
amount: transactionModel.amount.toString(),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontFamily: AppThemeData.medium,
|
||||
color:
|
||||
transactionModel.isTopup == true
|
||||
? AppThemeData.success400
|
||||
: AppThemeData.danger300,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
Constant.timestampToDateTime(transactionModel.date!),
|
||||
style: TextStyle(fontSize: 12, fontFamily: AppThemeData.medium, fontWeight: FontWeight.w500, color: isDark ? AppThemeData.grey200 : AppThemeData.grey700),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontFamily: AppThemeData.medium,
|
||||
fontWeight: FontWeight.w500,
|
||||
color:
|
||||
isDark
|
||||
? AppThemeData.grey200
|
||||
: AppThemeData.grey700,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -261,10 +412,30 @@ class WalletScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(padding: const EdgeInsets.symmetric(vertical: 5), child: MySeparator(color: isDark ? AppThemeData.grey700 : AppThemeData.grey200)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
child: MySeparator(
|
||||
color: isDark ? AppThemeData.grey700 : AppThemeData.grey200,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
enum PaymentGateway {payme, click, payFast, mercadoPago, paypal, stripe, flutterWave, payStack, razorpay, cod, wallet, midTrans, orangeMoney, xendit }
|
||||
enum PaymentGateway {
|
||||
payme,
|
||||
click,
|
||||
payFast,
|
||||
mercadoPago,
|
||||
paypal,
|
||||
stripe,
|
||||
flutterWave,
|
||||
payStack,
|
||||
razorpay,
|
||||
cod,
|
||||
wallet,
|
||||
midTrans,
|
||||
orangeMoney,
|
||||
xendit,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user