Merge branch 'development_new_design_2.0' into haroon-new-design

merge-update-with-lab-changes
haroon amjad 4 years ago
commit 6cd2f65ce8

@ -606,6 +606,8 @@ const Map localizedValues = {
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"select": {"en": "Select", "ar": "يختار"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
@ -1299,6 +1301,8 @@ const Map localizedValues = {
"app-update": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"}, "app-update": {"en": "UPDATE THE APP", "ar": "تحديث التطبيق"},
"covid-alert": {"en": "Alert", "ar": "تنبيه"}, "covid-alert": {"en": "Alert", "ar": "تنبيه"},
"enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم التعريف"}, "enterIdentificationNumber": {"en": "Enter Identification Number", "ar": "أدخل رقم التعريف"},
"identificationNumber": {"en": "Identification Number", "ar": "رقم الهوية"},
"complaintNumber": {"en": "Complaint Number", "ar": "رقم الشكوى"},
"accountActivationDesc": { "accountActivationDesc": {
"en": " This service allows you to activate your LAKUM account after registering completed.", "en": " This service allows you to activate your LAKUM account after registering completed.",
"ar": " تتيح لك هذه الخدمة تفعيل حساب برنامج الولاء لكم بعد اكتمال التسجيل. " "ar": " تتيح لك هذه الخدمة تفعيل حساب برنامج الولاء لكم بعد اكتمال التسجيل. "
@ -1500,6 +1504,10 @@ const Map localizedValues = {
"invoiceDetails": {"en": "Invoice Details", "ar": "تفاصيل الفاتورة"}, "invoiceDetails": {"en": "Invoice Details", "ar": "تفاصيل الفاتورة"},
"appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"}, "appoDetails": {"en": "Appointment Details", "ar": "تفاصيل الموعد"},
"appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"}, "appoPaymentConfirm": {"en": "Are you sure you Want to make payment for this appointment?", "ar": "هل أنت متأكد من أنك تريد سداد هذا الموعد؟"},
"selectSearchCriteria": {"en": "Select the search criteria", "ar": "حدد معايير البحث"},
"enterComplainNumber": {"en": "Enter the Complain Number", "ar": "أدخل رقم الشكوى"},
"enterfileNumber": {"en": "Enter File Number", "ar": "أدخل رقم الملف"},
"please_select_from_below_options": {"en": "Please select from below options:", "ar": "الرجاء التحديد من الخيارات أدناه:"},
"selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" }, "selectLanguage": { "en": "Please select any language:", "ar": ":الرجاء تحديد أي لغة" },
"recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" }, "recAlert": { "en": "How do you want to receive alerts?", "ar": "كيف تريد تلقي التنبيهات؟" },
"modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" }, "modesBelow": { "en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه" },

