diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart new file mode 100644 index 00000000..9c2d660e --- /dev/null +++ b/lib/core/model/er/PatientER.dart @@ -0,0 +1,200 @@ +class PatientER { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int orderServiceID; + String patientIdentificationID; + int direction; + bool haveAppointment; + int tripType; + int pickupUrgency; + int pickupSpot; + String pickupDateTime; + int transportationMethodId; + int selectedAmbulate; + String requesterNote; + int requesterFileNo; + String requesterMobileNo; + bool requesterIsOutSA; + int isOutPatient; + String pickupLocationName; + String dropoffLocationName; + int projectID; + int createdBy; + int lineItemNo; + int cost; + double vAT; + double totalPrice; + String pickupLocationLattitude; + String pickupLocationLongitude; + String dropoffLocationLattitude; + String dropoffLocationLongitude; + String latitude; + String longitude; + String appointmentNo; + dynamic appointmentClinicName; + dynamic appointmentDoctorName; + dynamic appointmentBranch; + dynamic appointmentTime; + + PatientER( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.orderServiceID = 4, + this.patientIdentificationID, + this.direction, + this.haveAppointment, + this.tripType, + this.pickupUrgency, + this.pickupSpot, + this.pickupDateTime, + this.transportationMethodId, + this.selectedAmbulate, + this.requesterNote, + this.requesterFileNo, + this.requesterMobileNo, + this.requesterIsOutSA, + this.isOutPatient, + this.pickupLocationName, + this.dropoffLocationName, + this.projectID, + this.createdBy, + this.lineItemNo, + this.cost, + this.vAT, + this.totalPrice, + this.pickupLocationLattitude, + this.pickupLocationLongitude, + this.dropoffLocationLattitude, + this.dropoffLocationLongitude, + this.latitude, + this.longitude, + this.appointmentNo, + this.appointmentClinicName, + this.appointmentDoctorName, + this.appointmentBranch, + this.appointmentTime}); + + PatientER.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + orderServiceID = json['OrderServiceID']; + patientIdentificationID = json['PatientIdentificationID']; + direction = json['Direction']; + haveAppointment = json['HaveAppointment']; + tripType = json['TripType']; + pickupUrgency = json['PickupUrgency']; + pickupSpot = json['PickupSpot']; + pickupDateTime = json['PickupDateTime']; + transportationMethodId = json['TransportationMethodId']; + selectedAmbulate = json['SelectedAmbulate']; + requesterNote = json['RequesterNote']; + requesterFileNo = json['RequesterFileNo']; + requesterMobileNo = json['RequesterMobileNo']; + requesterIsOutSA = json['RequesterIsOutSA']; + isOutPatient = json['IsOutPatient']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + projectID = json['ProjectID']; + createdBy = json['CreatedBy']; + lineItemNo = json['LineItemNo']; + cost = json['Cost']; + vAT = json['VAT']; + totalPrice = json['TotalPrice']; + pickupLocationLattitude = json['PickupLocationLattitude']; + pickupLocationLongitude = json['PickupLocationLongitude']; + dropoffLocationLattitude = json['DropoffLocationLattitude']; + dropoffLocationLongitude = json['DropoffLocationLongitude']; + latitude = json['Latitude']; + longitude = json['Longitude']; + appointmentNo = json['AppointmentNo']; + appointmentClinicName = json['AppointmentClinicName']; + appointmentDoctorName = json['AppointmentDoctorName']; + appointmentBranch = json['AppointmentBranch']; + appointmentTime = json['AppointmentTime']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['OrderServiceID'] = this.orderServiceID; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['Direction'] = this.direction; + data['HaveAppointment'] = this.haveAppointment; + data['TripType'] = this.tripType; + data['PickupUrgency'] = this.pickupUrgency; + data['PickupSpot'] = this.pickupSpot; + data['PickupDateTime'] = this.pickupDateTime; + data['TransportationMethodId'] = this.transportationMethodId; + data['SelectedAmbulate'] = this.selectedAmbulate; + data['RequesterNote'] = this.requesterNote; + data['RequesterFileNo'] = this.requesterFileNo; + data['RequesterMobileNo'] = this.requesterMobileNo; + data['RequesterIsOutSA'] = this.requesterIsOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['ProjectID'] = this.projectID; + data['CreatedBy'] = this.createdBy; + data['LineItemNo'] = this.lineItemNo; + data['Cost'] = this.cost; + data['VAT'] = this.vAT; + data['TotalPrice'] = this.totalPrice; + data['PickupLocationLattitude'] = this.pickupLocationLattitude; + data['PickupLocationLongitude'] = this.pickupLocationLongitude; + data['DropoffLocationLattitude'] = this.dropoffLocationLattitude; + data['DropoffLocationLongitude'] = this.dropoffLocationLongitude; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentClinicName'] = this.appointmentClinicName; + data['AppointmentDoctorName'] = this.appointmentDoctorName; + data['AppointmentBranch'] = this.appointmentBranch; + data['AppointmentTime'] = this.appointmentTime; + return data; + } +} diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart index 3402873e..b149e296 100644 --- a/lib/core/model/er/get_all_transportation_method_list_model.dart +++ b/lib/core/model/er/get_all_transportation_method_list_model.dart @@ -1,5 +1,5 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -class PatientER_RRT_GetAllTransportationMethodListModel { +class PatientERTransportationMethod { int id; DateTime createDate; DateTime lastEditDate; @@ -9,15 +9,15 @@ class PatientER_RRT_GetAllTransportationMethodListModel { String title; String titleAR; int price; - Null isDefault; + dynamic isDefault; int visibility; - Null durationId; + dynamic durationId; String description; String descriptionAR; int totalPrice; int vAT; - PatientER_RRT_GetAllTransportationMethodListModel( + PatientERTransportationMethod( { this.id, this.createDate, @@ -36,7 +36,7 @@ class PatientER_RRT_GetAllTransportationMethodListModel { this.totalPrice, this.vAT}); - PatientER_RRT_GetAllTransportationMethodListModel.fromJson( + PatientERTransportationMethod.fromJson( Map json) { id = json['Id']; createDate = DateUtil.convertStringToDate(json['CreateDate']); diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index 016cc2df..6c9704ae 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -5,17 +5,20 @@ import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method import '../base_service.dart'; class AmService extends BaseService { - List amModelList = List(); + List amModelList = List(); List patientAllPresOrdersList = List(); Future getAllTransportationOrders() async { hasError = false; + Map body = Map(); + body['isDentalAllowedBackend']= false; + body['IdentificationNo'] = user.patientIdentificationNo; await baseAppClient.post(GET_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) { amModelList.clear(); response['AmModelList'].forEach((vital) { amModelList.add( - PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital)); + PatientERTransportationMethod.fromJson(vital)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index 6e08d984..9045ee90 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -11,7 +11,7 @@ class AmRequestViewModel extends BaseViewModel { AmService _amService = locator(); HospitalService _hospitalService = locator(); - List + List get amRequestModeList => _amService.amModelList; List get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 8e9f54bc..c50093be 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -34,10 +34,11 @@ class _AmbulanceReqState extends State @override Widget build(BuildContext context) { return BaseView( - // onModelReady: (model) => model.getAmRequestOrders(), + onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: "Ambulance Request", + baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -109,7 +110,7 @@ class _AmbulanceReqState extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - AmbulanceRequestIndex(), + AmbulanceRequestIndex(amRequestViewModel: model,), Container() ], ), diff --git a/lib/pages/ErService/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndex.dart index 863d3b57..46d803cd 100644 --- a/lib/pages/ErService/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndex.dart @@ -1,4 +1,6 @@ -import 'package:diplomaticquarterapp/pages/ErService/widgets/StepesWideget.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -8,27 +10,31 @@ import 'SelectTransportationMethod.dart'; import 'Summary.dart'; class AmbulanceRequestIndex extends StatefulWidget { + final AmRequestViewModel amRequestViewModel; + + AmbulanceRequestIndex({Key key, this.amRequestViewModel}); + @override _AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); } class _AmbulanceRequestIndexState extends State { - int currentIndex = 0; PageController pageController; + PatientER _patientER = PatientER(); _changeCurrentTab(int tab) { setState(() { currentIndex = tab; }); - pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); + pageController.animateToPage(tab, + duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart); } @override void initState() { super.initState(); pageController = new PageController(); - } @override @@ -36,19 +42,40 @@ class _AmbulanceRequestIndexState extends State { return AppScaffold( body: Column( children: [ - SizedBox(height: 80,), + SizedBox( + height: 80, + ), Container( - margin: EdgeInsets.only(left: 12,right: 12), - child: StepesWidget(index: currentIndex,changeCurrentTab: _changeCurrentTab,)), + margin: EdgeInsets.only(left: 12, right: 12), + child: StepsWidget( + index: currentIndex, + changeCurrentTab: _changeCurrentTab, + )), Expanded( child: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, children: [ - SelectTransportationMethod(changeCurrentTab: _changeCurrentTab,), - PickupLocation(changeCurrentTab: _changeCurrentTab,), - BillAmount(changeCurrentTab: _changeCurrentTab,), - Summary(changeCurrentTab: _changeCurrentTab,), + SelectTransportationMethod( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + PickupLocation( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + BillAmount( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), + Summary( + changeCurrentTab: _changeCurrentTab, + patientER: _patientER, + amRequestViewModel: widget.amRequestViewModel, + ), ], ), ), diff --git a/lib/pages/ErService/BillAmount.dart b/lib/pages/ErService/BillAmount.dart index 86b0d181..3dca195f 100644 --- a/lib/pages/ErService/BillAmount.dart +++ b/lib/pages/ErService/BillAmount.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,8 +7,10 @@ import 'package:flutter/material.dart'; class BillAmount extends StatefulWidget { final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; - BillAmount({Key key, this.changeCurrentTab}); + BillAmount({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); @override _BillAmountState createState() => _BillAmountState(); diff --git a/lib/pages/ErService/PickupLocation.dart b/lib/pages/ErService/PickupLocation.dart index bdb1ea52..2b44d4cb 100644 --- a/lib/pages/ErService/PickupLocation.dart +++ b/lib/pages/ErService/PickupLocation.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,8 +7,9 @@ import 'package:flutter/material.dart'; class PickupLocation extends StatefulWidget { final Function changeCurrentTab; - - PickupLocation({Key key, this.changeCurrentTab}); + final PatientER patientER; + PickupLocation({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); + final AmRequestViewModel amRequestViewModel; @override _PickupLocationState createState() => _PickupLocationState(); diff --git a/lib/pages/ErService/SelectTransportationMethod.dart b/lib/pages/ErService/SelectTransportationMethod.dart index a5fcbb75..d8148b3c 100644 --- a/lib/pages/ErService/SelectTransportationMethod.dart +++ b/lib/pages/ErService/SelectTransportationMethod.dart @@ -1,13 +1,24 @@ -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +enum Direction { ToHospital, FromHospital } +enum Way { OneWay, TwoWays } + class SelectTransportationMethod extends StatefulWidget { final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; - SelectTransportationMethod({Key key, this.changeCurrentTab}); + SelectTransportationMethod( + {Key key, + this.changeCurrentTab, + this.patientER, + this.amRequestViewModel}); @override _SelectTransportationMethodState createState() => @@ -16,24 +27,251 @@ class SelectTransportationMethod extends StatefulWidget { class _SelectTransportationMethodState extends State { + PatientERTransportationMethod _erTransportationMethod = + PatientERTransportationMethod(); + Direction _direction = Direction.FromHospital; + Way _way = Way.OneWay; + @override Widget build(BuildContext context) { - return Column( - children: [ - Texts('SelectTransportationMethod 1'), - SizedBox(height: 45,), - Container( - padding: EdgeInsets.all(15), - width: double.maxFinite, - height: 76, - child:SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: ()=> widget.changeCurrentTab(1), - label: 'Next', + return Container( + margin: EdgeInsets.only(left: 12, right: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts('Select Transportation Method'), + ...List.generate( + widget.amRequestViewModel.amRequestModeList.length, + (index) => InkWell( + onTap: () { + setState(() { + _erTransportationMethod = + widget.amRequestViewModel.amRequestModeList[index]; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + Expanded( + flex: 3, + child: ListTile( + title: Text(widget + .amRequestViewModel.amRequestModeList[index].title), + leading: Radio( + value: widget + .amRequestViewModel.amRequestModeList[index], + groupValue: _erTransportationMethod, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _erTransportationMethod = value; + }); + }, + ), + ), + ), + Expanded( + flex: 1, + child: Texts( + 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), + ) + ], + ), + ), + ), + ), + SizedBox( + height: 12, + ), + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.ToHospital; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('To Hospital'), + leading: Radio( + value: Direction.ToHospital, + groupValue: _direction, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _direction = Direction.FromHospital; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('To Hospital'), + leading: Radio( + value: Direction.FromHospital, + groupValue: _direction, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _direction = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + ], + ), + if (_direction == Direction.ToHospital) + Column( + children: [ + Texts('Select Direction'), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.OneWay; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('One Way'), + leading: Radio( + value: Way.OneWay, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.TwoWays; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: Row( + children: [ + ListTile( + title: Text('Two Ways'), + leading: Radio( + value: Way.TwoWays, + groupValue: _way, + activeColor: Colors.red[800], + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), + ), + ], + ), + ), + ), + ), + ], + ), + ], + ), + SizedBox( + height: 15, ), - ) - ], + Container( + padding: EdgeInsets.all(15), + width: double.maxFinite, + height: 76, + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 2; + widget.patientER.tripType = _way == Way.TwoWays ? 1 : 2; + widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod)+1); + widget.changeCurrentTab(1); + }); + }, + label: 'Next', + ), + ) + ], + ), ); } } diff --git a/lib/pages/ErService/Summary.dart b/lib/pages/ErService/Summary.dart index 4f792b68..13beee8c 100644 --- a/lib/pages/ErService/Summary.dart +++ b/lib/pages/ErService/Summary.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; +import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -5,8 +7,10 @@ import 'package:flutter/material.dart'; class Summary extends StatefulWidget { final Function changeCurrentTab; + final PatientER patientER; + final AmRequestViewModel amRequestViewModel; - Summary({Key key, this.changeCurrentTab}); + Summary({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); @override _SummaryState createState() => _SummaryState(); diff --git a/lib/pages/ErService/widgets/StepesWideget.dart b/lib/pages/ErService/widgets/StepsWidget.dart similarity index 55% rename from lib/pages/ErService/widgets/StepesWideget.dart rename to lib/pages/ErService/widgets/StepsWidget.dart index 3f6b57a4..1e4077cb 100644 --- a/lib/pages/ErService/widgets/StepesWideget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -2,11 +2,11 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class StepesWidget extends StatelessWidget { +class StepsWidget extends StatelessWidget { final int index; final Function changeCurrentTab; - StepesWidget({Key key, this.index, this.changeCurrentTab}); + StepsWidget({Key key, this.index, this.changeCurrentTab}); @override Widget build(BuildContext context) { @@ -18,9 +18,9 @@ class StepesWidget extends StatelessWidget { color: Colors.transparent, child: Center( child: Divider( - color: Colors.black, - height: 3, - thickness: 3, + color: Colors.grey, + height: 0.75, + thickness: 0.75, ), ), ), @@ -30,16 +30,17 @@ class StepesWidget extends StatelessWidget { child: InkWell( onTap: () => changeCurrentTab(0), child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( + border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), shape: BoxShape.circle, - color: index == 0 ? Colors.grey[800] : Colors.white, + color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, ), child: Center( child: Texts( '1', - color: index == 0 ? Colors.white:Colors.grey[800] , + color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800], ), ), ), @@ -47,20 +48,21 @@ class StepesWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery.of(context).size.width *0.3, + left: MediaQuery.of(context).size.width * 0.3, child: InkWell( - onTap: () => changeCurrentTab(1), + onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( + border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), shape: BoxShape.circle, - color: index == 1 ? Colors.grey[800] : Colors.white, + color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, ), child: Center( child: Texts( '2', - color: index == 1 ? Colors.white:Colors.grey[800], + color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800], ), ), ), @@ -68,20 +70,21 @@ class StepesWidget extends StatelessWidget { ), Positioned( top: 10, - left: MediaQuery.of(context).size.width *0.6, + left: MediaQuery.of(context).size.width * 0.6, child: InkWell( - onTap: () => changeCurrentTab(2), + onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( shape: BoxShape.circle, - color: index == 2 ? Colors.grey[800] : Colors.white, + border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75), + color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, ), child: Center( child: Texts( '3', - color: index == 2 ? Colors.white: Colors.grey[800] , + color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800], ), ), ), @@ -91,18 +94,20 @@ class StepesWidget extends StatelessWidget { top: 10, right: 0, child: InkWell( - onTap: () => changeCurrentTab(3), + onTap: () => index == 2 ?changeCurrentTab(3):null, child: Container( - width: 25, - height: 25, + width: 35, + height: 35, decoration: BoxDecoration( + border: Border.all(color: Colors.black,width: 0.75), + shape: BoxShape.circle, color: index == 3 ? Colors.grey[800] : Colors.white, ), child: Center( child: Texts( '4', - color: index == 3 ? Colors.white:Colors.grey[800] , + color: index == 3 ? Colors.white : Colors.grey[800], ), ), ),