theme issue
parent
6f68cf5a15
commit
b891c1bd80
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
|
||||||
|
|
||||||
|
class AncillaryOrdersService extends BaseService {
|
||||||
|
List<AncillaryOrdersListModel> _ancillaryLists = List();
|
||||||
|
List<AncillaryOrdersListModel> get ancillaryLists => _ancillaryLists;
|
||||||
|
|
||||||
|
Future getOrders() async {
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
|
||||||
|
await baseAppClient.post(GET_ANCILLARY_ORDERS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['AncillaryOrderList'].forEach((item) {
|
||||||
|
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
|
||||||
|
|
||||||
|
import 'base_view_model.dart';
|
||||||
|
import '../../locator.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
|
||||||
|
class AnciallryOrdersViewModel extends BaseViewModel {
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
|
||||||
|
|
||||||
|
Future getOrders() async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _ancillaryService.getOrders();
|
||||||
|
if (_ancillaryService.hasError) {
|
||||||
|
error = _ancillaryService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
class AncillaryOrdersListModel {
|
||||||
|
List<AncillaryOrderList> ancillaryOrderList;
|
||||||
|
Null errCode;
|
||||||
|
String message;
|
||||||
|
int patientID;
|
||||||
|
String patientName;
|
||||||
|
int patientType;
|
||||||
|
int projectID;
|
||||||
|
String projectName;
|
||||||
|
String setupID;
|
||||||
|
int statusCode;
|
||||||
|
|
||||||
|
AncillaryOrdersListModel(
|
||||||
|
{this.ancillaryOrderList,
|
||||||
|
this.errCode,
|
||||||
|
this.message,
|
||||||
|
this.patientID,
|
||||||
|
this.patientName,
|
||||||
|
this.patientType,
|
||||||
|
this.projectID,
|
||||||
|
this.projectName,
|
||||||
|
this.setupID,
|
||||||
|
this.statusCode});
|
||||||
|
|
||||||
|
AncillaryOrdersListModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['AncillaryOrderList'] != null) {
|
||||||
|
ancillaryOrderList = new List<AncillaryOrderList>();
|
||||||
|
json['AncillaryOrderList'].forEach((v) {
|
||||||
|
ancillaryOrderList.add(new AncillaryOrderList.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
errCode = json['ErrCode'];
|
||||||
|
message = json['Message'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
patientName = json['PatientName'];
|
||||||
|
patientType = json['PatientType'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
statusCode = json['StatusCode'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.ancillaryOrderList != null) {
|
||||||
|
data['AncillaryOrderList'] =
|
||||||
|
this.ancillaryOrderList.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['ErrCode'] = this.errCode;
|
||||||
|
data['Message'] = this.message;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['PatientName'] = this.patientName;
|
||||||
|
data['PatientType'] = this.patientType;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['StatusCode'] = this.statusCode;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AncillaryOrderList {
|
||||||
|
String appointmentDate;
|
||||||
|
int appointmentNo;
|
||||||
|
int clinicID;
|
||||||
|
String clinicName;
|
||||||
|
int doctorID;
|
||||||
|
String doctorName;
|
||||||
|
String orderDate;
|
||||||
|
int orderNo;
|
||||||
|
|
||||||
|
AncillaryOrderList(
|
||||||
|
{this.appointmentDate,
|
||||||
|
this.appointmentNo,
|
||||||
|
this.clinicID,
|
||||||
|
this.clinicName,
|
||||||
|
this.doctorID,
|
||||||
|
this.doctorName,
|
||||||
|
this.orderDate,
|
||||||
|
this.orderNo});
|
||||||
|
|
||||||
|
AncillaryOrderList.fromJson(Map<String, dynamic> json) {
|
||||||
|
appointmentDate = json['AppointmentDate'];
|
||||||
|
appointmentNo = json['AppointmentNo'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
clinicName = json['ClinicName'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
orderDate = json['OrderDate'];
|
||||||
|
orderNo = json['OrderNo'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['AppointmentDate'] = this.appointmentDate;
|
||||||
|
data['AppointmentNo'] = this.appointmentNo;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['ClinicName'] = this.clinicName;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['OrderDate'] = this.orderDate;
|
||||||
|
data['OrderNo'] = this.orderNo;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
|
||||||
|
class AnicllaryOrders extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AnicllaryOrdersState extends State<AnicllaryOrders>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
|
TabController _tabController;
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tabController = TabController(length: 2, vsync: this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
_tabController.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<AnciallryOrdersViewModel>(
|
||||||
|
onModelReady: (model) => model.getOrders(),
|
||||||
|
builder: (_, model, widget) => AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBarTitle: TranslationBase.of(context).parking,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
padding: EdgeInsets.all(12), child: Container())));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue