BASE: Initialize Localization.
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:customer/controllers/category_restaurant_controller.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
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';
|
||||
@@ -26,7 +27,7 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
controller.isLoading.value
|
||||
? Constant.loader()
|
||||
: controller.allNearestRestaurant.isEmpty
|
||||
? Constant.showEmptyView(message: "No Restaurant found".tr)
|
||||
? Constant.showEmptyView(message: "No Restaurant found".tr())
|
||||
: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: ListView.builder(
|
||||
@@ -87,7 +88,7 @@ class CategoryRestaurantScreen extends StatelessWidget {
|
||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(fontSize: 14, color: AppThemeData.success600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/responsive.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
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';
|
||||
@@ -77,7 +78,7 @@ class DiscountRestaurantListScreen extends StatelessWidget {
|
||||
child: Padding(
|
||||
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}",
|
||||
"${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),
|
||||
|
||||
@@ -22,6 +22,7 @@ import 'package:customer/utils/preferences.dart';
|
||||
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart' as flutterMap;
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@@ -92,7 +93,7 @@ class HomeScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
"No Store Found in Your Area".tr,
|
||||
"No Store Found in Your Area".tr(),
|
||||
style: TextStyle(
|
||||
color:
|
||||
isDark
|
||||
@@ -105,7 +106,7 @@ class HomeScreen extends StatelessWidget {
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"Currently, there are no available store in your zone. Try changing your location to find nearby options."
|
||||
.tr,
|
||||
.tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color:
|
||||
@@ -118,7 +119,7 @@ class HomeScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
RoundedButtonFill(
|
||||
title: "Change Zone".tr,
|
||||
title: "Change Zone".tr(),
|
||||
width: 55,
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
@@ -229,7 +230,7 @@ class HomeScreen extends StatelessWidget {
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader(
|
||||
"Please wait..."
|
||||
.tr,
|
||||
.tr(),
|
||||
);
|
||||
|
||||
// ✅ declare it once here!
|
||||
@@ -516,7 +517,7 @@ class HomeScreen extends StatelessWidget {
|
||||
true
|
||||
? 'Искать что угодно'
|
||||
: 'Search the store, item and more...'
|
||||
.tr,
|
||||
.tr(),
|
||||
controller: null,
|
||||
enable: false,
|
||||
backgroundColor:
|
||||
@@ -704,7 +705,7 @@ class HomeScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"New Arrivals".tr,
|
||||
"New Arrivals".tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.start,
|
||||
@@ -739,7 +740,7 @@ class HomeScreen extends StatelessWidget {
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
"View all".tr,
|
||||
"View all".tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.center,
|
||||
@@ -821,7 +822,7 @@ class HomeScreen extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Highlights for you"
|
||||
.tr,
|
||||
.tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.start,
|
||||
@@ -851,7 +852,7 @@ class HomeScreen extends StatelessWidget {
|
||||
},
|
||||
child: Text(
|
||||
"View all"
|
||||
.tr,
|
||||
.tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.center,
|
||||
@@ -967,7 +968,7 @@ class HomeScreen extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
"Popular Stores"
|
||||
.tr,
|
||||
.tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.center,
|
||||
@@ -1020,7 +1021,7 @@ class HomeScreen extends StatelessWidget {
|
||||
vertical: 10,
|
||||
),
|
||||
child: Text(
|
||||
"All Stores".tr,
|
||||
"All Stores".tr(),
|
||||
textAlign:
|
||||
TextAlign
|
||||
.center,
|
||||
@@ -1208,16 +1209,16 @@ class HomeScreen extends StatelessWidget {
|
||||
isDark
|
||||
? AppThemeData.greyDark100
|
||||
: AppThemeData.grey100,
|
||||
value: controller.selectedOrderTypeValue.value.tr,
|
||||
value: controller.selectedOrderTypeValue.value.tr(),
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items:
|
||||
<String>['Delivery'.tr, 'TakeAway'.tr].map((
|
||||
<String>['Delivery'.tr(), 'TakeAway'.tr()].map((
|
||||
String value,
|
||||
) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(
|
||||
value.tr,
|
||||
value.tr(),
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.semiBold,
|
||||
fontSize: 16,
|
||||
@@ -1242,12 +1243,12 @@ class HomeScreen extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Alert".tr,
|
||||
title: "Alert".tr(),
|
||||
descriptions:
|
||||
"Do you really want to change the delivery option? Your cart will be empty."
|
||||
.tr,
|
||||
positiveString: "Ok".tr,
|
||||
negativeString: "Cancel".tr,
|
||||
.tr(),
|
||||
positiveString: "Ok".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
positiveClick: () async {
|
||||
await Preferences.setString(
|
||||
Preferences.foodDeliveryType,
|
||||
@@ -1287,7 +1288,7 @@ class HomeScreen extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
name.tr,
|
||||
name.tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
@@ -1300,7 +1301,7 @@ class HomeScreen extends StatelessWidget {
|
||||
onPress!();
|
||||
},
|
||||
child: Text(
|
||||
"View all".tr,
|
||||
"View all".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontFamily: AppThemeData.regular,
|
||||
@@ -1474,7 +1475,7 @@ class PopularRestaurant extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppThemeData.carRent600,
|
||||
@@ -1779,7 +1780,7 @@ class AllRestaurant extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppThemeData.carRent600,
|
||||
@@ -2076,7 +2077,7 @@ class NewArrival extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
@@ -2186,7 +2187,7 @@ class AdvertisementHomeCard extends StatelessWidget {
|
||||
final isDark = themeController.isDark.value;
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(
|
||||
model.vendorId!,
|
||||
);
|
||||
@@ -2499,7 +2500,7 @@ class OfferView extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Upto".tr,
|
||||
"Upto".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
@@ -2514,7 +2515,7 @@ class OfferView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr : "off".tr}",
|
||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr() : "off".tr()}",
|
||||
textAlign: TextAlign.start,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
@@ -2563,7 +2564,7 @@ class OfferView extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -2649,7 +2650,7 @@ class BannerView extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
if (bannerModel.redirect_type == "store") {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
VendorModel? vendorModel =
|
||||
await FireStoreUtils.getVendorById(
|
||||
bannerModel.redirect_id.toString(),
|
||||
@@ -2661,7 +2662,7 @@ class BannerView extends StatelessWidget {
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
} else if (bannerModel.redirect_type == "product") {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
ProductModel? productModel =
|
||||
await FireStoreUtils.getProductById(
|
||||
bannerModel.redirect_id.toString(),
|
||||
@@ -2681,7 +2682,7 @@ class BannerView extends StatelessWidget {
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
} else {
|
||||
ShowToastDialog.showToast("Could not launch".tr);
|
||||
ShowToastDialog.showToast("Could not launch".tr());
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2755,7 +2756,7 @@ class BannerBottomView extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
if (bannerModel.redirect_type == "store") {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
VendorModel? vendorModel =
|
||||
await FireStoreUtils.getVendorById(
|
||||
bannerModel.redirect_id.toString(),
|
||||
@@ -2767,7 +2768,7 @@ class BannerBottomView extends StatelessWidget {
|
||||
arguments: {"vendorModel": vendorModel},
|
||||
);
|
||||
} else if (bannerModel.redirect_type == "product") {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
ProductModel? productModel =
|
||||
await FireStoreUtils.getProductById(
|
||||
bannerModel.redirect_id.toString(),
|
||||
@@ -2787,7 +2788,7 @@ class BannerBottomView extends StatelessWidget {
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
} else {
|
||||
ShowToastDialog.showToast("Could not launch".tr);
|
||||
ShowToastDialog.showToast("Could not launch".tr());
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2971,7 +2972,7 @@ class StoryView extends StatelessWidget {
|
||||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${"Error".tr}: ${snapshot.error}',
|
||||
'${"Error".tr()}: ${snapshot.error}',
|
||||
),
|
||||
);
|
||||
} else if (snapshot.data == null) {
|
||||
@@ -3399,7 +3400,7 @@ class MapView extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
"Free Delivery"
|
||||
.tr,
|
||||
.tr(),
|
||||
style: TextStyle(
|
||||
fontSize:
|
||||
14,
|
||||
|
||||
@@ -23,6 +23,7 @@ import 'package:customer/utils/preferences.dart';
|
||||
import 'package:customer/widget/osm_map/map_picker_page.dart';
|
||||
import 'package:customer/widget/place_picker/location_picker_screen.dart';
|
||||
import 'package:customer/widget/place_picker/selected_location_model.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:geocoding/geocoding.dart';
|
||||
@@ -69,16 +70,16 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
children: [
|
||||
Image.asset("assets/images/location.gif", height: 120),
|
||||
const SizedBox(height: 12),
|
||||
Text("No Store Found in Your Area".tr, style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||
Text("No Store Found in Your Area".tr(), style: TextStyle(color: isDark ? AppThemeData.grey100 : AppThemeData.grey800, fontSize: 22, fontFamily: AppThemeData.semiBold)),
|
||||
const SizedBox(height: 5),
|
||||
Text(
|
||||
"Currently, there are no available store in your zone. Try changing your location to find nearby options.".tr,
|
||||
"Currently, there are no available store in your zone. Try changing your location to find nearby options.".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: isDark ? AppThemeData.grey50 : AppThemeData.grey500, fontSize: 16, fontFamily: AppThemeData.bold),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
RoundedButtonFill(
|
||||
title: "Change Zone".tr,
|
||||
title: "Change Zone".tr(),
|
||||
width: 55,
|
||||
height: 5.5,
|
||||
color: AppThemeData.primary300,
|
||||
@@ -122,7 +123,7 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
Get.offAll(const LoginScreen());
|
||||
},
|
||||
child: Text(
|
||||
"Login".tr,
|
||||
"Login".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 12),
|
||||
),
|
||||
@@ -145,7 +146,7 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
} else {
|
||||
Constant.checkPermission(
|
||||
onTap: () async {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
|
||||
// ✅ declare once for whole method
|
||||
ShippingAddress shippingAddress = ShippingAddress();
|
||||
@@ -255,8 +256,8 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
child: TextFieldWidget(
|
||||
hintText:
|
||||
Constant.sectionConstantModel?.name?.toLowerCase().contains('restaurants') == true
|
||||
? 'Search the dish, foo and more...'.tr
|
||||
: 'Search the store, item and more...'.tr,
|
||||
? 'Search the dish, foo and more...'.tr()
|
||||
: 'Search the store, item and more...'.tr(),
|
||||
controller: null,
|
||||
enable: false,
|
||||
prefix: Padding(padding: const EdgeInsets.symmetric(horizontal: 16), child: SvgPicture.asset("assets/icons/ic_search.svg")),
|
||||
@@ -299,7 +300,7 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Highlights for you".tr,
|
||||
"Highlights for you".tr(),
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900),
|
||||
),
|
||||
@@ -311,7 +312,7 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
"See all".tr,
|
||||
"See all".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.regular, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300),
|
||||
),
|
||||
@@ -417,13 +418,13 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
DropdownButton<String>(
|
||||
isDense: false,
|
||||
underline: const SizedBox(),
|
||||
value: controller.selectedOrderTypeValue.value.tr,
|
||||
value: controller.selectedOrderTypeValue.value.tr(),
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
items:
|
||||
<String>['Delivery'.tr, 'TakeAway'.tr].map((String value) {
|
||||
<String>['Delivery'.tr(), 'TakeAway'.tr()].map((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
child: Text(value.tr, style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
child: Text(value.tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, fontSize: 16, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900)),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) async {
|
||||
@@ -436,10 +437,10 @@ class HomeScreenTwo extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return CustomDialogBox(
|
||||
title: "Alert".tr,
|
||||
descriptions: "Do you really want to change the delivery option? Your cart will be empty.".tr,
|
||||
positiveString: "Ok".tr,
|
||||
negativeString: "Cancel".tr,
|
||||
title: "Alert".tr(),
|
||||
descriptions: "Do you really want to change the delivery option? Your cart will be empty.".tr(),
|
||||
positiveString: "Ok".tr(),
|
||||
negativeString: "Cancel".tr(),
|
||||
positiveClick: () async {
|
||||
await Preferences.setString(Preferences.foodDeliveryType, value!);
|
||||
controller.selectedOrderTypeValue.value = value;
|
||||
@@ -493,13 +494,13 @@ class CategoryView extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: Text("Our Categories".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||
Expanded(child: Text("Our Categories".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.to(const ViewAllCategoryScreen());
|
||||
},
|
||||
child: Text(
|
||||
"See all".tr,
|
||||
"See all".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
||||
),
|
||||
@@ -507,7 +508,7 @@ class CategoryView extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
GradientText(
|
||||
'Best Servings Food'.tr,
|
||||
'Best Servings Food'.tr(),
|
||||
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
||||
gradient: LinearGradient(colors: [Color(0xFF3961F1), Color(0xFF11D0EA)]),
|
||||
),
|
||||
@@ -571,7 +572,7 @@ class OfferView extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: Text("Large Discounts".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||
Expanded(child: Text("Large Discounts".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.to(
|
||||
@@ -580,7 +581,7 @@ class OfferView extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
child: Text(
|
||||
"See all".tr,
|
||||
"See all".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
||||
),
|
||||
@@ -588,7 +589,7 @@ class OfferView extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
GradientText(
|
||||
'Save Upto 50% Off'.tr,
|
||||
'Save Upto 50% Off'.tr(),
|
||||
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
||||
gradient: LinearGradient(colors: [Color(0xFF39F1C5), Color(0xFF97EA11)]),
|
||||
),
|
||||
@@ -642,7 +643,7 @@ class OfferView extends StatelessWidget {
|
||||
const SizedBox(height: 5),
|
||||
RoundedButtonFill(
|
||||
title:
|
||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr : "off".tr}",
|
||||
"${offerModel.discountType == "Fix Price" ? Constant.currencyModel!.symbol : ""}${offerModel.discount}${offerModel.discountType == "Percentage" ? "% off".tr() : "off".tr()}",
|
||||
color: Colors.primaries[Random().nextInt(Colors.primaries.length)],
|
||||
textColor: AppThemeData.grey50,
|
||||
width: 20,
|
||||
@@ -694,13 +695,13 @@ class BannerView extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
if (bannerModel.redirect_type == "store") {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(bannerModel.redirect_id.toString());
|
||||
|
||||
ShowToastDialog.closeLoader();
|
||||
Get.to(const RestaurantDetailsScreen(), arguments: {"vendorModel": vendorModel});
|
||||
} else if (bannerModel.redirect_type == "product") {
|
||||
ShowToastDialog.showLoader("Please wait...".tr);
|
||||
ShowToastDialog.showLoader("Please wait...".tr());
|
||||
ProductModel? productModel = await FireStoreUtils.getProductById(bannerModel.redirect_id.toString());
|
||||
VendorModel? vendorModel = await FireStoreUtils.getVendorById(productModel!.vendorID.toString());
|
||||
|
||||
@@ -711,7 +712,7 @@ class BannerView extends StatelessWidget {
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri);
|
||||
} else {
|
||||
ShowToastDialog.showToast("Could not launch".tr);
|
||||
ShowToastDialog.showToast("Could not launch".tr());
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -746,9 +747,9 @@ class StoryView extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(children: [Expanded(child: Text("Stories".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 18)))]),
|
||||
Row(children: [Expanded(child: Text("Stories".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey50, fontSize: 18)))]),
|
||||
GradientText(
|
||||
'Best Food Stories Ever'.tr,
|
||||
'Best Food Stories Ever'.tr(),
|
||||
style: TextStyle(fontSize: 24, fontFamily: 'Inter Tight', fontWeight: FontWeight.w800),
|
||||
gradient: LinearGradient(colors: [Color(0xFFF1C839), Color(0xFFEA1111)]),
|
||||
),
|
||||
@@ -787,7 +788,7 @@ class StoryView extends StatelessWidget {
|
||||
return Constant.loader();
|
||||
} else {
|
||||
if (snapshot.hasError) {
|
||||
return Center(child: Text('${"Error".tr}: ${snapshot.error}'));
|
||||
return Center(child: Text('${"Error".tr()}: ${snapshot.error}'));
|
||||
} else if (snapshot.data == null) {
|
||||
return const SizedBox();
|
||||
} else {
|
||||
@@ -814,7 +815,7 @@ class StoryView extends StatelessWidget {
|
||||
SvgPicture.asset("assets/icons/ic_star.svg"),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum!.toStringAsFixed(0))} ${'reviews'.tr}",
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum!.toStringAsFixed(0))} ${'reviews'.tr()}",
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(color: AppThemeData.warning300, fontSize: 10, overflow: TextOverflow.ellipsis, fontWeight: FontWeight.w700),
|
||||
@@ -869,13 +870,13 @@ class RestaurantView extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(child: Text("Best Restaurants".tr, style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||
Expanded(child: Text("Best Restaurants".tr(), style: TextStyle(fontFamily: AppThemeData.semiBold, color: isDark ? AppThemeData.grey50 : AppThemeData.grey900, fontSize: 18))),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.to(const RestaurantListScreen(), arguments: {"vendorList": controller.allNearestRestaurant, "title": "Best Restaurants"});
|
||||
},
|
||||
child: Text(
|
||||
"See all".tr,
|
||||
"See all".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(fontFamily: AppThemeData.medium, color: isDark ? AppThemeData.primary300 : AppThemeData.primary300, fontSize: 14),
|
||||
),
|
||||
@@ -938,7 +939,7 @@ class RestaurantView extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Upto".tr,
|
||||
"Upto".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
@@ -949,7 +950,7 @@ class RestaurantView extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
discountAmountTempList.reduce(min).toString() + "% OFF".tr,
|
||||
discountAmountTempList.reduce(min).toString() + "% OFF".tr(),
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
@@ -1001,7 +1002,7 @@ class RestaurantView extends StatelessWidget {
|
||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg", width: 18),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(
|
||||
overflow: TextOverflow.ellipsis,
|
||||
fontFamily: AppThemeData.medium,
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:customer/models/favourite_model.dart';
|
||||
import 'package:customer/models/vendor_model.dart';
|
||||
import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/themes/responsive.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import '../../../controllers/theme_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
@@ -122,7 +123,7 @@ class RestaurantListScreen extends StatelessWidget {
|
||||
SvgPicture.asset("assets/icons/ic_free_delivery.svg"),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"Free Delivery".tr,
|
||||
"Free Delivery".tr(),
|
||||
style: TextStyle(fontSize: 14, color: AppThemeData.carRent600, fontFamily: AppThemeData.semiBold, fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:customer/themes/app_them_data.dart';
|
||||
import 'package:customer/utils/network_image_widget.dart';
|
||||
import 'package:customer/widget/story_view/controller/story_controller.dart';
|
||||
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';
|
||||
@@ -103,7 +104,7 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
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();
|
||||
@@ -135,7 +136,7 @@ class MoreStoriesState extends State<MoreStories> {
|
||||
SvgPicture.asset("assets/icons/ic_star.svg"),
|
||||
const SizedBox(width: 5),
|
||||
Text(
|
||||
"${Constant.calculateReview(reviewCount: vendorModel.reviewsCount.toString(), reviewSum: vendorModel.reviewsSum.toString())} ${'reviews'.tr}",
|
||||
"${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),
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:customer/controllers/view_all_category_controller.dart';
|
||||
import 'package:customer/models/vendor_category_model.dart';
|
||||
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';
|
||||
|
||||
@@ -24,7 +25,7 @@ class ViewAllCategoryScreen extends StatelessWidget {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user