BASE: Initialize Localization.

This commit is contained in:
2025-12-03 18:21:19 +05:00
parent cf58d069ab
commit b04050384d
141 changed files with 1577 additions and 1419 deletions

View File

@@ -4,6 +4,7 @@ import 'package:customer/themes/show_toast_dialog.dart';
import 'package:customer/utils/utils.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:dropdown_textfield/dropdown_textfield.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/svg.dart';
@@ -51,9 +52,9 @@ class BookParcelScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Book Your Document Delivery".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text("Book Your Document Delivery".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text(
"Schedule a secure and timely pickup & delivery".tr,
"Schedule a secure and timely pickup & delivery".tr(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppThemeData.mediumTextStyle(fontSize: 12, color: AppThemeData.grey900),
@@ -78,7 +79,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 16),
buildInfoSectionView(
title: "Sender Information".tr,
title: "Sender Information".tr(),
locationController: controller.senderLocationController.value,
nameController: controller.senderNameController.value,
mobileController: controller.senderMobileController.value,
@@ -101,7 +102,7 @@ class BookParcelScreen extends StatelessWidget {
controller.senderLocationController.value.text = address; // ✅
controller.senderLocation.value = UserLocation(latitude: lat, longitude: lng); // ✅ <-- Add this
} else {
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr);
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr());
}
}
} else {
@@ -113,7 +114,7 @@ class BookParcelScreen extends StatelessWidget {
controller.senderLocationController.value.text = Utils.formatAddress(selectedLocation: selectedLocationModel);
controller.senderLocation.value = UserLocation(latitude: selectedLocationModel.latLng!.latitude, longitude: selectedLocationModel.latLng!.longitude);
} else {
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr);
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr());
}
// ✅ <-- Add this
}
@@ -123,7 +124,7 @@ class BookParcelScreen extends StatelessWidget {
),
const SizedBox(height: 16),
buildInfoSectionView(
title: "Receiver Information".tr,
title: "Receiver Information".tr(),
locationController: controller.receiverLocationController.value,
nameController: controller.receiverNameController.value,
mobileController: controller.receiverMobileController.value,
@@ -147,7 +148,7 @@ class BookParcelScreen extends StatelessWidget {
controller.receiverLocationController.value.text = address; // ✅
controller.receiverLocation.value = UserLocation(latitude: lat, longitude: lng);
} else {
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr);
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr());
}
}
} else {
@@ -159,7 +160,7 @@ class BookParcelScreen extends StatelessWidget {
controller.receiverLocationController.value.text = Utils.formatAddress(selectedLocation: selectedLocationModel);
controller.receiverLocation.value = UserLocation(latitude: selectedLocationModel.latLng!.latitude, longitude: selectedLocationModel.latLng!.longitude); // ✅ <-- Add this
} else {
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr);
ShowToastDialog.showToast("Service is unavailable at the selected address.".tr());
}
}
});
@@ -170,7 +171,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 15),
RoundedButtonFill(
title: "Continue".tr,
title: "Continue".tr(),
onPress: () {
controller.bookNow();
},
@@ -197,7 +198,7 @@ class BookParcelScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Select delivery type".tr, style: AppThemeData.boldTextStyle(color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500, fontSize: 13)),
Text("Select delivery type".tr(), style: AppThemeData.boldTextStyle(color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500, fontSize: 13)),
const SizedBox(height: 10),
InkWell(
onTap: () {
@@ -208,7 +209,7 @@ class BookParcelScreen extends StatelessWidget {
children: [
Image.asset("assets/images/image_parcel.png", height: 38, width: 38),
const SizedBox(width: 20),
Expanded(child: Text("As soon as possible".tr, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16))),
Expanded(child: Text("As soon as possible".tr(), style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16))),
Icon(
controller.selectedDeliveryType.value == 'now' ? Icons.radio_button_checked : Icons.radio_button_off,
color: controller.selectedDeliveryType.value == 'now' ? AppThemeData.primary300 : (isDark ? AppThemeData.greyDark500 : AppThemeData.grey500),
@@ -229,7 +230,7 @@ class BookParcelScreen extends StatelessWidget {
children: [
Image.asset("assets/images/image_parcel_scheduled.png", height: 38, width: 38),
const SizedBox(width: 20),
Expanded(child: Text("Scheduled".tr, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16))),
Expanded(child: Text("Scheduled".tr(), style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 16))),
Icon(
controller.selectedDeliveryType.value == 'later' ? Icons.radio_button_checked : Icons.radio_button_off,
color: controller.selectedDeliveryType.value == 'later' ? AppThemeData.primary300 : (isDark ? AppThemeData.greyDark500 : AppThemeData.grey500),
@@ -242,7 +243,7 @@ class BookParcelScreen extends StatelessWidget {
GestureDetector(
onTap: () => controller.pickScheduledDate(context),
child: TextFieldWidget(
hintText: "When to pickup at this address".tr,
hintText: "When to pickup at this address".tr(),
controller: controller.scheduledDateController.value,
enable: false,
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
@@ -254,7 +255,7 @@ class BookParcelScreen extends StatelessWidget {
GestureDetector(
onTap: () => controller.pickScheduledTime(context),
child: TextFieldWidget(
hintText: "When to pickup at this address".tr,
hintText: "When to pickup at this address".tr(),
controller: controller.scheduledTimeController.value,
enable: false,
// onchange: (v) => controller.pickScheduledTime(context),
@@ -283,7 +284,7 @@ class BookParcelScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Upload parcel image".tr, style: AppThemeData.boldTextStyle(color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500, fontSize: 13)),
Text("Upload parcel image".tr(), style: AppThemeData.boldTextStyle(color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500, fontSize: 13)),
const SizedBox(height: 10),
DottedBorder(
options: RoundedRectDottedBorderOptions(strokeWidth: 1, radius: const Radius.circular(10), color: isDark ? AppThemeData.greyDark300 : AppThemeData.grey300),
@@ -296,13 +297,13 @@ class BookParcelScreen extends StatelessWidget {
children: [
SvgPicture.asset("assets/icons/ic_upload_parcel.svg", height: 40, width: 40),
const SizedBox(height: 10),
Text("Upload Parcel Image".tr, style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
Text("Upload Parcel Image".tr(), style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
const SizedBox(height: 4),
Text("Supported: .jpg, .jpeg, .png".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text("Max size 1MB".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text("Supported: .jpg, .jpeg, .png".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text("Max size 1MB".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
const SizedBox(height: 8),
RoundedButtonFill(
title: "Browse Image".tr,
title: "Browse Image".tr(),
onPress: () {
controller.onCameraClick(Get.context!);
},
@@ -378,7 +379,7 @@ class BookParcelScreen extends StatelessWidget {
GestureDetector(
onTap: onTap,
child: TextFieldWidget(
hintText: "Your Location".tr,
hintText: "Your Location".tr(),
controller: locationController,
suffix: const Padding(padding: EdgeInsets.only(right: 10), child: Icon(Icons.location_on_outlined)),
@@ -390,7 +391,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
hintText: "Name".tr,
hintText: "Name".tr(),
controller: nameController,
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,
@@ -398,7 +399,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
hintText: "Enter Mobile number".tr,
hintText: "Enter Mobile number".tr(),
controller: mobileController,
textInputType: TextInputType.number,
inputFormatters: [FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(10)],
@@ -435,7 +436,7 @@ class BookParcelScreen extends StatelessWidget {
clearOption: false,
enableSearch: false,
textFieldDecoration: InputDecoration(
hintText: "Select parcel Weight".tr,
hintText: "Select parcel Weight".tr(),
hintStyle: AppThemeData.regularTextStyle(fontSize: 14, color: isDark ? AppThemeData.grey400 : AppThemeData.greyDark400),
filled: true,
fillColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
@@ -447,8 +448,8 @@ class BookParcelScreen extends StatelessWidget {
dropDownList:
controller.parcelWeight.map((e) {
return DropDownValueModel(
name: e.title ?? 'Normal'.tr,
value: e.title ?? 'Normal'.tr, // safer to use title string
name: e.title ?? 'Normal'.tr(),
value: e.title ?? 'Normal'.tr(), // safer to use title string
);
}).toList(),
onChanged: (val) {
@@ -464,7 +465,7 @@ class BookParcelScreen extends StatelessWidget {
const SizedBox(height: 10),
TextFieldWidget(
hintText: "Notes (Optional)".tr,
hintText: "Notes (Optional)".tr(),
controller: noteController,
backgroundColor: isDark ? AppThemeData.surfaceDark : AppThemeData.surface,
borderColor: isDark ? AppThemeData.greyDark200 : AppThemeData.grey200,

View File

@@ -1,4 +1,5 @@
import 'package:customer/constant/constant.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
@@ -59,7 +60,7 @@ class HomeParcelScreen extends StatelessWidget {
onTap: () {
Get.offAll(const LoginScreen());
},
child: Text("Login".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
child: Text("Login".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
)
: Text(Constant.userModel!.fullName(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
InkWell(
@@ -74,7 +75,7 @@ class HomeParcelScreen extends StatelessWidget {
} else {
Constant.checkPermission(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
ShippingAddress shippingAddress = ShippingAddress();
@@ -159,7 +160,7 @@ class HomeParcelScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("What are you sending?".tr, style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
Text("What are you sending?".tr(), style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
const SizedBox(height: 12),
Container(
decoration: BoxDecoration(

View File

@@ -1,6 +1,7 @@
import 'package:customer/screen_ui/auth_screens/login_screen.dart';
import 'package:customer/screen_ui/parcel_service/parcel_order_details.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 '../../constant/constant.dart';
@@ -29,7 +30,7 @@ class MyBookingScreen extends StatelessWidget {
backgroundColor: AppThemeData.primary300,
title: Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Row(children: [const SizedBox(width: 10), Text("Parcel History".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))]),
child: Row(children: [const SizedBox(width: 10), Text("Parcel History".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900))]),
),
bottom: TabBar(
// don't re-subscribe onTap — just update selectedTab (optional)
@@ -55,16 +56,16 @@ class MyBookingScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
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(
"Youre not logged in. Please sign in to access your account and explore all features.".tr,
"Youre 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),
),
const SizedBox(height: 20),
RoundedButtonFill(
title: "Log in".tr,
title: "Log in".tr(),
width: 55,
height: 5.5,
color: AppThemeData.primary300,
@@ -82,7 +83,7 @@ class MyBookingScreen extends StatelessWidget {
final orders = controller.getOrdersForTab(title);
if (orders.isEmpty) {
return Center(child: Text("No orders found".tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
return Center(child: Text("No orders found".tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)));
}
return ListView.builder(
@@ -108,7 +109,7 @@ class MyBookingScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
"${'Order Date:'.tr}${order.isSchedule == true ? controller.formatDate(order.createdAt!) : controller.formatDate(order.senderPickupDateTime!)}",
"${'Order Date:'.tr()}${order.isSchedule == true ? controller.formatDate(order.createdAt!) : controller.formatDate(order.senderPickupDateTime!)}",
style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.info400),
),
),
@@ -140,7 +141,7 @@ class MyBookingScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_infoSection(
"Pickup Address (Sender):".tr,
"Pickup Address (Sender):".tr(),
order.sender?.name ?? '',
order.sender?.address ?? '',
order.sender?.phone ?? '',
@@ -152,7 +153,7 @@ class MyBookingScreen extends StatelessWidget {
),
const SizedBox(height: 16),
_infoSection(
"Delivery Address (Receiver):".tr,
"Delivery Address (Receiver):".tr(),
order.receiver?.name ?? '',
order.receiver?.address ?? '',
order.receiver?.phone ?? '',

View File

@@ -1,4 +1,5 @@
import 'package:customer/screen_ui/parcel_service/parcel_dashboard_screen.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:customer/themes/app_them_data.dart';
@@ -28,7 +29,7 @@ class OrderSuccessfullyPlaced extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
"Your Order Has Been Placed!".tr,
"Your Order Has Been Placed!".tr(),
style: AppThemeData.boldTextStyle(fontSize: 22, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
textAlign: TextAlign.center,
),
@@ -37,14 +38,14 @@ class OrderSuccessfullyPlaced extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50),
child: Text(
"Weve received your parcel booking and its now being processed. You can track its status in real time.".tr,
"Weve received your parcel booking and its now being processed. You can track its status in real time.".tr(),
style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
textAlign: TextAlign.center,
),
),
const SizedBox(height: 30),
RoundedButtonFill(
title: "Track Your Order".tr,
title: "Track Your Order".tr(),
onPress: () {
print("Tracking Order: $parcelOrder");
//Get.to(() => TrackOrderScreen(), arguments: {'order': parcelOrder});

View File

@@ -6,6 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
import 'package:customer/themes/responsive.dart';
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';
@@ -37,7 +38,7 @@ class ParcelCouponScreen extends StatelessWidget {
),
),
const SizedBox(width: 10),
Text("Coupon".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text("Coupon".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
],
),
),
@@ -46,7 +47,7 @@ class ParcelCouponScreen extends StatelessWidget {
controller.isLoading.value
? Constant.loader()
: controller.cabCouponList.isEmpty
? Constant.showEmptyView(message: "Coupon not found".tr)
? Constant.showEmptyView(message: "Coupon not found".tr())
: ListView.builder(
shrinkWrap: true,
itemCount: controller.cabCouponList.length,
@@ -71,7 +72,7 @@ class ParcelCouponScreen extends StatelessWidget {
child: RotatedBox(
quarterTurns: -1,
child: Text(
"${couponModel.discountType == "Fix Price" ? Constant.amountShow(amount: couponModel.discount) : "${couponModel.discount}%"} ${'Off'.tr}",
"${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),
),
@@ -106,7 +107,7 @@ class ParcelCouponScreen extends StatelessWidget {
Get.back(result: couponModel);
},
child: Text(
"Tap To Apply".tr,
"Tap To Apply".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),

View File

@@ -2,6 +2,7 @@ import 'package:customer/constant/constant.dart';
import 'package:customer/controllers/parcel_dashboard_controller.dart';
import 'package:customer/controllers/theme_controller.dart';
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';
@@ -39,15 +40,15 @@ class ParcelDashboardScreen extends StatelessWidget {
items:
Constant.walletSetting == false
? [
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home_parcel.svg", label: 'Home'.tr, controller: controller),
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_mybooking_parcel.svg", label: 'My Bookings'.tr, controller: controller),
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_profile_parcel.svg", label: 'Profile'.tr, controller: controller),
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home_parcel.svg", label: 'Home'.tr(), controller: controller),
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_mybooking_parcel.svg", label: 'My Bookings'.tr(), controller: controller),
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_profile_parcel.svg", label: 'Profile'.tr(), controller: controller),
]
: [
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home_parcel.svg", label: 'Home'.tr, controller: controller),
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_mybooking_parcel.svg", label: 'My Bookings'.tr, controller: controller),
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet_parcel.svg", label: 'Wallet'.tr, controller: controller),
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile_parcel.svg", label: 'Profile'.tr, controller: controller),
navigationBarItem(isDark, index: 0, assetIcon: "assets/icons/ic_home_parcel.svg", label: 'Home'.tr(), controller: controller),
navigationBarItem(isDark, index: 1, assetIcon: "assets/icons/ic_mybooking_parcel.svg", label: 'My Bookings'.tr(), controller: controller),
navigationBarItem(isDark, index: 2, assetIcon: "assets/icons/ic_wallet_parcel.svg", label: 'Wallet'.tr(), controller: controller),
navigationBarItem(isDark, index: 3, assetIcon: "assets/icons/ic_profile_parcel.svg", label: 'Profile'.tr(), controller: controller),
],
),
);
@@ -62,8 +63,8 @@ class ParcelDashboardScreen extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 5),
child: SvgPicture.asset(
assetIcon,
height: label == 'Wallet'.tr ? 18 : 22,
width: label == 'Wallet'.tr ? 18 : 22,
height: label == 'Wallet'.tr() ? 18 : 22,
width: label == 'Wallet'.tr() ? 18 : 22,
color:
controller.selectedIndex.value == index
? isDark

View File

@@ -1,6 +1,7 @@
import 'package:customer/models/coupon_model.dart';
import 'package:customer/screen_ui/parcel_service/parcel_coupon_screen.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
@@ -42,7 +43,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
),
),
const SizedBox(width: 10),
Text("Order Confirmation".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text("Order Confirmation".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
],
),
),
@@ -93,7 +94,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_infoSection(
"Pickup Address (Sender):".tr,
"Pickup Address (Sender):".tr(),
controller.parcelOrder.value.sender?.name ?? '',
controller.parcelOrder.value.sender?.address ?? '',
controller.parcelOrder.value.sender?.phone ?? '',
@@ -104,7 +105,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
),
const SizedBox(height: 16),
_infoSection(
"Delivery Address (Receiver):".tr,
"Delivery Address (Receiver):".tr(),
controller.parcelOrder.value.receiver?.name ?? '',
controller.parcelOrder.value.receiver?.address ?? '',
controller.parcelOrder.value.receiver?.phone ?? '',
@@ -131,9 +132,9 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_iconTile("${controller.parcelOrder.value.distance ?? '--'} ${'KM'.tr}", "Distance".tr, "assets/icons/ic_distance_parcel.svg", isDark),
_iconTile(controller.parcelOrder.value.parcelWeight ?? '--', "Weight".tr, "assets/icons/ic_weight_parcel.svg", isDark),
_iconTile(Constant.amountShow(amount: controller.parcelOrder.value.subTotal), "Rate".tr, "assets/icons/ic_rate_parcel.svg", isDark),
_iconTile("${controller.parcelOrder.value.distance ?? '--'} ${'KM'.tr()}", "Distance".tr(), "assets/icons/ic_distance_parcel.svg", isDark),
_iconTile(controller.parcelOrder.value.parcelWeight ?? '--', "Weight".tr(), "assets/icons/ic_weight_parcel.svg", isDark),
_iconTile(Constant.amountShow(amount: controller.parcelOrder.value.subTotal), "Rate".tr(), "assets/icons/ic_rate_parcel.svg", isDark),
],
),
),
@@ -142,7 +143,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
Row(
children: [
Expanded(child: Text("Coupons".tr, style: AppThemeData.boldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900))),
Expanded(child: Text("Coupons".tr(), style: AppThemeData.boldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900))),
InkWell(
onTap: () {
Get.to(ParcelCouponScreen())!.then((value) {
@@ -152,13 +153,13 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
controller.selectedCouponModel.value = value;
controller.calculatePrice();
} else {
ShowToastDialog.showToast("This offer not eligible for this booking".tr);
ShowToastDialog.showToast("This offer not eligible for this booking".tr());
}
}
});
},
child: Text(
"View All".tr,
"View All".tr(),
style: AppThemeData.boldTextStyle(decoration: TextDecoration.underline, fontSize: 14, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
),
),
@@ -181,14 +182,14 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
controller: controller.couponController.value,
style: AppThemeData.semiBoldTextStyle(color: AppThemeData.parcelService500, fontSize: 16),
decoration: InputDecoration(
hintText: "Write coupon code".tr,
hintText: "Write coupon code".tr(),
hintStyle: AppThemeData.mediumTextStyle(fontSize: 16, color: AppThemeData.parcelService500),
border: InputBorder.none,
),
),
),
RoundedButtonFill(
title: "Redeem now".tr,
title: "Redeem now".tr(),
onPress: () {
if (controller.couponList.where((element) => element.code!.toLowerCase() == controller.couponController.value.text.toLowerCase()).isNotEmpty) {
CouponModel couponModel = controller.couponList.firstWhere((p0) => p0.code!.toLowerCase() == controller.couponController.value.text.toLowerCase());
@@ -199,13 +200,13 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
controller.calculatePrice();
controller.update();
} else {
ShowToastDialog.showToast("This offer not eligible for this booking".tr);
ShowToastDialog.showToast("This offer not eligible for this booking".tr());
}
} else {
ShowToastDialog.showToast("This coupon code has been expired".tr);
ShowToastDialog.showToast("This coupon code has been expired".tr());
}
} else {
ShowToastDialog.showToast("Invalid coupon code".tr);
ShowToastDialog.showToast("Invalid coupon code".tr());
}
},
borderRadius: 10,
@@ -230,14 +231,14 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Order Summary".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey500)),
Text("Order Summary".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey500)),
const SizedBox(height: 8),
// Subtotal
_summaryTile("Subtotal".tr, Constant.amountShow(amount: controller.subTotal.value.toString()), isDark, null),
_summaryTile("Subtotal".tr(), Constant.amountShow(amount: controller.subTotal.value.toString()), isDark, null),
// Discount
_summaryTile("Discount".tr, "-${Constant.amountShow(amount: controller.discount.value.toString())}", isDark, AppThemeData.dangerDark300),
_summaryTile("Discount".tr(), "-${Constant.amountShow(amount: controller.discount.value.toString())}", isDark, AppThemeData.dangerDark300),
// Tax List
...List.generate(Constant.taxList.length, (index) {
@@ -251,7 +252,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
const Divider(),
// Total
_summaryTile("Order Total".tr, Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark, null),
_summaryTile("Order Total".tr(), Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark, null),
],
),
),
@@ -267,7 +268,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Title
Text("Payment by".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
Text("Payment by".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
const SizedBox(height: 12),
// Row with Sender and Receiver options
@@ -284,7 +285,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
size: 20,
),
const SizedBox(width: 6),
Text("Sender".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text("Sender".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
],
),
),
@@ -302,7 +303,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
size: 20,
),
const SizedBox(width: 6),
Text("Receiver".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text("Receiver".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
],
),
),
@@ -316,7 +317,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
// Continue button
RoundedButtonFill(
title: controller.paymentBy.value == "Sender" ? "Select Payment Method".tr : "Continue".tr,
title: controller.paymentBy.value == "Sender" ? "Select Payment Method".tr() : "Continue".tr(),
onPress: () async {
if (controller.paymentBy.value == "Sender") {
Get.bottomSheet(
@@ -394,7 +395,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Select Payment Method".tr, style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
Text("Select Payment Method".tr(), style: AppThemeData.mediumTextStyle(fontSize: 18, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
GestureDetector(
onTap: () {
Get.back();
@@ -408,7 +409,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
child: ListView(
controller: scrollController,
children: [
Text("Preferred Payment".tr, textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
Text("Preferred Payment".tr(), textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
const SizedBox(height: 10),
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true)
Container(
@@ -434,7 +435,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
),
),
if (controller.walletSettingModel.value.isEnabled == true || controller.cashOnDeliverySettingModel.value.isEnabled == true) const SizedBox(height: 10),
Text("Other Payment Options".tr, textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
Text("Other Payment Options".tr(), textAlign: TextAlign.start, style: AppThemeData.boldTextStyle(fontSize: 15, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
const SizedBox(height: 10),
Container(
decoration: BoxDecoration(
@@ -474,7 +475,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
),
),
RoundedButtonFill(
title: "Continue".tr,
title: "Continue".tr(),
color: AppThemeData.taxiBooking300,
textColor: AppThemeData.grey900,
onPress: () async {
@@ -496,7 +497,7 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
double walletBalance = double.tryParse(controller.userModel.value.walletAmount.toString()) ?? 0.0;
double amountToPay = double.tryParse(controller.totalAmount.value.toString()) ?? 0.0;
if (walletBalance < amountToPay) {
ShowToastDialog.showToast("Insufficient wallet balance".tr);
ShowToastDialog.showToast("Insufficient wallet balance".tr());
return;
}
controller.placeOrder();
@@ -514,14 +515,14 @@ class ParcelOrderConfirmationScreen extends StatelessWidget {
RazorPayController().createOrderRazorPay(amount: double.parse(controller.totalAmount.value.toString()), razorpayModel: controller.razorPayModel.value).then((value) {
if (value == null) {
Get.back();
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr);
ShowToastDialog.showToast("Something went wrong, please contact admin.".tr());
} else {
CreateRazorPayOrderModel result = value;
controller.openCheckout(amount: controller.totalAmount.value.toString(), orderId: result.id);
}
});
} else {
ShowToastDialog.showToast("Please select payment method".tr);
ShowToastDialog.showToast("Please select payment method".tr());
}
},
),

View File

@@ -1,5 +1,6 @@
import 'package:customer/screen_ui/parcel_service/parcel_review_screen.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:get/get.dart';
@@ -48,9 +49,9 @@ class ParcelOrderDetails extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Order Details".tr, style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text("Order Details".tr(), style: AppThemeData.boldTextStyle(fontSize: 18, color: AppThemeData.grey900)),
Text(
"Your parcel is on the way. Track it in real time below.".tr,
"Your parcel is on the way. Track it in real time below.".tr(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey900),
@@ -79,7 +80,7 @@ class ParcelOrderDetails extends StatelessWidget {
width: double.infinity,
padding: const EdgeInsets.all(16),
child: Text(
"${'Order Id:'.tr} ${Constant.orderId(orderId: controller.parcelOrder.value.id.toString())}".tr,
"${'Order Id:'.tr()} ${Constant.orderId(orderId: controller.parcelOrder.value.id.toString())}".tr(),
textAlign: TextAlign.start,
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 18, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
),
@@ -125,7 +126,7 @@ class ParcelOrderDetails extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_infoSection(
"Pickup Address (Sender):".tr,
"Pickup Address (Sender):".tr(),
controller.parcelOrder.value.sender?.name ?? '',
controller.parcelOrder.value.sender?.address ?? '',
controller.parcelOrder.value.sender?.phone ?? '',
@@ -136,7 +137,7 @@ class ParcelOrderDetails extends StatelessWidget {
),
const SizedBox(height: 16),
_infoSection(
"Delivery Address (Receiver):".tr,
"Delivery Address (Receiver):".tr(),
controller.parcelOrder.value.receiver?.name ?? '',
controller.parcelOrder.value.receiver?.address ?? '',
controller.parcelOrder.value.receiver?.phone ?? '',
@@ -157,7 +158,7 @@ class ParcelOrderDetails extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
"${'Schedule Pickup time:'.tr} ${controller.formatDate(controller.parcelOrder.value.senderPickupDateTime!)}",
"${'Schedule Pickup time:'.tr()} ${controller.formatDate(controller.parcelOrder.value.senderPickupDateTime!)}",
style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.info400),
),
),
@@ -165,7 +166,7 @@ class ParcelOrderDetails extends StatelessWidget {
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
"${'Order Date:'.tr}${controller.parcelOrder.value.isSchedule == true ? controller.formatDate(controller.parcelOrder.value.createdAt!) : controller.formatDate(controller.parcelOrder.value.senderPickupDateTime!)}",
"${'Order Date:'.tr()}${controller.parcelOrder.value.isSchedule == true ? controller.formatDate(controller.parcelOrder.value.createdAt!) : controller.formatDate(controller.parcelOrder.value.senderPickupDateTime!)}",
style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.info400),
),
),
@@ -173,7 +174,7 @@ class ParcelOrderDetails extends StatelessWidget {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("Parcel Type:".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text("Parcel Type:".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Row(
children: [
Text(
@@ -221,9 +222,9 @@ class ParcelOrderDetails extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
_iconTile("${controller.parcelOrder.value.distance ?? '--'} ${Constant.distanceType}", "Distance".tr, "assets/icons/ic_distance_parcel.svg", isDark),
_iconTile(controller.parcelOrder.value.parcelWeight ?? '--', "Weight".tr, "assets/icons/ic_weight_parcel.svg", isDark),
_iconTile(Constant.amountShow(amount: controller.parcelOrder.value.subTotal), "Rate".tr, "assets/icons/ic_rate_parcel.svg", isDark),
_iconTile("${controller.parcelOrder.value.distance ?? '--'} ${Constant.distanceType}", "Distance".tr(), "assets/icons/ic_distance_parcel.svg", isDark),
_iconTile(controller.parcelOrder.value.parcelWeight ?? '--', "Weight".tr(), "assets/icons/ic_weight_parcel.svg", isDark),
_iconTile(Constant.amountShow(amount: controller.parcelOrder.value.subTotal), "Rate".tr(), "assets/icons/ic_rate_parcel.svg", isDark),
],
),
),
@@ -241,7 +242,7 @@ class ParcelOrderDetails extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("About Driver".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
Text("About Driver".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark500 : AppThemeData.grey500)),
const SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@@ -284,7 +285,7 @@ class ParcelOrderDetails extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: RoundedButtonFill(
title: controller.ratingModel.value.id != null && controller.ratingModel.value.id!.isNotEmpty ? 'Update Review'.tr : 'Add Review'.tr,
title: controller.ratingModel.value.id != null && controller.ratingModel.value.id!.isNotEmpty ? 'Update Review'.tr() : 'Add Review'.tr(),
onPress: () async {
final result = await Get.to(() => ParcelReviewScreen(), arguments: {'order': controller.parcelOrder.value});
@@ -323,7 +324,7 @@ class ParcelOrderDetails extends StatelessWidget {
const SizedBox(width: 10),
InkWell(
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
UserModel? customer = await FireStoreUtils.getUserProfile(controller.parcelOrder.value.authorID ?? '');
UserModel? driverUser = await FireStoreUtils.getUserProfile(controller.parcelOrder.value.driverId ?? '');
@@ -375,14 +376,14 @@ class ParcelOrderDetails extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Order Summary".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey500)),
Text("Order Summary".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey500)),
const SizedBox(height: 8),
// Subtotal
_summaryTile("Subtotal".tr, Constant.amountShow(amount: controller.subTotal.value.toString()), isDark),
_summaryTile("Subtotal".tr(), Constant.amountShow(amount: controller.subTotal.value.toString()), isDark),
// Discount
_summaryTile("Discount".tr, Constant.amountShow(amount: controller.discount.value.toString()), isDark),
_summaryTile("Discount".tr(), Constant.amountShow(amount: controller.discount.value.toString()), isDark),
// Tax List
...List.generate(controller.parcelOrder.value.taxSetting!.length, (index) {
@@ -404,7 +405,7 @@ class ParcelOrderDetails extends StatelessWidget {
const Divider(),
// Total
_summaryTile("Order Total".tr, Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark),
_summaryTile("Order Total".tr(), Constant.amountShow(amount: controller.totalAmount.value.toString()), isDark),
],
),
),
@@ -416,7 +417,7 @@ class ParcelOrderDetails extends StatelessWidget {
? Padding(
padding: const EdgeInsets.all(16.0),
child: RoundedButtonFill(
title: "Cancel Parcel".tr,
title: "Cancel Parcel".tr(),
onPress: () {
controller.cancelParcelOrder();
},
@@ -447,7 +448,7 @@ class ParcelOrderDetails extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Parcel Status Timeline".tr, style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 18)),
Text("Parcel Status Timeline".tr(), style: AppThemeData.semiBoldTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900, fontSize: 18)),
const SizedBox(height: 8),
// Dynamic List
@@ -457,7 +458,7 @@ class ParcelOrderDetails extends StatelessWidget {
if (history.isEmpty) {
return SizedBox(
height: 80,
child: Center(child: Text("No status updates yet".tr, style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900))),
child: Center(child: Text("No status updates yet".tr(), style: AppThemeData.mediumTextStyle(color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900))),
);
}
@@ -531,7 +532,7 @@ class ParcelOrderDetails extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(title, style: AppThemeData.mediumTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark800 : AppThemeData.grey800)),
Text(value, style: AppThemeData.semiBoldTextStyle(fontSize: title == "Order Total".tr ? 18 : 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
Text(value, style: AppThemeData.semiBoldTextStyle(fontSize: title == "Order Total".tr() ? 18 : 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
],
),
);

View File

@@ -1,4 +1,5 @@
import 'package:customer/controllers/parcel_review_controller.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:get/get.dart';
@@ -27,7 +28,7 @@ class ParcelReviewScreen extends StatelessWidget {
backgroundColor: AppThemeData.primary300,
leading: GestureDetector(onTap: () => Get.back(), child: Icon(Icons.arrow_back_ios, color: isDark ? Colors.white : Colors.black)),
title: Text(
controller.ratingModel.value != null && controller.ratingModel.value!.id!.isNotEmpty ? "Update Review".tr : "Add Review".tr,
controller.ratingModel.value != null && controller.ratingModel.value!.id!.isNotEmpty ? "Update Review".tr() : "Add Review".tr(),
style: TextStyle(color: isDark ? Colors.white : Colors.black, fontSize: 16),
),
),
@@ -64,12 +65,12 @@ class ParcelReviewScreen extends StatelessWidget {
// Title
Padding(
padding: const EdgeInsets.only(top: 16),
child: Text('How is your trip?'.tr, style: TextStyle(fontSize: 18, color: isDark ? Colors.white : Colors.black, fontWeight: FontWeight.bold, letterSpacing: 2)),
child: Text('How is your trip?'.tr(), style: TextStyle(fontSize: 18, color: isDark ? Colors.white : Colors.black, fontWeight: FontWeight.bold, letterSpacing: 2)),
),
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
'Your feedback will help us improve \n driving experience better'.tr,
'Your feedback will help us improve \n driving experience better'.tr(),
textAlign: TextAlign.center,
style: TextStyle(color: isDark ? Colors.white : Colors.black.withOpacity(0.60), letterSpacing: 0.8),
),
@@ -78,7 +79,7 @@ class ParcelReviewScreen extends StatelessWidget {
// Rating
Padding(
padding: const EdgeInsets.only(top: 20),
child: Text('Rate for'.tr, style: TextStyle(fontSize: 16, color: isDark ? Colors.white : Colors.black.withOpacity(0.60), letterSpacing: 0.8)),
child: Text('Rate for'.tr(), style: TextStyle(fontSize: 16, color: isDark ? Colors.white : Colors.black.withOpacity(0.60), letterSpacing: 0.8)),
),
Padding(
padding: const EdgeInsets.only(top: 8),
@@ -102,13 +103,13 @@ class ParcelReviewScreen extends StatelessWidget {
),
// Comment
Padding(padding: const EdgeInsets.all(20.0), child: TextFieldWidget(hintText: "Type comment....".tr, controller: controller.comment.value, maxLine: 5)),
Padding(padding: const EdgeInsets.all(20.0), child: TextFieldWidget(hintText: "Type comment....".tr(), controller: controller.comment.value, maxLine: 5)),
// Submit Button
Padding(
padding: const EdgeInsets.all(20.0),
child: RoundedButtonFill(
title: controller.ratingModel.value != null ? "Update Review".tr : "Add Review".tr,
title: controller.ratingModel.value != null ? "Update Review".tr() : "Add Review".tr(),
color: AppThemeData.primary300,
textColor: isDark ? Colors.white : Colors.black,
onPress: controller.submitReview,