You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
import 'package:doctor_app_flutter/models/patient_model.dart';
|
|
import 'package:doctor_app_flutter/providers/patients_provider.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
class PatientsList extends StatefulWidget {
|
|
@override
|
|
_PatientsListState createState() => _PatientsListState();
|
|
}
|
|
|
|
class _PatientsListState extends State<PatientsList> {
|
|
var _isInit =true;
|
|
@override
|
|
void didChangeDependencies() {
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
PatientModel patient = routeArgs['patientSearchForm'];
|
|
String patientType = routeArgs['selectedType'];
|
|
print(patientType);
|
|
if(_isInit) {
|
|
setState(() {
|
|
|
|
});
|
|
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
|
|
patientsProv.getPatientList(patient, patientType).then((res){
|
|
print('Response EEEEEEEE: ${res}');
|
|
print(res['ServiceName']);
|
|
});
|
|
}
|
|
_isInit = false;
|
|
super.didChangeDependencies();
|
|
|
|
}
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(title: Text('PatientsList'),),
|
|
);
|
|
}
|
|
} |