@ -13,37 +13,28 @@ class FeedbackService extends BaseService {
RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem(); RequestInsertCOCItem _requestInsertCOCItem = RequestInsertCOCItem();
List<AppoitmentAllHistoryResultList> appointHistoryList = List(); List<AppoitmentAllHistoryResultList> appointHistoryList = List();
Future sendCOCItem( Future sendCOCItem({String title, String details, String cOCTypeName, String attachment, AppoitmentAllHistoryResultList appointHistory}) async {
{String title,
String details,
String cOCTypeName,
String attachment,
AppoitmentAllHistoryResultList appointHistory}) async {
hasError = false; hasError = false;
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_requestInsertCOCItem.attachment = attachment; _requestInsertCOCItem.attachment = attachment;
_requestInsertCOCItem.title = title; _requestInsertCOCItem.title = title;
_requestInsertCOCItem.details = details; _requestInsertCOCItem.details = details;
_requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.cOCTypeName = cOCTypeName;
_requestInsertCOCItem.formTypeID = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName;
_requestInsertCOCItem.mobileNo = _requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
"966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
_requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.isUserLoggedIn = true;
_requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.projectID = user.projectID;
_requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName;
_requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.fileName = "";
_requestInsertCOCItem.appVersion = VERSION_ID; _requestInsertCOCItem.appVersion = VERSION_ID;
_requestInsertCOCItem.uILanguage = _requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic
languageID; //TODO Change it to be dynamic
_requestInsertCOCItem.browserInfo = Platform.localHostname; _requestInsertCOCItem.browserInfo = Platform.localHostname;
_requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.deviceInfo = Platform.localHostname;
_requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.resolution = "400x847";
_requestInsertCOCItem.projectID = 0; _requestInsertCOCItem.projectID = 0;
_requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; _requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948";
_requestInsertCOCItem.identificationNo = _requestInsertCOCItem.identificationNo = int.parse(user.patientIdentificationNo);
int.parse(user.patientIdentificationNo);
if (BASE_URL.contains('uat')) { if (BASE_URL.contains('uat')) {
_requestInsertCOCItem.forDemo = true; _requestInsertCOCItem.forDemo = true;
} else { } else {
@ -61,9 +52,7 @@ class FeedbackService extends BaseService {
body['ProjectName'] = appointHistory.projectName; body['ProjectName'] = appointHistory.projectName;
} }
await baseAppClient await baseAppClient.post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
.post(SEND_FEEDBACK, onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -73,15 +62,34 @@ class FeedbackService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
body['MobileNo'] = body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
"966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
body['Searching_type'] = '1'; body['Searching_type'] = '1';
if (BASE_URL.contains('uat')) { if (BASE_URL.contains('uat')) {
body['ForDemo'] = true; body['ForDemo'] = true;
} }
await baseAppClient.post(GET_STATUS_FOR_COCO, await baseAppClient.post(GET_STATUS_FOR_COCO, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { cOCItemList = [];
response['ListCOCItems'].forEach((cOC) {
cOCItemList.add(COCItem.fromJson(cOC));
});
cOCItemList = cOCItemList.reversed.toList(); // Sort list in desc order
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async {
hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = idNumber;
body['MobileNo'] = countryCode + Utils.getPhoneNumberWithoutZero(phoneNumber);
body['Searching_type'] = "$type";
if (BASE_URL.contains('uat')) {
body['ForDemo'] = true;
}
await baseAppClient.post(GET_STATUS_FOR_COCO, onSuccess: (dynamic response, int statusCode) {
cOCItemList = []; cOCItemList = [];
response['ListCOCItems'].forEach((cOC) { response['ListCOCItems'].forEach((cOC) {
cOCItemList.add(COCItem.fromJson(cOC)); cOCItemList.add(COCItem.fromJson(cOC));
@ -97,12 +105,10 @@ class FeedbackService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IsComingFromCOC'] = true; body['IsComingFromCOC'] = true;
baseAppClient.post(GET_PATIENT_AppointmentHistory, baseAppClient.post(GET_PATIENT_AppointmentHistory, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
appointHistoryList = []; appointHistoryList = [];
response['AppoimentAllHistoryResultList'].forEach((appoint) { response['AppoimentAllHistoryResultList'].forEach((appoint) {
appointHistoryList appointHistoryList.add(AppoitmentAllHistoryResultList.fromJson(appoint));
.add(AppoitmentAllHistoryResultList.fromJson(appoint));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -6,37 +6,18 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
import '../../../locator.dart'; import '../../../locator.dart';
enum MessageType { enum MessageType { ComplaintOnAnAppointment, ComplaintWithoutAppointment, Question, Compliment, Suggestion, NON }
ComplaintOnAnAppointment,
ComplaintWithoutAppointment,
Question,
Compliment,
Suggestion,
NON
}
class FeedbackViewModel extends BaseViewModel { class FeedbackViewModel extends BaseViewModel {
FeedbackService _feedbackService = locator<FeedbackService>(); FeedbackService _feedbackService = locator<FeedbackService>();
List<COCItem> get cOCItemList => _feedbackService.cOCItemList; List<COCItem> get cOCItemList => _feedbackService.cOCItemList;
List<AppoitmentAllHistoryResultList> get appointHistoryList => _feedbackService.appointHistoryList;
List<AppoitmentAllHistoryResultList> get appointHistoryList => Future<bool> sendCOCItem({String title, String details, String cOCTypeName, String attachment, AppoitmentAllHistoryResultList appointHistory}) async {
_feedbackService.appointHistoryList;
Future<bool> sendCOCItem(
{String title,
String details,
String cOCTypeName,
String attachment,
AppoitmentAllHistoryResultList appointHistory}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _feedbackService.sendCOCItem( await _feedbackService.sendCOCItem(title: title, details: details, cOCTypeName: cOCTypeName, attachment: attachment, appointHistory: appointHistory);
title: title,
details: details,
cOCTypeName: cOCTypeName,
attachment: attachment,
appointHistory: appointHistory);
if (_feedbackService.hasError) { if (_feedbackService.hasError) {
error = _feedbackService.error; error = _feedbackService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -58,7 +39,18 @@ class FeedbackViewModel extends BaseViewModel {
} }
} }
Future getPatentAppointmentHistory() async { searchFeedback(String countryCode, String phoneNumber, int type, String idNumber) async {
setState(ViewState.Busy);
await _feedbackService.searchFeedback(countryCode, phoneNumber, type, idNumber);
if (_feedbackService.hasError) {
error = _feedbackService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future getPatentAppointmentHistory() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _feedbackService.getPatentAppointmentHistory(); await _feedbackService.getPatentAppointmentHistory();
if (_feedbackService.hasError) { if (_feedbackService.hasError) {

@ -1,11 +1,17 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -18,6 +24,12 @@ class StatusFeedbackPage extends StatefulWidget {
} }
class _StatusFeedbackPageState extends State<StatusFeedbackPage> { class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
String countryCode = '966';
String mobileNo = "";
TextEditingController complainNumberController = TextEditingController();
StatusType statusType = StatusType.ComplaintNumber;
int selectedStatusIndex = 3;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -29,111 +41,273 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
child: model.cOCItemList.isNotEmpty child: projectViewModel.isLogin
? Container( ? !model.cOCItemList.isNotEmpty
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), ? listData(model.cOCItemList, projectViewModel.isArabic, true)
child: ListView.builder( : Center(
itemCount: model.cOCItemList.length, child: Column(
itemBuilder: (context, index) => InkWell( children: [
onTap: () { SizedBox(
}, height: MediaQuery.of(context).size.height * 0.4,
child: Card( ),
shape: cardRadius(12), Image.asset(
margin: EdgeInsets.all(10), 'assets/images/comments.png',
child: Padding( width: 80,
padding: const EdgeInsets.all(12.0), height: 80,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, SizedBox(
children: [ height: 15,
Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Text(
children: [ TranslationBase.of(context).noSearchResult,
Text(projectViewModel.isArabic ? model.cOCItemList[index].statusAr : model.cOCItemList[index].status, style: TextStyle(
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), fontSize: 16,
Container( fontWeight: FontWeight.w600,
margin: EdgeInsets.only(top: 5.0), letterSpacing: -0.48,
child: Text(model.cOCItemList[index].formType.toString(), color: Color(0xff2B353E),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12))),
myRichText(TranslationBase.of(context).number + ": ", model.cOCItemList[index].itemID.toString(), projectViewModel.isArabic),
Text(model.cOCItemList[index].cOCTitle,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48,
height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(model.cOCItemList[index].date.split(" ")[0],
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48)),
Text(model.cOCItemList[index].date.split(" ")[1].substring(0, 4),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
color: Color(0xff2B353E),
letterSpacing: -0.48)),
],
),
],
),
),
), ),
)), ),
) ],
: Center( ),
)
: SingleChildScrollView(
padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(
height: MediaQuery.of(context).size.height * 0.4,
),
Image.asset(
'assets/images/comments.png',
width: 80,
height: 80,
),
SizedBox(
height: 15,
),
Text( Text(
TranslationBase.of(context).noSearchResult, TranslationBase.of(context).selectSearchCriteria,
style: TextStyle( style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
fontSize: 16, ),
fontWeight: FontWeight.w600, SizedBox(height: 21),
letterSpacing: -0.48, InkWell(
color: Color(0xff2B353E), onTap: () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).complaintNumber, 3),
RadioSelectionDialogModel(TranslationBase.of(context).fileNumber, 1),
RadioSelectionDialogModel(TranslationBase.of(context).identificationNumber, 2),
];
showDialog(
context: context,
child: RadioSelectionDialog(
listData: list,
selectedIndex: selectedStatusIndex,
onValueSelected: (index) {
selectedStatusIndex = index;
setState(() {
if (index == 3) {
statusType = StatusType.ComplaintNumber;
} else if (index == 1) {
statusType = StatusType.FileNumber;
} else {
statusType = StatusType.IdentificationNumber;
}
});
},
),
);
},
child: Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
getSelected(context),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
color: Color(0xff2B353E),
),
),
Icon(
Icons.keyboard_arrow_down,
size: 22,
color: Colors.grey,
)
],
),
), ),
), ),
SizedBox(height: 12),
Directionality(
textDirection: TextDirection.ltr,
child: inputWidget(
statusType == StatusType.ComplaintNumber
? TranslationBase.of(context).enterComplainNumber
: (statusType == StatusType.FileNumber ? TranslationBase.of(context).enterfileNumber : TranslationBase.of(context).enterIdentificationNumber),
"",
complainNumberController,
isInputTypeNum: true)),
SizedBox(height: 12),
PhoneNumberSelectorWidget(onNumberChange: (value) {
setState(() {
mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
countryCode = value;
});
}),
], ],
), ),
), ),
), ),
if (!projectViewModel.isLogin)
Container(
color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton(
TranslationBase.of(context).search,
projectViewModel.isLogin || (mobileNo.length < 9) || (complainNumberController.text.isEmpty)
? null
: () {
model.searchFeedback(countryCode, mobileNo, selectedStatusIndex, complainNumberController.text).then((value) {
if (model.state == ViewState.ErrorLocal) {
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: model.error);
});
} else {
listData(model.cOCItemList, projectViewModel.isArabic, false);
}
});
},
disabledColor: Colors.grey,
),
),
], ],
), ),
bottomSheet: projectViewModel.isLogin ? Container( ),
color: Colors.white, );
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), }
child: DefaultButton(
TranslationBase.of(context).search, Widget listData(List<COCItem> cOCItemList, bool isArabic, bool isLogin) {
projectViewModel.isLogin ? null : () => {}, return ListView.builder(
disabledColor: Colors.grey, padding: isLogin ? EdgeInsets.all(21) : null,
itemCount: cOCItemList.length,
shrinkWrap: isLogin ? false : true,
physics: isLogin ? null : NeverScrollableScrollPhysics(),
itemBuilder: (context, index) => InkWell(
onTap: () {},
child: Card(
shape: cardRadius(12),
margin: EdgeInsets.all(10),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(isArabic ? cOCItemList[index].statusAr : cOCItemList[index].status, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(cOCItemList[index].formType.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12))),
myRichText(TranslationBase.of(context).number + ": ", cOCItemList[index].itemID.toString(), isArabic),
Text(cOCItemList[index].cOCTitle,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12)),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(cOCItemList[index].date.split(" ")[0],
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
Text(cOCItemList[index].date.split(" ")[1].substring(0, 4),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48)),
],
),
],
),
), ),
) : Container(), ),
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller,
{VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? TextInputType.number : TextInputType.text,
controller: _controller,
maxLines: lines,
onChanged: (value) => {setState(() {})},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
suffixIconConstraints: BoxConstraints(minWidth: 50),
suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
),
), ),
); );
} }
@ -141,4 +315,25 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
gotodetails(item) { gotodetails(item) {
Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item))); Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item)));
} }
String getSelected(BuildContext context) {
switch (statusType) {
case StatusType.ComplaintNumber:
return TranslationBase.of(context).complaintNumber;
break;
case StatusType.FileNumber:
return TranslationBase.of(context).fileNumber;
break;
case StatusType.IdentificationNumber:
return TranslationBase.of(context).identificationNumber;
break;
}
return TranslationBase.of(context).notClassified;
}
}
enum StatusType {
ComplaintNumber,
FileNumber,
IdentificationNumber,
} }

