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

# Conflicts:
#	lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart
merge-requests/427/head
haroon amjad 5 years ago
commit 829fcd1461

@ -1067,6 +1067,7 @@ const Map localizedValues = {
"pharmacyServiceTermsCondition": {"en": "I agree with the terms of service and I adhere to them unconditionally", "ar": " أوافق على شروط الخدمة وألتزم بها دون قيد أو شرط"}, "pharmacyServiceTermsCondition": {"en": "I agree with the terms of service and I adhere to them unconditionally", "ar": " أوافق على شروط الخدمة وألتزم بها دون قيد أو شرط"},
"Year": {"en": "YEAR", "ar": "السنة"}, "Year": {"en": "YEAR", "ar": "السنة"},
"years": {"en": "Years", "ar": "السنة"},
"Month": {"en": "MONTH", "ar": "الشهر"}, "Month": {"en": "MONTH", "ar": "الشهر"},
"point": {"en": "POINT", "ar": "النقاط"}, "point": {"en": "POINT", "ar": "النقاط"},
"riyal": {"en": "RIYAL", "ar": "الريال"}, "riyal": {"en": "RIYAL", "ar": "الريال"},

@ -115,6 +115,7 @@ class RRTViewModel extends BaseViewModel {
var success = false; var success = false;
await _service.baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, body: body, onSuccess: (response, statusCode) {
success = true; success = true;
rrtServiceData.pendingOrders.remove(order);
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
success = false; success = false;

@ -7,7 +7,7 @@ class ToDoCountProviderModel with ChangeNotifier {
int get count => _count == null ? 0 : _count; int get count => _count == null ? 0 : _count;
String get notificationsCount => _notificationsCount == null ? 0 : _notificationsCount; String get notificationsCount => _notificationsCount == null ? "0" : _notificationsCount;
bool get isShowBadge => _isShowBadge; bool get isShowBadge => _isShowBadge;

@ -295,13 +295,21 @@ class GetAllSharedRecordsByStatusList {
int iD; int iD;
int patientID; int patientID;
int responseID; int responseID;
Null relationshipID;
Null relationship;
Null relationshipN;
int regionID; int regionID;
int status; int status;
dynamic isActive; Null isActive;
String editedOn; String editedOn;
String createdOn; String createdOn;
int age;
String emaiLAddress; String emaiLAddress;
int gender;
String genderDescription;
String genderImage;
String mobileNumber; String mobileNumber;
int patientDataVerified;
String patientIdenficationNumber; String patientIdenficationNumber;
String patientName; String patientName;
String statusDescription; String statusDescription;
@ -310,13 +318,21 @@ class GetAllSharedRecordsByStatusList {
{this.iD, {this.iD,
this.patientID, this.patientID,
this.responseID, this.responseID,
this.relationshipID,
this.relationship,
this.relationshipN,
this.regionID, this.regionID,
this.status, this.status,
this.isActive, this.isActive,
this.editedOn, this.editedOn,
this.createdOn, this.createdOn,
this.age,
this.emaiLAddress, this.emaiLAddress,
this.gender,
this.genderDescription,
this.genderImage,
this.mobileNumber, this.mobileNumber,
this.patientDataVerified,
this.patientIdenficationNumber, this.patientIdenficationNumber,
this.patientName, this.patientName,
this.statusDescription}); this.statusDescription});
@ -325,13 +341,21 @@ class GetAllSharedRecordsByStatusList {
iD = json['ID']; iD = json['ID'];
patientID = json['PatientID']; patientID = json['PatientID'];
responseID = json['ResponseID']; responseID = json['ResponseID'];
relationshipID = json['RelationshipID'];
relationship = json['Relationship'];
relationshipN = json['RelationshipN'];
regionID = json['RegionID']; regionID = json['RegionID'];
status = json['Status']; status = json['Status'];
isActive = json['IsActive']; isActive = json['IsActive'];
editedOn = json['EditedOn']; editedOn = json['EditedOn'];
createdOn = json['CreatedOn']; createdOn = json['CreatedOn'];
age = json['Age'];
emaiLAddress = json['EmaiLAddress']; emaiLAddress = json['EmaiLAddress'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
genderImage = json['GenderImage'];
mobileNumber = json['MobileNumber']; mobileNumber = json['MobileNumber'];
patientDataVerified = json['PatientDataVerified'];
patientIdenficationNumber = json['PatientIdenficationNumber']; patientIdenficationNumber = json['PatientIdenficationNumber'];
patientName = json['PatientName']; patientName = json['PatientName'];
statusDescription = json['StatusDescription']; statusDescription = json['StatusDescription'];
@ -342,13 +366,21 @@ class GetAllSharedRecordsByStatusList {
data['ID'] = this.iD; data['ID'] = this.iD;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['ResponseID'] = this.responseID; data['ResponseID'] = this.responseID;
data['RelationshipID'] = this.relationshipID;
data['Relationship'] = this.relationship;
data['RelationshipN'] = this.relationshipN;
data['RegionID'] = this.regionID; data['RegionID'] = this.regionID;
data['Status'] = this.status; data['Status'] = this.status;
data['IsActive'] = this.isActive; data['IsActive'] = this.isActive;
data['EditedOn'] = this.editedOn; data['EditedOn'] = this.editedOn;
data['CreatedOn'] = this.createdOn; data['CreatedOn'] = this.createdOn;
data['Age'] = this.age;
data['EmaiLAddress'] = this.emaiLAddress; data['EmaiLAddress'] = this.emaiLAddress;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['GenderImage'] = this.genderImage;
data['MobileNumber'] = this.mobileNumber; data['MobileNumber'] = this.mobileNumber;
data['PatientDataVerified'] = this.patientDataVerified;
data['PatientIdenficationNumber'] = this.patientIdenficationNumber; data['PatientIdenficationNumber'] = this.patientIdenficationNumber;
data['PatientName'] = this.patientName; data['PatientName'] = this.patientName;
data['StatusDescription'] = this.statusDescription; data['StatusDescription'] = this.statusDescription;

@ -1,5 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -7,19 +8,23 @@ import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dar
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list;
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
@ -28,14 +33,13 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_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';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible; final bool isAppbarVisible;
MyFamily({this.isAppbarVisible = true}); MyFamily({this.isAppbarVisible = true});
@override @override
_MyFamily createState() => _MyFamily(); _MyFamily createState() => _MyFamily();
} }
@ -55,6 +59,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
var isVaiable = false; var isVaiable = false;
bool isSwitchUser = false;
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: 0); _tabController = new TabController(length: 2, vsync: this, initialIndex: 0);
@ -102,46 +108,64 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// ), // ),
// ), // ),
// ), // ),
// Center(
// child: Container(
// height: 60.0,
// // margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.92, // 0.9,
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7
// ),
// color: Colors.white),
Center( Center(
child: Container( child:
height: 60.0, // TabBar(
margin: EdgeInsets.only(top: 10.0), // isScrollable: true,
width: MediaQuery.of(context).size.width * 0.92, // 0.9, // controller: _tabController,
decoration: BoxDecoration( // indicatorWeight: 5.0,
border: Border( // indicatorSize: TabBarIndicatorSize.tab,
bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7 // labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
), // unselectedLabelColor: Colors.grey[800],
color: Colors.white), // tabs: [
child: Center( // Container(
child: TabBar( // width: MediaQuery.of(context).size.width * 0.30,
isScrollable: true, // child: Center(
// child: AppText(TranslationBase.of(context).family),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.30,
// child: Center(
// child: AppText(TranslationBase.of(context).request),
// ),
// ),
// ],
// ),
TabBar(
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 3.0,
//indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
// indicatorColor: Theme.of(context).primaryColor, unselectedLabelColor: Color(0xff575757),
// labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), labelStyle: TextStyle(
unselectedLabelColor: Colors.grey[800], fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
tabs: [ fontSize: 16,
Container( fontWeight: FontWeight.w600,
width: MediaQuery.of(context).size.width * 0.30, letterSpacing: -0.48,
child: Center(
child: AppText(TranslationBase.of(context).family),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.30,
child: Center(
child: AppText(TranslationBase.of(context).request),
),
),
],
), ),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
), ),
tabs: [Text(TranslationBase.of(context).family), Text(TranslationBase.of(context).request)],
), ),
), ),
// ),
// ),
], ],
), ),
), ),
@ -159,15 +183,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
], ],
), ),
bottomSheet: Container( bottomSheet: Container(
width: MediaQuery.of(context).size.width, color: Theme.of(context).scaffoldBackgroundColor,
height: 70.0, width: double.infinity,
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), padding: EdgeInsets.all(14),
child: Button( child: DefaultButton(
onTap: () async { TranslationBase.of(context).addFamilyMember,
() async {
Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE); Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE);
}, },
label: TranslationBase.of(context).addFamilyMember,
backgroundColor: Colors.red[900],
), ),
), ),
), ),
@ -195,50 +218,105 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return Padding( return Padding(
padding: EdgeInsets.only(top: 50), padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ // children: <Widget>[
Expanded( // Expanded(
flex: 3, // flex: 3,
child: Texts( // child: Texts(
TranslationBase.of(context).request, // TranslationBase.of(context).request,
textAlign: TextAlign.center, // textAlign: TextAlign.center,
)), // )),
Expanded(flex: 2, child: Texts(TranslationBase.of(context).switchUser, textAlign: TextAlign.center)), // Expanded(flex: 2, child: Texts(TranslationBase.of(context).switchUser, textAlign: TextAlign.center)),
Expanded(flex: 1, child: Texts(TranslationBase.of(context).deleteView, textAlign: TextAlign.center)), // Expanded(flex: 1, child: Texts(TranslationBase.of(context).deleteView, textAlign: TextAlign.center)),
], // ],
), // ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) { children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return result.status == 3 return result.status == 3
? Padding( ? Card(
margin: EdgeInsets.all(10),
shape: cardRadius(15),
color: result.gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0),
elevation: 3,
child: Container(
// height: 130,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)), Texts(
Expanded( result.patientName.toLowerCase().capitalizeFirstofEach,
flex: 2, fontSize: 22,
child: IconButton( fontWeight: FontWeight.bold,
icon: Icon(Icons.group), color: Colors.white,
color: Colors.black, ),
onPressed: () { Texts(TranslationBase.of(context).fileNumber + ': ' + result.responseID.toString(), fontSize: 12, color: Colors.white),
switchUser(result, context); Texts(result.age.toString() + ' ' + TranslationBase.of(context).years + ', ' + result.genderDescription, fontSize: 12, color: Colors.white),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
CupertinoSwitch(
value: isSwitchUser,
onChanged: (value) {
setState(() {
isSwitchUser = value;
});
if (isSwitchUser == true) switchUser(result, context);
}, },
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
), ),
onPressed: () { Texts(
TranslationBase.of(context).switchUser,
color: Colors.white,
fontSize: 12,
)
],
),
InkWell(
onTap: () {
deleteFamily(result, context); deleteFamily(result, context);
}, },
)), child: Row(
children: [
Texts(
TranslationBase.of(context).delete,
color: Colors.white,
fontSize: 12,
),
Icon(
Icons.delete,
color: Colors.white,
),
], ],
)) ))
],
)
// Expanded(
// flex: 2,
// child: IconButton(
// icon: Icon(Icons.group),
// color: Colors.black,
// onPressed: () {
// switchUser(result, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.delete,
// color: Colors.black,
// ),
// onPressed: () {
// deleteFamily(result, context);
// },
// )),
],
)))
: SizedBox(); : SizedBox();
}).toList()) }).toList())
])); ]));
@ -308,8 +386,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
])), ])),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Padding( return Card(
padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)), Expanded(flex: 3, child: Text(result.patientName)),
@ -525,7 +602,6 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
loginAfter(result, context) async { loginAfter(result, context) async {
GifLoaderDialogUtils.hideDialog(context);
var currentLang = await sharedPref.getString(APP_LANGUAGE); var currentLang = await sharedPref.getString(APP_LANGUAGE);
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true); Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true);
result = list.CheckActivationCode.fromJson(result); result = list.CheckActivationCode.fromJson(result);
@ -559,7 +635,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
getToDoCount(), getToDoCount(),
// Utils.hideProgressDialog(), GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
@ -582,7 +658,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
.catchError((err) { .catchError((err) {
print(err); print(err);
// Utils.hideProgressDialog(); // Utils.hideProgressDialog();
// GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }

@ -5,6 +5,10 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class RRTLogPage extends StatefulWidget { class RRTLogPage extends StatefulWidget {
final List<PrescriptionsOrder> orders; final List<PrescriptionsOrder> orders;
@ -18,10 +22,18 @@ class RRTLogPage extends StatefulWidget {
class RRTLogPageState extends State<RRTLogPage> { class RRTLogPageState extends State<RRTLogPage> {
RRTViewModel viewModel; RRTViewModel viewModel;
@override
void initState() {
setState(() {});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm) => viewModel = vm, onModelReady: (vm) => {
viewModel = vm,
},
builder: (ctx, vm, widgetState) { builder: (ctx, vm, widgetState) {
return ListView.builder( return ListView.builder(
itemCount: widget.orders.length, itemCount: widget.orders.length,
@ -36,12 +48,13 @@ class RRTLogPageState extends State<RRTLogPage> {
deleteOrder(PrescriptionsOrder order) async { deleteOrder(PrescriptionsOrder order) async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
var success = await viewModel.cancelOrder(order); var success = await viewModel.cancelOrder(order);
GifLoaderDialogUtils.hideDialog(context);
if (success) { if (success) {
setState(() { viewModel.setState(ViewState.Busy);
widget.orders.remove(order);
});
}
await viewModel.getAllOrders(); await viewModel.getAllOrders();
viewModel.setState(ViewState.Idle);
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(context, FadePage(page: RRTMainScreen()));
}
} }
} }

@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RRTMainScreen extends StatefulWidget { class RRTMainScreen extends StatefulWidget {
final index = 0;
RRTMainScreen({index});
@override @override
State<StatefulWidget> createState() => RRTMainScreenState(); State<StatefulWidget> createState() => RRTMainScreenState();
} }

@ -5,26 +5,37 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5)); final _item_content_seperator = Container(height: 0.25, padding: EdgeInsets.all(10), color: Colors.grey.withOpacity(0.5));
class RRTLogListItem extends StatelessWidget { class RRTLogListItem extends StatefulWidget {
final PrescriptionsOrder order; final PrescriptionsOrder order;
final Function(PrescriptionsOrder) onCancel; final Function(PrescriptionsOrder) onCancel;
RRTLogListItem(this.order, {this.onCancel}); RRTLogListItem(this.order, {this.onCancel});
@override
State<StatefulWidget> createState() => RRTLogListItemState();
BuildContext _context; BuildContext _context;
}
class RRTLogListItemState extends State<RRTLogListItem> {
RRTViewModel viewModel;
TranslationBase localize; TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
_context = context;
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
int status = order.status; int status = widget.order.status;
String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description; String _statusDisp = projectViewModel.isArabic ? widget.order.descriptionN : widget.order.description;
Color _color; Color _color;
if (status == 1) { if (status == 1) {
//pending //pending
@ -39,6 +50,11 @@ class RRTLogListItem extends StatelessWidget {
//cancel // Rejected //cancel // Rejected
_color = Color(0xffD02127); _color = Color(0xffD02127);
} }
return BaseView<RRTViewModel>(
onModelReady: (vm) => {
viewModel = vm,
},
builder: (ctx, vm, widgetState) {
return Container( return Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -83,7 +99,7 @@ class RRTLogListItem extends StatelessWidget {
), ),
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
'${TranslationBase.of(context).requestID}: ${order.iD}', '${TranslationBase.of(context).requestID}: ${widget.order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Row( Row(
@ -95,7 +111,7 @@ class RRTLogListItem extends StatelessWidget {
), ),
Expanded( Expanded(
child: Text( child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), !projectViewModel.isArabic ? widget.order.nearestProjectDescription.trim().toString() : widget.order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
), ),
@ -110,7 +126,7 @@ class RRTLogListItem extends StatelessWidget {
), ),
Expanded( Expanded(
child: Text( child: Text(
order.getFormattedDateTime(), widget.order.getFormattedDateTime(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
), ),
@ -124,14 +140,15 @@ class RRTLogListItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(order.createdOn), DateUtil.getDayMonthYearDateFormattedLang(widget.order.createdOn, projectViewModel.isArabic),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (order.status == 1 || order.status == 2) if (widget.order.status == 1 || widget.order.status == 2)
InkWell( InkWell(
onTap: () { onTap: () {
onCancel(order); //onCancel(order);
cancelOrders(widget.order);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -152,6 +169,7 @@ class RRTLogListItem extends StatelessWidget {
), ),
), ),
); );
});
// return Container( // return Container(
// padding: EdgeInsets.all(15), // padding: EdgeInsets.all(15),
@ -207,4 +225,16 @@ class RRTLogListItem extends StatelessWidget {
// style: TextStyle(color: Colors.white, fontSize: 13), // style: TextStyle(color: Colors.white, fontSize: 13),
// ), // ),
// ); // );
cancelOrders(order) async {
GifLoaderDialogUtils.showMyDialog(context);
var success = await viewModel.cancelOrder(order);
if (success) {
viewModel.setState(ViewState.Busy);
await viewModel.getAllOrders();
viewModel.setState(ViewState.Idle);
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(context, FadePage(page: RRTMainScreen()));
}
}
} }

@ -16,6 +16,7 @@ import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
class RRTPlaceOrderPage extends StatelessWidget { class RRTPlaceOrderPage extends StatelessWidget {
TranslationBase localize; TranslationBase localize;
@ -206,7 +207,10 @@ class RRTPlaceOrderPage extends StatelessWidget {
} }
} }
gotoRRTRoot() { gotoRRTRoot() async {
viewModel.setState(ViewState.Busy);
await viewModel.getAllOrders();
viewModel.setState(ViewState.Idle);
Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen));
Navigator.push(_context, FadePage(page: RRTMainScreen())); Navigator.push(_context, FadePage(page: RRTMainScreen()));
} }

@ -1790,6 +1790,8 @@ class TranslationBase {
String get year => localizedValues['Year'][locale.languageCode]; String get year => localizedValues['Year'][locale.languageCode];
String get years => localizedValues['years'][locale.languageCode];
String get month => localizedValues['Month'][locale.languageCode]; String get month => localizedValues['Month'][locale.languageCode];
String get point => localizedValues['point'][locale.languageCode]; String get point => localizedValues['point'][locale.languageCode];

@ -65,6 +65,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
index: widget.index, index: widget.index,
currentIndex: 3, currentIndex: 3,
name: TranslationBase.of(context).myFamily, name: TranslationBase.of(context).myFamily,
// isDisabled: projectViewModel.isLoginChild,
), ),
if (widget.index == 0) if (widget.index == 0)
(widget.showHomeIcon) (widget.showHomeIcon)

@ -16,17 +16,11 @@ class BottomNavigationItem extends StatelessWidget {
final int index; final int index;
final int currentIndex; final int currentIndex;
final String name; final String name;
final bool isDisabled;
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
BottomNavigationItem( BottomNavigationItem({this.icon, this.activeIcon, this.changeIndex, this.index, this.currentIndex, this.name, this.isDisabled = false});
{this.icon,
this.activeIcon,
this.changeIndex,
this.index,
this.currentIndex,
this.name});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -39,7 +33,9 @@ class BottomNavigationItem extends StatelessWidget {
child: InkWell( child: InkWell(
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashColor: Colors.transparent, splashColor: Colors.transparent,
onTap: () => changeIndex(currentIndex), onTap: () {
if (!isDisabled) changeIndex(currentIndex);
},
child: currentIndex != 4 child: currentIndex != 4
? Column( ? Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -49,11 +45,7 @@ class BottomNavigationItem extends StatelessWidget {
height: 15, height: 15,
), ),
Container( Container(
child: Icon(currentIndex == index ? activeIcon : icon, child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : Colors.grey, size: 22.0),
color: currentIndex == index
? secondaryColor
: Colors.grey,
size: 22.0),
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -61,9 +53,7 @@ class BottomNavigationItem extends StatelessWidget {
Texts( Texts(
name, name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index color: currentIndex == index ? secondaryColor : Colors.grey,
? secondaryColor
: Colors.grey,
fontSize: 11, fontSize: 11,
), ),
SizedBox( SizedBox(
@ -86,9 +76,7 @@ class BottomNavigationItem extends StatelessWidget {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),
style: TextStyle(
color: Colors.white, fontSize: 14.0)),
), ),
), ),
), ),
@ -100,12 +88,7 @@ class BottomNavigationItem extends StatelessWidget {
height: 15, height: 15,
), ),
Container( Container(
child: Icon( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : Theme.of(context).dividerColor, size: 22.0),
currentIndex == index ? activeIcon : icon,
color: currentIndex == index
? secondaryColor
: Theme.of(context).dividerColor,
size: 22.0),
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -113,9 +96,7 @@ class BottomNavigationItem extends StatelessWidget {
Texts( Texts(
name, name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index color: currentIndex == index ? Theme.of(context).primaryColor : Colors.grey,
? Theme.of(context).primaryColor
: Colors.grey,
fontSize: 11, fontSize: 11,
), ),
SizedBox( SizedBox(
@ -133,12 +114,7 @@ class BottomNavigationItem extends StatelessWidget {
height: 15, height: 15,
), ),
Container( Container(
child: Icon( child: Icon(currentIndex == index ? activeIcon : icon, color: currentIndex == index ? secondaryColor : isDisabled ? Colors.grey[300] : Theme.of(context).dividerColor, size: 22.0),
currentIndex == index ? activeIcon : icon,
color: currentIndex == index
? secondaryColor
: Theme.of(context).dividerColor,
size: 22.0),
), ),
SizedBox( SizedBox(
height: 2, height: 2,
@ -146,9 +122,7 @@ class BottomNavigationItem extends StatelessWidget {
Texts( Texts(
name, name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: currentIndex == index color: currentIndex == index ? secondaryColor : isDisabled ? Colors.grey[300] : Colors.grey,
? secondaryColor
: Colors.grey,
fontSize: 11, fontSize: 11,
), ),
SizedBox( SizedBox(

@ -9,11 +9,11 @@ class ArrowBack extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); // ProjectViewModel projectViewModel = Provider.of(context);
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: Feedback.wrapForTap(() { onTap: Feedback.wrapForTap(() {
onTap != null ? onTap() : Navigator.pop(context); onTap != null ? onTap() : Navigator.maybePop(context);
}, context), }, context),
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,

Loading…
Cancel
Save