bug fixes

merge-requests/523/head
Sultan Khan 5 years ago
parent f6e0e1b0cd
commit 0ea66c4483

@ -88,8 +88,6 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
String req = json.encode(body);
var asd="";
if (await Helpers.checkConnection()) {
final response = await http.post(url,
@ -105,7 +103,8 @@ class BaseAppClient {
var parsed = json.decode(response.body.toString());
if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],parsed['AndroidLink'],parsed['IOSLink']);
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
}
if (!parsed['IsAuthenticated']) {
@ -225,7 +224,8 @@ class BaseAppClient {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],parsed['AndroidLink'],parsed['IOSLink']);
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
}
if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) {
@ -289,7 +289,6 @@ class BaseAppClient {
}
}
String getError(parsed) {
//TODO change this fun
String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];

File diff suppressed because it is too large Load Diff

@ -252,7 +252,8 @@ class AddSickLeavScreen extends StatelessWidget {
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child: Texts('No Sick Leave Found'),
child: Texts(
TranslationBase.of(context).noSickLeave),
)
],
),

@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
@ -32,6 +33,7 @@ class ShowSickLeaveScreen extends StatelessWidget {
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
backgroundColor: Colors.grey[100],
appBar: PatientProfileHeaderNewDesignAppBar(
patient,
routeArgs['patientType'] ?? "0",
@ -42,132 +44,153 @@ class ShowSickLeaveScreen extends StatelessWidget {
children: [
// PatientProfileHeaderNewDesign(
// patient, routeArgs['patientType'], routeArgs['arrivalType']),
Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
return RoundedContainer(
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
width: 5.0,
))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
flex: 4,
child: Wrap(
// mainAxisAlignment:
// MainAxisAlignment.start,
model.getAllSIckLeave.length > 0
? Column(
children: model.getAllSIckLeave
.map<Widget>((GetAllSickLeaveResponse item) {
return RoundedContainer(
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border(
left: BorderSide(
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
width: 5.0,
))),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.all(3),
child: AppText(
item.status == 1
? TranslationBase.of(context)
.hold
: item.status == 2
? TranslationBase.of(
context)
.active
: TranslationBase.of(
context)
.all,
fontWeight: FontWeight.bold,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
),
Row(
children: [
AppText(TranslationBase.of(context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.startDate +
' ',
),
Flexible(
Expanded(
flex: 4,
child: Wrap(
// mainAxisAlignment:
// MainAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
padding: EdgeInsets.all(3),
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold,
))
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
AppText(
item.remarks ?? "",
item.status == 1
? TranslationBase.of(
context)
.hold
: item.status == 2
? TranslationBase.of(
context)
.active
: TranslationBase.of(
context)
.all,
fontWeight: FontWeight.bold,
color: item.status == 1
? Colors.yellow[800]
: item.status == 2
? Colors.green
: Colors.black,
),
),
Row(
children: [
AppText(TranslationBase.of(
context)
.daysSickleave),
AppText(
item.noOfDays.toString(),
fontWeight: FontWeight.bold,
),
],
),
Row(
children: [
AppText(
TranslationBase.of(context)
.startDate +
' ',
),
Flexible(
child: AppText(
DateUtils
.convertStringToDateFormat(
item.startDate,
'dd-MMM-yyyy'),
fontWeight: FontWeight.bold,
))
],
),
(item.status == 1)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
AppText(
item.remarks ?? "",
),
(item.status == 1)
? IconButton(
icon: Image.asset(
'assets/images/edit.png'),
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status == 1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
},
)
: SizedBox()
]),
],
),
SizedBox(
width: 20,
// color: Colors.green, //Colors.black,
onPressed: () => {
if (item.status ==
1)
{
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.sickleaveonhold)
}
// else
// {
// openSickLeave(
// context,
// true,
// extendedData:
// item)
// }
},
)
: SizedBox()
]),
],
),
SizedBox(
width: 20,
),
],
),
),
],
),
),
],
)),
],
));
}).toList(),
)
)),
],
));
}).toList(),
)
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
),
Image.asset('assets/images/no-data.png'),
Padding(
padding: const EdgeInsets.all(8.0),
child:
Texts(TranslationBase.of(context).noSickLeave),
)
],
),
)
],
),
),

@ -0,0 +1,39 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class GetActivityButton extends StatelessWidget {
final value;
GetActivityButton(this.value);
@override
Widget build(BuildContext context) {
return Container(
width: 120,
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5),
height: 120,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.all(10),
child: AppText(value.value.toString(),
fontSize: 28, fontWeight: FontWeight.bold)),
Expanded(
child: AppText(
value.kPIParameter,
textOverflow: TextOverflow.clip,
fontSize: 12,
textAlign: TextAlign.center,
fontWeight: FontWeight.w600,
),
),
],
),
);
}
}

@ -0,0 +1,69 @@
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class GetOutPatientStack extends StatelessWidget {
final value;
GetOutPatientStack(this.value);
@override
Widget build(BuildContext context) {
value.summaryoptions
.sort((Summaryoptions a, Summaryoptions b) => b.value - a.value);
var list = new List<Widget>();
value.summaryoptions.forEach((result) =>
{list.add(getStack(result, value.summaryoptions.first.value))});
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
value.kPIName,
medium: true,
),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list)
],
);
}
getStack(Summaryoptions value, max) {
return Stack(children: [
Container(
height: 150,
margin: EdgeInsets.all(5),
width: 40,
child: SizedBox(),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: Colors.red[50]),
),
Positioned(
bottom: 0,
child: Container(
child: SizedBox(),
margin: EdgeInsets.all(5),
padding: EdgeInsets.all(10),
height: max != 0 ? (150 * value.value) / max : 0,
width: 40,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.red[300]))),
Container(
height: 150,
margin: EdgeInsets.only(left: 5, top: 5),
padding: EdgeInsets.all(10),
child: RotatedBox(
quarterTurns: 1,
child: Center(
child: Align(
child: AppText(
value.kPIParameter + ' (' + value.value.toString() + ') ',
fontSize: 10,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
)),
),
))
]);
}
}

@ -0,0 +1,45 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class RowCounts extends StatelessWidget {
final name;
final int count;
final Color c;
RowCounts(this.name, this.count, this.c);
@override
Widget build(BuildContext context) {
return Row(
children: [
dot(c),
Padding(
padding: EdgeInsets.only(top: 5, bottom: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
name,
color: Colors.black,
textAlign: TextAlign.center,
fontSize: 12,
textOverflow: TextOverflow.ellipsis,
),
AppText(
' (' + count.toString() + ')',
color: Colors.black,
textAlign: TextAlign.center,
fontSize: 14,
fontWeight: FontWeight.bold,
)
],
)),
],
);
}
Widget dot(Color c) {
return Container(
padding: EdgeInsets.all(5.0),
margin: EdgeInsets.all(5.0),
decoration: BoxDecoration(color: c, shape: BoxShape.circle));
}
}

@ -0,0 +1,24 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class SwiperRoundedPagination extends StatelessWidget {
final active;
SwiperRoundedPagination(this.active);
@override
Widget build(BuildContext context) {
return active == true
? Container(
height: 5,
width: 30,
// margin: EdgeInsets.only(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5), color: Colors.black),
)
: Container(
height: 5,
width: 8,
margin: EdgeInsets.all(2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), color: Colors.grey));
}
}

@ -901,6 +901,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
sticky_headers:
dependency: "direct main"
description:
name: sticky_headers
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.8+1"
stream_channel:
dependency: transitive
description:

@ -78,7 +78,7 @@ dependencies:
# Flutter Html View
flutter_html: 1.0.2
sticky_headers: "^0.1.8"
#speech to text

Loading…
Cancel
Save