@ -805,6 +805,12 @@ class TranslationBase {
String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; String get fileNumber => localizedValues['FileNumber'][locale.languageCode];
String get enterfileNumber => localizedValues['enterfileNumber'][locale.languageCode];
String get complaintNumber => localizedValues['complaintNumber'][locale.languageCode];
String get identificationNumber => localizedValues['identificationNumber'][locale.languageCode];
String get amount => localizedValues['Amount'][locale.languageCode]; String get amount => localizedValues['Amount'][locale.languageCode];
String get depositorEmail => localizedValues['DepositorEmail'][locale.languageCode]; String get depositorEmail => localizedValues['DepositorEmail'][locale.languageCode];
@ -1504,6 +1510,8 @@ class TranslationBase {
String get selectAll => localizedValues['select-all'][locale.languageCode]; String get selectAll => localizedValues['select-all'][locale.languageCode];
String get select => localizedValues['select'][locale.languageCode];
String get selectMap => localizedValues['select-map'][locale.languageCode]; String get selectMap => localizedValues['select-map'][locale.languageCode];
String get noAppointment => localizedValues['no-appointment'][locale.languageCode]; String get noAppointment => localizedValues['no-appointment'][locale.languageCode];
@ -2374,6 +2382,9 @@ class TranslationBase {
String get appoPaymentConfirm => localizedValues["appoPaymentConfirm"][locale.languageCode]; String get appoPaymentConfirm => localizedValues["appoPaymentConfirm"][locale.languageCode];
String get selectSearchCriteria => localizedValues["selectSearchCriteria"][locale.languageCode];
String get enterComplainNumber => localizedValues["enterComplainNumber"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -183,6 +183,8 @@ class Utils {
String newNumber = ""; String newNumber = "";
if (number.startsWith('0')) { if (number.startsWith('0')) {
newNumber = number.substring(1); newNumber = number.substring(1);
} else {
newNumber = number;
} }
return newNumber; return newNumber;
} }

@ -0,0 +1,121 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:flutter/material.dart';
class RadioSelectionDialogModel {
String title;
int value;
RadioSelectionDialogModel(this.title, this.value);
}
class RadioSelectionDialog extends StatefulWidget {
final Function(int) onValueSelected;
final List<RadioSelectionDialogModel> listData;
final int selectedIndex;
const RadioSelectionDialog({Key key, this.onValueSelected, this.listData, this.selectedIndex}) : super(key: key);
@override
State createState() => new RadioSelectionDialogState();
}
class RadioSelectionDialogState extends State<RadioSelectionDialog> {
int selectedIndex;
@override
void initState() {
selectedIndex = widget.selectedIndex ?? 0;
super.initState();
}
Widget build(BuildContext context) {
return Dialog(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(),
insetPadding: EdgeInsets.only(left: 21, right: 21),
child: Padding(
padding: EdgeInsets.only(left: 20, right: 20, top: 18, bottom: 28),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.only(top: 16.0),
child: Text(
TranslationBase.of(context).select,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w600, color: Color(0xff2B353E), height: 35 / 24, letterSpacing: -0.96),
),
),
),
IconButton(
padding: EdgeInsets.zero,
icon: Icon(Icons.close),
color: Color(0xff2B353E),
constraints: BoxConstraints(),
onPressed: () {
Navigator.pop(context);
},
)
],
),
SizedBox(height: 21),
Text(
TranslationBase.of(context).pleaseSelectFromBelowOptions,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
),
ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
padding: EdgeInsets.only(bottom: 42, top: 10),
itemBuilder: (context, index) {
return Row(
children: [
SizedBox(
width: 22,
height: 22,
child: Radio(
value: widget.listData[index].value,
groupValue: selectedIndex,
onChanged: (value) {
setState(() {
selectedIndex = value;
});
},
),
),
SizedBox(width: 8),
Text(
widget.listData[index].title,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.56),
),
],
);
},
separatorBuilder: (context, index) => SizedBox(height: 10),
itemCount: widget.listData.length),
Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).save,
() {
Navigator.pop(context);
widget.onValueSelected(selectedIndex);
},
color: Color(0xff349745),
),
),
],
),
],
),
),
);
}
}
Loading…
Cancel
Save