BASE: Initialize Localization.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../models/cab_order_model.dart';
|
||||
@@ -21,7 +22,7 @@ class ComplainController extends GetxController {
|
||||
order.value = args['order'] as CabOrderModel;
|
||||
getComplain();
|
||||
} else {
|
||||
ShowToastDialog.showToast("Order data not found".tr);
|
||||
ShowToastDialog.showToast("Order data not found".tr());
|
||||
Get.back();
|
||||
}
|
||||
}
|
||||
@@ -35,7 +36,7 @@ class ComplainController extends GetxController {
|
||||
comment.value.text = data['description'] ?? '';
|
||||
}
|
||||
} catch (e) {
|
||||
ShowToastDialog.showToast("Failed to load complaint".tr);
|
||||
ShowToastDialog.showToast("Failed to load complaint".tr());
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
@@ -44,12 +45,12 @@ class ComplainController extends GetxController {
|
||||
Future<void> submitComplain() async {
|
||||
// Validation
|
||||
if (title.value.text.trim().isEmpty) {
|
||||
ShowToastDialog.showToast("Please enter complaint title".tr);
|
||||
ShowToastDialog.showToast("Please enter complaint title".tr());
|
||||
return;
|
||||
}
|
||||
|
||||
if (comment.value.text.trim().isEmpty) {
|
||||
ShowToastDialog.showToast("Please enter complaint description".tr);
|
||||
ShowToastDialog.showToast("Please enter complaint description".tr());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,15 +73,15 @@ class ComplainController extends GetxController {
|
||||
);
|
||||
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Your complaint has been submitted to admin".tr);
|
||||
ShowToastDialog.showToast("Your complaint has been submitted to admin".tr());
|
||||
Get.back();
|
||||
} else {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Your complaint is already submitted".tr);
|
||||
ShowToastDialog.showToast("Your complaint is already submitted".tr());
|
||||
}
|
||||
} catch (e) {
|
||||
ShowToastDialog.closeLoader();
|
||||
ShowToastDialog.showToast("Something went wrong, please try again".tr);
|
||||
ShowToastDialog.showToast("Something went wrong, please try again".tr());
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user