Merge branch 'amjad_amireh' into 'master'
edit card_position.dart See merge request Cloud_Solution/diplomatic-quarter!47merge-update-with-lab-changes
commit
14f3e08077
@ -0,0 +1,79 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
class PatientER_RRT_GetAllTransportationMethodListModel {
|
||||||
|
int id;
|
||||||
|
DateTime createDate;
|
||||||
|
DateTime lastEditDate;
|
||||||
|
int createdBy;
|
||||||
|
int lastEditBy;
|
||||||
|
bool isActive;
|
||||||
|
String title;
|
||||||
|
String titleAR;
|
||||||
|
int price;
|
||||||
|
Null isDefault;
|
||||||
|
int visibility;
|
||||||
|
Null durationId;
|
||||||
|
String description;
|
||||||
|
String descriptionAR;
|
||||||
|
int totalPrice;
|
||||||
|
int vAT;
|
||||||
|
|
||||||
|
PatientER_RRT_GetAllTransportationMethodListModel(
|
||||||
|
{
|
||||||
|
this.id,
|
||||||
|
this.createDate,
|
||||||
|
this.lastEditDate,
|
||||||
|
this.createdBy,
|
||||||
|
this.lastEditBy,
|
||||||
|
this.isActive,
|
||||||
|
this.title,
|
||||||
|
this.titleAR,
|
||||||
|
this.price,
|
||||||
|
this.isDefault,
|
||||||
|
this.visibility,
|
||||||
|
this.durationId,
|
||||||
|
this.description,
|
||||||
|
this.descriptionAR,
|
||||||
|
this.totalPrice,
|
||||||
|
this.vAT});
|
||||||
|
|
||||||
|
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
id = json['Id'];
|
||||||
|
createDate = DateUtil.convertStringToDate(json['CreateDate']);
|
||||||
|
lastEditDate = DateUtil.convertStringToDate(json['LastEditDate']);
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
lastEditBy = json['LastEditBy'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
title = json['Title'];
|
||||||
|
titleAR = json['TitleAR'];
|
||||||
|
price = json['Price'];
|
||||||
|
isDefault = json['isDefault'];
|
||||||
|
visibility = json['Visibility'];
|
||||||
|
durationId = json['DurationId'];
|
||||||
|
description = json['Description'];
|
||||||
|
descriptionAR = json['DescriptionAR'];
|
||||||
|
totalPrice = json['TotalPrice'];
|
||||||
|
vAT = json['VAT'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Id'] = this.id;
|
||||||
|
data['CreateDate'] = this.createDate;
|
||||||
|
data['LastEditDate'] = this.lastEditDate;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['LastEditBy'] = this.lastEditBy;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['Title'] = this.title;
|
||||||
|
data['TitleAR'] = this.titleAR;
|
||||||
|
data['Price'] = this.price;
|
||||||
|
data['isDefault'] = this.isDefault;
|
||||||
|
data['Visibility'] = this.visibility;
|
||||||
|
data['DurationId'] = this.durationId;
|
||||||
|
data['Description'] = this.description;
|
||||||
|
data['DescriptionAR'] = this.descriptionAR;
|
||||||
|
data['TotalPrice'] = this.totalPrice;
|
||||||
|
data['VAT'] = this.vAT;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
|
||||||
|
import '../base_service.dart';
|
||||||
|
|
||||||
|
class AmService extends BaseService {
|
||||||
|
List<PatientER_RRT_GetAllTransportationMethodListModel> AmModelList = List();
|
||||||
|
Map<String, dynamic> body = Map();
|
||||||
|
|
||||||
|
Future getAllTransportationOrders() async {
|
||||||
|
hasError = false;
|
||||||
|
|
||||||
|
await baseAppClient.post(GET_AMBULANCE_REQUEST,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
AmModelList.clear();
|
||||||
|
response['AmModelList'].forEach((vital) {
|
||||||
|
AmModelList.add(
|
||||||
|
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import '../base_view_model.dart';
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class AmRequestViewModel extends BaseViewModel{
|
||||||
|
|
||||||
|
|
||||||
|
AmService _amService = locator<AmService>();
|
||||||
|
|
||||||
|
List<PatientER_RRT_GetAllTransportationMethodListModel> get AmRequestModeList=>
|
||||||
|
_amService.AmModelList;
|
||||||
|
|
||||||
|
getAmRequestOrders({int id, int projectID}) async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
|
||||||
|
|
||||||
|
await _amService.getAllTransportationOrders();
|
||||||
|
|
||||||
|
if ( _amService.hasError) {
|
||||||
|
error = _amService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'dart:ui';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
|
||||||
|
class AmbulanceReq extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_AmbulanceReqState createState() => _AmbulanceReqState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AmbulanceReqState extends State<AmbulanceReq>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
|
TabController _tabController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tabController = TabController(length: 2, vsync: this);
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
_tabController.dispose();
|
||||||
|
}
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PrescriptionsViewModel>(
|
||||||
|
onModelReady: (model) => model.getPrescriptions(),
|
||||||
|
builder: (_, model, widget) => AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBarTitle: "Ambulance Request",
|
||||||
|
body: Scaffold(
|
||||||
|
extendBodyBehindAppBar: true,
|
||||||
|
appBar: PreferredSize(
|
||||||
|
preferredSize: Size.fromHeight(65.0),
|
||||||
|
child: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Positioned(
|
||||||
|
bottom: 1,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.scaffoldBackgroundColor
|
||||||
|
.withOpacity(0.8),
|
||||||
|
height: 70.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Container(
|
||||||
|
height: 60.0,
|
||||||
|
margin: EdgeInsets.only(top: 10.0),
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Theme.of(context).dividerColor,
|
||||||
|
width: 0.7),
|
||||||
|
),
|
||||||
|
color: Colors.white),
|
||||||
|
child: Center(
|
||||||
|
child: TabBar(
|
||||||
|
isScrollable: true,
|
||||||
|
controller: _tabController,
|
||||||
|
indicatorWeight: 5.0,
|
||||||
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
|
indicatorColor: Colors.red[800],
|
||||||
|
labelColor: Theme.of(context).primaryColor,
|
||||||
|
labelPadding:
|
||||||
|
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
|
||||||
|
unselectedLabelColor: Colors.grey[800],
|
||||||
|
tabs: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.40,
|
||||||
|
child: Center(
|
||||||
|
child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.30,
|
||||||
|
child: Center(
|
||||||
|
child: Texts("Orders Log"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
controller: _tabController,
|
||||||
|
children: <Widget>[
|
||||||
|
PrescriptionsPage(
|
||||||
|
prescriptionsViewModel: model,
|
||||||
|
),
|
||||||
|
PrescriptionsHistoryPage(
|
||||||
|
prescriptionsViewModel: model,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue