|
|
|
@ -17,6 +17,7 @@ import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import '../routes.dart';
|
|
|
|
import '../routes.dart';
|
|
|
|
import 'base/base_view.dart';
|
|
|
|
import 'base/base_view.dart';
|
|
|
|
|
|
|
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
|
|
class QrReaderScreen extends StatefulWidget {
|
|
|
|
class QrReaderScreen extends StatefulWidget {
|
|
|
|
@ -59,6 +60,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
|
|
|
|
onModelReady: (model) => model.getClinicsList(),
|
|
|
|
onModelReady: (model) => model.getClinicsList(),
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
baseViewModel: model,
|
|
|
|
baseViewModel: model,
|
|
|
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
appBarTitle:
|
|
|
|
appBarTitle:
|
|
|
|
TranslationBase.of(context).qr + TranslationBase.of(context).reader,
|
|
|
|
TranslationBase.of(context).qr + TranslationBase.of(context).reader,
|
|
|
|
body: Center(
|
|
|
|
body: Center(
|
|
|
|
@ -104,7 +106,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
|
|
|
|
margin: EdgeInsets.only(top: 8),
|
|
|
|
margin: EdgeInsets.only(top: 8),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(6.0),
|
|
|
|
borderRadius: BorderRadius.circular(6.0),
|
|
|
|
color: Theme.of(context).errorColor.withOpacity(0.06),
|
|
|
|
color:
|
|
|
|
|
|
|
|
Theme.of(context).errorColor.withOpacity(0.06),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: 8.0, horizontal: 12.0),
|
|
|
|
vertical: 8.0, horizontal: 12.0),
|
|
|
|
@ -115,9 +118,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
|
|
|
|
error ??
|
|
|
|
error ??
|
|
|
|
TranslationBase.of(context)
|
|
|
|
TranslationBase.of(context)
|
|
|
|
.errorMessage,
|
|
|
|
.errorMessage,
|
|
|
|
color: Theme
|
|
|
|
color: Theme.of(context).errorColor)),
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.errorColor)),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
@ -127,7 +128,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),);
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_scanQrAndGetPatient(BuildContext context, PatientViewModel model) async {
|
|
|
|
_scanQrAndGetPatient(BuildContext context, PatientViewModel model) async {
|
|
|
|
@ -154,16 +156,15 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
|
|
|
|
// Provider.of<PatientsProvider>(context, listen: false);
|
|
|
|
// Provider.of<PatientsProvider>(context, listen: false);
|
|
|
|
patient.PatientID = 8808;
|
|
|
|
patient.PatientID = 8808;
|
|
|
|
patient.TokenID = token;
|
|
|
|
patient.TokenID = token;
|
|
|
|
model
|
|
|
|
model.getPatientList(patient, "1", isBusyLocal: true).then((response) {
|
|
|
|
.getPatientList(patient, "1", isBusyLocal: true)
|
|
|
|
|
|
|
|
.then((response) {
|
|
|
|
|
|
|
|
if (response['MessageStatus'] == 1) {
|
|
|
|
if (response['MessageStatus'] == 1) {
|
|
|
|
switch (patientType) {
|
|
|
|
switch (patientType) {
|
|
|
|
case "0":
|
|
|
|
case "0":
|
|
|
|
if (response['List_MyOutPatient'] != null) {
|
|
|
|
if (response['List_MyOutPatient'] != null) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
patientList =
|
|
|
|
patientList =
|
|
|
|
ModelResponse.fromJson(response['List_MyOutPatient']).list;
|
|
|
|
ModelResponse.fromJson(response['List_MyOutPatient'])
|
|
|
|
|
|
|
|
.list;
|
|
|
|
isLoading = false;
|
|
|
|
isLoading = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
|
|
|
|
|