working on in-patient screen design

merge-requests/627/head
mosazaid 5 years ago
parent ee4d7b785b
commit b43b7cafcc

@ -336,7 +336,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 5.8; const VERSION_ID = 6.0;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -946,4 +946,5 @@ const Map<String, Map<String, String>> localizedValues = {
"approvals22": {"en": "Approvals", "ar": "التامين"}, "approvals22": {"en": "Approvals", "ar": "التامين"},
"severe": {"en": "Severe", "ar": "الشدة"}, "severe": {"en": "Severe", "ar": "الشدة"},
"graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"},
"discharged": {"en": "Discharged", "ar": "المصرف"},
}; };

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
class PatientInPatientService extends BaseService { class PatientInPatientService extends BaseService {
List<PatiantInformtion> inPatientList = List(); List<PatiantInformtion> inPatientList = List();
List<PatiantInformtion> myInPatientList = List();
Future getInPatientList( Future getInPatientList(
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
@ -21,9 +22,14 @@ class PatientInPatientService extends BaseService {
GET_PATIENT_IN_PATIENT_LIST, GET_PATIENT_IN_PATIENT_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
inPatientList.clear(); inPatientList.clear();
myInPatientList.clear();
response['List_MyInPatient'].forEach((v) { response['List_MyInPatient'].forEach((v) {
inPatientList.add(PatiantInformtion.fromJson(v)); PatiantInformtion patient = PatiantInformtion.fromJson(v);
inPatientList.add(patient);
if(patient.doctorId == doctorProfile.doctorID){
myInPatientList.add(patient);
}
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';
class PatientSearchViewModel extends BaseViewModel{ class PatientSearchViewModel extends BaseViewModel {
OutPatientService _outPatientService = locator<OutPatientService>(); OutPatientService _outPatientService = locator<OutPatientService>();
List<PatiantInformtion> get patientList => _outPatientService.patientList; List<PatiantInformtion> get patientList => _outPatientService.patientList;
@ -24,10 +24,14 @@ class PatientSearchViewModel extends BaseViewModel{
if (strExist) { if (strExist) {
filterData = []; filterData = [];
for (var i = 0; i < _outPatientService.patientList.length; i++) { for (var i = 0; i < _outPatientService.patientList.length; i++) {
String firstName = _outPatientService.patientList[i].firstName.toUpperCase(); String firstName =
String lastName = _outPatientService.patientList[i].lastName.toUpperCase(); _outPatientService.patientList[i].firstName.toUpperCase();
String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase(); String lastName =
String patientID = _outPatientService.patientList[i].patientId.toString(); _outPatientService.patientList[i].lastName.toUpperCase();
String mobile =
_outPatientService.patientList[i].mobileNumber.toUpperCase();
String patientID =
_outPatientService.patientList[i].patientId.toString();
if (firstName.contains(str.toUpperCase()) || if (firstName.contains(str.toUpperCase()) ||
lastName.contains(str.toUpperCase()) || lastName.contains(str.toUpperCase()) ||
@ -43,19 +47,19 @@ class PatientSearchViewModel extends BaseViewModel{
} }
} }
getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { getOutPatient(PatientSearchRequestModel patientSearchRequestModel,
if(isLocalBusy) { {bool isLocalBusy = false}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
patientSearchRequestModel.doctorID = doctorProfile.doctorID; patientSearchRequestModel.doctorID = doctorProfile.doctorID;
await _outPatientService.getOutPatient( await _outPatientService.getOutPatient(patientSearchRequestModel);
patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {
error = _outPatientService.error; error = _outPatientService.error;
if(isLocalBusy) { if (isLocalBusy) {
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
setState(ViewState.Error); setState(ViewState.Error);
@ -66,10 +70,11 @@ class PatientSearchViewModel extends BaseViewModel{
} }
} }
getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel,
{bool isLocalBusy = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _outPatientService.getPatientFileInformation( await _outPatientService
patientSearchRequestModel); .getPatientFileInformation(patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {
error = _outPatientService.error; error = _outPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -79,30 +84,21 @@ class PatientSearchViewModel extends BaseViewModel{
} }
} }
getPatientBasedOnDate(
{item,
getPatientBasedOnDate ( PatientSearchRequestModel patientSearchRequestModel,
{item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, PatientType selectedPatientType,
bool isSearchWithKeyInfo })async { bool isSearchWithKeyInfo}) async {
String dateTo; String dateTo;
String dateFrom; String dateFrom;
if (item == 'Previous') { if (item == 'Previous') {
selectedFromDate = DateTime(
selectedFromDate = DateTime(DateTime.now().year, DateTime.now().month-1, DateTime.now().year, DateTime.now().month - 1, DateTime.now().day);
DateTime.now().day); selectedToDate = DateTime(
selectedToDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().year, DateTime.now().month, DateTime.now().day - 1);
DateTime.now().day-1); dateTo = DateUtils.convertDateToFormat(selectedToDate, 'yyyy-MM-dd');
dateTo = DateUtils.convertDateToFormat( dateFrom = DateUtils.convertDateToFormat(selectedFromDate, 'yyyy-MM-dd');
selectedToDate,
'yyyy-MM-dd');
dateFrom = DateUtils.convertDateToFormat(
selectedFromDate,
'yyyy-MM-dd');
} else if (item == 'Next Week') { } else if (item == 'Next Week') {
dateTo = DateUtils.convertDateToFormat( dateTo = DateUtils.convertDateToFormat(
DateTime(DateTime.now().year, DateTime.now().month, DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day + 6), DateTime.now().day + 6),
@ -117,76 +113,78 @@ class PatientSearchViewModel extends BaseViewModel{
DateTime( DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day), DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd'); 'yyyy-MM-dd');
dateTo= DateUtils.convertDateToFormat( dateTo = DateUtils.convertDateToFormat(
DateTime( DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day), DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd'); 'yyyy-MM-dd');
} }
PatientSearchRequestModel currentModel = PatientSearchRequestModel(); PatientSearchRequestModel currentModel = PatientSearchRequestModel();
currentModel.patientID = patientSearchRequestModel.patientID; currentModel.patientID = patientSearchRequestModel.patientID;
currentModel.firstName = patientSearchRequestModel.firstName; currentModel.firstName = patientSearchRequestModel.firstName;
currentModel.lastName = patientSearchRequestModel.lastName; currentModel.lastName = patientSearchRequestModel.lastName;
currentModel.middleName = patientSearchRequestModel.middleName; currentModel.middleName = patientSearchRequestModel.middleName;
currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.doctorID = patientSearchRequestModel.doctorID;
currentModel.from = dateFrom; currentModel.from = dateFrom;
currentModel.to = dateTo; currentModel.to = dateTo;
await getOutPatient(currentModel, isLocalBusy: true); await getOutPatient(currentModel, isLocalBusy: true);
filterData = _outPatientService.patientList; filterData = _outPatientService.patientList;
} }
PatientInPatientService _inPatientService =
locator<PatientInPatientService>();
List<PatiantInformtion> get inPatientList => _inPatientService.inPatientList;
PatientInPatientService _inPatientService = List<PatiantInformtion> get myIinPatientList =>
locator<PatientInPatientService>(); _inPatientService.myInPatientList;
List<PatiantInformtion> get _inPatientList => _inPatientService.inPatientList;
List<PatiantInformtion> filteredInPatientItems = List(); List<PatiantInformtion> filteredInPatientItems = List();
Future getInPatientList(PatientSearchRequestModel requestModel, Future getInPatientList(PatientSearchRequestModel requestModel,
{bool isMyInpatient = false, bool isFirstTime = true}) async { {bool isMyInpatient = false}) async {
await getDoctorProfile(); await getDoctorProfile();
if (isFirstTime)
setState(ViewState.Busy); setState(ViewState.Busy);
else
setState(ViewState.BusyLocal); if (inPatientList.length == 0)
await _inPatientService.getInPatientList(requestModel, false); await _inPatientService.getInPatientList(requestModel, false);
if (_inPatientService.hasError) { if (_inPatientService.hasError) {
error = _inPatientService.error; error = _inPatientService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
filteredInPatientItems.clear(); filteredInPatientItems.clear();
if (_inPatientList.length > 0) if (inPatientList.length > 0)
filteredInPatientItems.addAll(_inPatientList); filteredInPatientItems.addAll(inPatientList);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
void clearPatientList(){
_inPatientService.inPatientList = [];
_inPatientService.myInPatientList = [];
}
void filterSearchResults(String query) { void filterSearchResults(String query) {
var strExist = query.length > 0 ? true : false; var strExist = query.length > 0 ? true : false;
if (strExist) { if (strExist) {
filteredInPatientItems = []; filteredInPatientItems = [];
for (var i = 0; i < _inPatientList.length; i++) { for (var i = 0; i < inPatientList.length; i++) {
String firstName = _inPatientList[i].firstName.toUpperCase(); String firstName = inPatientList[i].firstName.toUpperCase();
String lastName = _inPatientList[i].lastName.toUpperCase(); String lastName = inPatientList[i].lastName.toUpperCase();
String mobile = _inPatientList[i].mobileNumber.toUpperCase(); String mobile = inPatientList[i].mobileNumber.toUpperCase();
String patientID = _inPatientList[i].patientId.toString(); String patientID = inPatientList[i].patientId.toString();
if (firstName.contains(query.toUpperCase()) || if (firstName.contains(query.toUpperCase()) ||
lastName.contains(query.toUpperCase()) || lastName.contains(query.toUpperCase()) ||
mobile.contains(query) || mobile.contains(query) ||
patientID.contains(query)) { patientID.contains(query)) {
filteredInPatientItems.add(_inPatientList[i]); filteredInPatientItems.add(inPatientList[i]);
} }
} }
notifyListeners(); notifyListeners();
} else { } else {
if (_inPatientList.length > 0) if (inPatientList.length > 0) filteredInPatientItems.clear();
filteredInPatientItems.clear(); filteredInPatientItems.addAll(inPatientList);
filteredInPatientItems.addAll(_inPatientList);
notifyListeners(); notifyListeners();
} }
} }
} }

@ -29,12 +29,15 @@ class _DischargedPatientState extends State<DischargedPatient> {
appBarTitle: 'Discharged Patient', appBarTitle: 'Discharged Patient',
subtitle: "Last Three Months", subtitle: "Last Three Months",
backgroundColor: Colors.grey[200], backgroundColor: Colors.grey[200],
isShowAppBar: true, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: model.myDischargedPatient.isEmpty?Center( body: model.myDischargedPatient.isEmpty? Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
SizedBox( SizedBox(
height: 100, height: 100,
), ),
@ -53,6 +56,9 @@ class _DischargedPatientState extends State<DischargedPatient> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
SizedBox(height: 12,), SizedBox(height: 12,),
Container( Container(
width: double.maxFinite, width: double.maxFinite,

@ -0,0 +1,164 @@
import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
import '../../routes.dart';
class InPatientPage extends StatefulWidget {
final bool isMyInPatient;
InPatientPage(this.isMyInPatient);
@override
_InPatientPageState createState() => _InPatientPageState();
}
class _InPatientPageState extends State<InPatientPage> {
TextEditingController _searchController = TextEditingController();
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
@override
void dispose() {
_searchController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
),
Container(
margin: EdgeInsets.all(16.0),
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).searchPatientName,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(
Icons.search,
color: Colors.black,
),
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
),
model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...List.generate(
model.filteredInPatientItems.length, (index) {
if (!widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if (model.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID &&
widget.isMyInPatient)
return PatientCard(
patientInfo:
model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model
.filteredInPatientItems[index]
.doctorId ==
model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus =
FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model
.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else
return SizedBox();
}),
SizedBox(
height: 15,
)
],
),
),
),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error:
TranslationBase.of(context).noDataAvailable)),
),
),
],
),
),
);
}
}

@ -15,22 +15,36 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../routes.dart'; import '../../routes.dart';
import 'DischargedPatientPage.dart';
import 'InPatientPage.dart';
class PatientInPatientScreen extends StatefulWidget { class PatientInPatientScreen extends StatefulWidget {
@override @override
_PatientInPatientScreenState createState() => _PatientInPatientScreenState(); _PatientInPatientScreenState createState() => _PatientInPatientScreenState();
} }
class _PatientInPatientScreenState extends State<PatientInPatientScreen> { class _PatientInPatientScreenState extends State<PatientInPatientScreen> with SingleTickerProviderStateMixin{
PatientSearchRequestModel requestModel = PatientSearchRequestModel();
TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
TextEditingController _searchController = TextEditingController(); @override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
_tabController.addListener(_handleTabSelection);
}
@override @override
void dispose() { void dispose() {
_searchController.dispose();
super.dispose(); super.dispose();
_tabController.dispose();
}
_handleTabSelection() {
setState(() {
_activeTab = _tabController.index;
});
} }
@override @override
@ -38,7 +52,7 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<PatientSearchViewModel>( return BaseView<PatientSearchViewModel>(
onModelReady: (model) => model.getInPatientList(requestModel), onModelReady: (model) => model.clearPatientList(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: false, isShowAppBar: false,
@ -71,168 +85,107 @@ class _PatientInPatientScreenState extends State<PatientInPatientScreen> {
]), ]),
), ),
), ),
tabsBar(context, screenSize, model), Expanded(
Container( child: Scaffold(
margin: EdgeInsets.all(16.0), extendBodyBehindAppBar: true,
child: AppTextFieldCustom( appBar: PreferredSize(
hintText: TranslationBase.of(context) preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
.searchPatientName, child: Container(
isTextFieldHasSuffix: true, height: MediaQuery.of(context).size.height * 0.070,
suffixIcon: IconButton( decoration: BoxDecoration(
icon: Icon( border: Border(
Icons.search, bottom: BorderSide(
color: Colors.black, color: Theme.of(context).dividerColor,
), width: 0.5), //width: 0.7
onPressed: () {},
),
controller: _searchController,
onChanged: (value) {
model.filterSearchResults(value);
}),
),
model.filteredInPatientItems.length > 0
? Expanded(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 16.0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// const SizedBox(
// height: 16,
// ),
...List.generate(model.filteredInPatientItems.length, (index) {
if(_activeTab == 0)
return PatientCard(
patientInfo: model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1)
return PatientCard(
patientInfo: model.filteredInPatientItems[index],
patientType: "1",
arrivalType: "1",
isInpatient: true,
isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID,
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.unfocus();
}
Navigator.of(context)
.pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filteredInPatientItems[index],
"patientType": "1",
"from": "0",
"to": "0",
"isSearch": false,
"isInpatient": true,
"arrivalType": "1",
});
},
);
else return SizedBox();
}),
SizedBox(height: 15,)
],
), ),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
tabWidget(screenSize, _activeTab == 0, TranslationBase.of(context).inPatientAll.toUpperCase(), counter: model.inPatientList.length),
tabWidget(screenSize, _activeTab == 1, TranslationBase.of(context).inPatient.toUpperCase(), counter: model.myIinPatientList.length),
tabWidget(screenSize, _activeTab == 2, TranslationBase.of(context).discharged.toUpperCase()),
],
), ),
), ),
)
: Expanded(
child: SingleChildScrollView(
child: Container(
child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable)),
), ),
), ),
body: Column(
children: [
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: [
InPatientPage(false),
InPatientPage(true),
DischargedPatient(),
],
),
),
],
),
),
),
], ],
), ),
), ),
); );
} }
Widget tabsBar( Widget tabWidget(Size screenSize, bool isActive, String title, {int counter = -1}){
BuildContext context, Size screenSize, PatientSearchViewModel model) {
List<String> _tabs = [
TranslationBase.of(context).inPatientAll.toUpperCase(),
TranslationBase.of(context).inPatient.toUpperCase(),
];
return Container(
height: screenSize.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Row(
mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center,
children: _tabs.map((item) {
bool _isActive = _tabs[_activeTab] == item ? true : false;
return Expanded( return Center(
child: InkWell( child: Container(
onTap: () async { height: screenSize.height * 0.070,
setState(() { decoration: TextFieldsUtils.containerBorderDecoration(
_activeTab = _tabs.indexOf(item); isActive
}); ? Color(0xFFD02127 /*B8382B*/)
FocusScopeNode currentFocus = FocusScope.of(context); : Color(0xFFEAEAEA),
if (!currentFocus.hasPrimaryFocus) { isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA),
currentFocus.unfocus(); borderRadius: 4,
} borderWidth: 0),
if (_activeTab==0) { child: Row(
GifLoaderDialogUtils.showMyDialog( mainAxisAlignment: MainAxisAlignment.center,
context); children: [
await model.getInPatientList(requestModel, AppText(
isMyInpatient: _activeTab == 1, isFirstTime: false); title,
GifLoaderDialogUtils.hideDialog( fontSize: SizeConfig.textMultiplier * 1.8,
context); color: isActive ? Colors.white : Color(0xFF2B353E),
} fontWeight: FontWeight.w700,
}, ),
child: Center( if (counter != -1)
child: Container( Container(
height: screenSize.height * 0.070, margin: EdgeInsets.all(4),
decoration: TextFieldsUtils.containerBorderDecoration( width: 15,
_isActive height: 15,
? Color(0xFFD02127 /*B8382B*/) decoration: BoxDecoration(
: Color(0xFFEAEAEA), color: isActive
_isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), ? Colors.white
borderRadius: 4, : Color(0xFFD02127),
borderWidth: 0), shape: BoxShape.circle,
child: Center( ),
child: Center(
child: FittedBox(
child: AppText( child: AppText(
item, "$counter",
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.5,
color: _isActive ? Colors.white : Color(0xFF2B353E), color: !isActive ? Colors.white : Color(0xFFD02127),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
), ),
), ),
), ],
); ),
}).toList(),
), ),
); );
} }

@ -39,7 +39,7 @@ class ProfileGridForInPatient extends StatelessWidget {
NeverScrollableScrollPhysics(), NeverScrollableScrollPhysics(),
crossAxisSpacing: 10, crossAxisSpacing: 10,
mainAxisSpacing: 10, mainAxisSpacing: 10,
childAspectRatio: 1 / 1.0, childAspectRatio: 1 / 1.02,
crossAxisCount: 3, crossAxisCount: 3,
children: [ children: [
PatientProfileButton( PatientProfileButton(

@ -1301,8 +1301,8 @@ class TranslationBase {
String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get insurance22 => localizedValues["insurance22"][locale.languageCode];
String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode];
String get severe => localizedValues["severe"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode];
String get graphDetails => String get graphDetails => localizedValues["graphDetails"][locale.languageCode];
localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -47,8 +47,8 @@ class PatientProfileButton extends StatelessWidget {
ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context); ProjectViewModel projectsProvider = Provider.of<ProjectViewModel>(context);
return new Container( return new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0), margin: EdgeInsets.symmetric(horizontal: 0.0),
padding: EdgeInsets.fromLTRB(10, 10, 10, 5), padding: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: isDisable onTap: isDisable
? null ? null
@ -72,7 +72,7 @@ class PatientProfileButton extends StatelessWidget {
)), )),
Container( Container(
alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft, alignment: projectsProvider.isArabic ? Alignment.topRight : Alignment.topLeft,
padding: EdgeInsets.all(5), padding: EdgeInsets.symmetric(horizontal: 8),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -566,7 +566,7 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3-nullsafety.1" version: "0.6.2"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
@ -608,7 +608,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -900,7 +900,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1091,5 +1091,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save