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

@@ -6,6 +6,7 @@ import 'package:customer/models/user_model.dart';
import 'package:customer/screen_ui/location_enable_screens/enter_manually_location.dart';
import 'package:customer/themes/app_them_data.dart' show AppThemeData;
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:flutter_svg/flutter_svg.dart';
@@ -38,14 +39,14 @@ class AddressListScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("My Addresses".tr, style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
Text("My Addresses".tr(), style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
const SizedBox(height: 5),
Text("Allows users to view, manage, add, or edit delivery addresses.".tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
Text("Allows users to view, manage, add, or edit delivery addresses.".tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
const SizedBox(height: 24),
Expanded(
child:
controller.shippingAddressList.isEmpty
? Constant.showEmptyView(message: "Address not found".tr)
? Constant.showEmptyView(message: "Address not found".tr())
: ListView.separated(
itemCount: controller.shippingAddressList.length,
itemBuilder: (context, index) {
@@ -80,7 +81,7 @@ class AddressListScreen extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
child: Text(
"Default".tr,
"Default".tr(),
style: AppThemeData.semiBoldTextStyle(fontSize: 12, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
),
),

View File

@@ -6,6 +6,7 @@ import 'package:customer/utils/utils.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_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
@@ -45,15 +46,15 @@ class EnterManuallyLocationScreen extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
controller.mode == "Edit" ? "Edit Address".tr : "Add a New Address".tr,
controller.mode == "Edit" ? "Edit Address".tr() : "Add a New Address".tr(),
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
),
const SizedBox(height: 10),
Text("Enter your location details so we can deliver your orders quickly and accurately.".tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
Text("Enter your location details so we can deliver your orders quickly and accurately.".tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600)),
const SizedBox(height: 24),
Row(
children: [
Expanded(child: Text("Set as Default Address".tr, style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600))),
Expanded(child: Text("Set as Default Address".tr(), style: AppThemeData.mediumTextStyle(fontSize: 14, color: AppThemeData.grey600))),
Transform.scale(
scale: 0.7, // Decrease the size (try 0.5, 0.6, etc.)
child: Switch(
@@ -97,8 +98,8 @@ class EnterManuallyLocationScreen extends StatelessWidget {
);
},
child: TextFieldWidget(
title: "Choose Location".tr,
hintText: "Choose Location".tr,
title: "Choose Location".tr(),
hintText: "Choose Location".tr(),
readOnly: true,
enable: false,
controller: null,
@@ -137,15 +138,15 @@ class EnterManuallyLocationScreen extends StatelessWidget {
),
),
const SizedBox(height: 15),
TextFieldWidget(title: "Flat/House/Floor/Building*".tr, hintText: "Enter address details".tr, controller: controller.houseBuildingTextEditingController.value),
TextFieldWidget(title: "Flat/House/Floor/Building*".tr(), hintText: "Enter address details".tr(), controller: controller.houseBuildingTextEditingController.value),
const SizedBox(height: 15),
TextFieldWidget(title: "Area/Sector/Locality*".tr, hintText: "Enter area/locality".tr, controller: controller.localityEditingController.value),
TextFieldWidget(title: "Area/Sector/Locality*".tr(), hintText: "Enter area/locality".tr(), controller: controller.localityEditingController.value),
const SizedBox(height: 15),
TextFieldWidget(title: "Nearby Landmark".tr, hintText: "Add a landmark".tr, controller: controller.landmarkEditingController.value),
TextFieldWidget(title: "Nearby Landmark".tr(), hintText: "Add a landmark".tr(), controller: controller.landmarkEditingController.value),
const SizedBox(height: 30),
Container(height: 1, color: AppThemeData.grey200),
const SizedBox(height: 25),
Text("Save Address As".tr, style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
Text("Save Address As".tr(), style: AppThemeData.boldTextStyle(fontSize: 14, color: AppThemeData.grey900)),
const SizedBox(height: 10),
Wrap(
spacing: 10,
@@ -175,18 +176,18 @@ class EnterManuallyLocationScreen extends StatelessWidget {
const SizedBox(height: 30),
RoundedButtonFill(
borderRadius: 10.r,
title: "Save Address".tr,
title: "Save Address".tr(),
color: AppThemeData.primary300,
textColor: AppThemeData.grey50,
onPress: () async {
if (controller.location.value.latitude == null || controller.location.value.longitude == null) {
ShowToastDialog.showToast("Please select Location".tr);
ShowToastDialog.showToast("Please select Location".tr());
} else if (controller.houseBuildingTextEditingController.value.text.isEmpty) {
ShowToastDialog.showToast("Please Enter Flat / House / Floor / Building".tr);
ShowToastDialog.showToast("Please Enter Flat / House / Floor / Building".tr());
} else if (controller.localityEditingController.value.text.isEmpty) {
ShowToastDialog.showToast("Please Enter Area / Sector / Locality".tr);
ShowToastDialog.showToast("Please Enter Area / Sector / Locality".tr());
} else {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
//Common values
controller.shippingModel.value.location = controller.location.value;

View File

@@ -9,6 +9,7 @@ import 'package:customer/themes/show_toast_dialog.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_screenutil/flutter_screenutil.dart';
import 'package:geocoding/geocoding.dart';
@@ -39,7 +40,7 @@ class LocationPermissionScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 25),
child: Text(
"Enable Location for a Personalized Experience".tr,
"Enable Location for a Personalized Experience".tr(),
style: AppThemeData.boldTextStyle(fontSize: 24, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900),
textAlign: TextAlign.center,
),
@@ -48,7 +49,7 @@ class LocationPermissionScreen extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 50),
child: Text(
"Allow location access to discover beauty stores and services near you.".tr,
"Allow location access to discover beauty stores and services near you.".tr(),
style: AppThemeData.mediumTextStyle(fontSize: 14, color: isDark ? AppThemeData.greyDark600 : AppThemeData.grey600),
textAlign: TextAlign.center,
),
@@ -56,12 +57,12 @@ class LocationPermissionScreen extends StatelessWidget {
const SizedBox(height: 30),
RoundedButtonFill(
borderRadius: 10.r,
title: "Use current location".tr,
title: "Use current location".tr(),
onPress: () async {
Constant.checkPermission(
context: context,
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
ShippingAddress addressModel = ShippingAddress();
try {
await Geolocator.requestPermission();
@@ -107,12 +108,12 @@ class LocationPermissionScreen extends StatelessWidget {
const SizedBox(height: 10),
RoundedButtonFill(
borderRadius: 10.r,
title: "Set from map".tr,
title: "Set from map".tr(),
onPress: () async {
Constant.checkPermission(
context: context,
onTap: () async {
ShowToastDialog.showLoader("Please wait...".tr);
ShowToastDialog.showLoader("Please wait...".tr());
ShippingAddress addressModel = ShippingAddress();
try {
await Geolocator.requestPermission();
@@ -180,7 +181,7 @@ class LocationPermissionScreen extends StatelessWidget {
}
});
},
child: Text("Enter Manually location".tr, style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
child: Text("Enter Manually location".tr(), style: AppThemeData.semiBoldTextStyle(fontSize: 16, color: isDark ? AppThemeData.greyDark900 : AppThemeData.grey900)),
),
],
),