speech to text

merge-update-with-lab-changes
Sultan Khan 6 years ago
parent f6a3f0e615
commit 0f63b922d1

@ -173,7 +173,9 @@ class PatientDoctorAppointmentList {
List<DoctorList> patientDoctorAppointmentList = List(); List<DoctorList> patientDoctorAppointmentList = List();
PatientDoctorAppointmentList( PatientDoctorAppointmentList(
{this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) { {this.filterName,
this.distanceInKMs,
DoctorList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment); patientDoctorAppointmentList.add(patientDoctorAppointment);
} }
} }

@ -1,8 +1,10 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
@ -28,6 +30,7 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
bottom: TabBar( bottom: TabBar(
@ -41,6 +44,11 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
), ),
title: Text(TranslationBase.of(context).bookAppo, title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)), style: TextStyle(color: Colors.white)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
), ),
body: TabBarView( body: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
@ -51,6 +59,6 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
SearchByDoctor() SearchByDoctor()
], ],
controller: _tabController), controller: _tabController),
bottomNavigationBar: BottomBarSearch()); );
} }
} }

@ -1,5 +1,5 @@
import "dart:collection"; import "dart:collection";
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -29,7 +30,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<ListClinicCentralized> clinicsList = []; List<ListClinicCentralized> clinicsList = [];
List<HospitalsModel> projectsList = []; List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false; bool isMobileAppDentalAllow = false;
bool isLoaded = false;
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -58,7 +59,37 @@ class _SearchByClinicState extends State<SearchByClinic> {
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
], ],
), ),
Container( widget.clnicIds != null &&
widget.clnicIds.length > 1 &&
isLoaded == true
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: clinicsList.map<Widget>((result) {
return RoundedContainer(
child: ListTile(
onTap: () {
// setState(() {
dropdownValue = result.clinicID.toString();
setState(() {
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
trailing: Icon(TranslationBase.of(AppGlobal.context)
.locale
.languageCode ==
'en'
? Icons.keyboard_arrow_right
: Icons.keyboard_arrow_left),
title: Text(result.clinicDescription,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0))));
}).toList())
: Container(
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -202,15 +233,18 @@ class _SearchByClinicState extends State<SearchByClinic> {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['DoctorList'].length != 0) { if (res['DoctorList'].length != 0) {
print(res['DoctorList']);
doctorsList.clear(); doctorsList.clear();
res['DoctorList'].forEach((v) { res['DoctorList'].forEach((v) {
try {
doctorsList.add(new DoctorList.fromJson(v)); doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName); arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v) arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters .projectDistanceInKiloMeters
.toString()); .toString());
} catch (issue) {
print(issue);
}
}); });
} else {} } else {}
}); });
@ -260,7 +294,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
clinicsList = clinicsList clinicsList = clinicsList
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1) .where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList(); .toList();
print(clinicsList); isLoaded = true;
///print(clinicsList);
} }
}); });
} }

@ -27,6 +27,7 @@ class _BranchViewState extends State<BranchView> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true, isShowAppBar: true,
isBottomBar: false,
body: new ListView.builder( body: new ListView.builder(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return new ExpandableListView( return new ExpandableListView(
@ -58,6 +59,8 @@ class ExpandableListView extends StatefulWidget {
class _ExpandableListViewState extends State<ExpandableListView> { class _ExpandableListViewState extends State<ExpandableListView> {
bool expandFlag = false; bool expandFlag = false;
var _radioValue1;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
@ -150,6 +153,9 @@ class _ExpandableListViewState extends State<ExpandableListView> {
return ""; return "";
} }
} }
sortByProject() {}
sortByClinic() {}
} }
class ExpandableContainer extends StatelessWidget { class ExpandableContainer extends StatelessWidget {

@ -106,7 +106,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 1, flex:4,
child: FutureBuilder( child: FutureBuilder(
future: getFamilyFiles(), // async work future: getFamilyFiles(), // async work
builder: (BuildContext context, builder: (BuildContext context,
@ -132,19 +132,17 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Text(TranslationBase.of(context) child: Text(
.request)), TranslationBase.of(context).request)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(context).switchUser,
.switchUser,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
TranslationBase.of(context) TranslationBase.of(context).deleteView,
.deleteView,
)), )),
], ],
), ),
@ -191,9 +189,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
])); ]));
} }
}, },
)), ),
),
Expanded( Expanded(
flex: 1, flex:1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
@ -212,7 +211,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
], ],
), ),
], ],
)) ),
)
], ],
)); ));
} }
@ -270,7 +270,53 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
], ],
), ),
Column( Column(
children: [],
children: [
Row(children: [
Expanded(flex:3,child:AppText('Name')),
Expanded(flex:1,child:AppText('Allow')),
Expanded(flex:1,child:AppText('Reject')),
]),
Column(children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
))
],
));
}).toList())
]
) )
], ],
); );
@ -289,7 +335,57 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
FutureBuilder( FutureBuilder(
future: getSentRequest(), // async work future: getSentRequest(), // async work
builder: builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) { (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight *.3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 2,
child: AppText(result.statusDescription, color: Colors.red,)),
],
));
}).toList(),
)));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding( return Padding(
@ -309,40 +405,64 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(TranslationBase.of(context)
TranslationBase.of(context).request)), .request)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
TranslationBase.of(context).switchUser, TranslationBase.of(context)
.switchUser,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
TranslationBase.of(context).deleteView, TranslationBase.of(context)
.deleteView,
)), )),
], ],
), ),
Column( Column(
children: [],
children: [
Row(children: [
Expanded(flex:3,child:AppText('Name')),
Expanded(flex:1,child:AppText('Delete')),
]),
Column(children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
)),
],
));
}).toList())
]
) )
], ],
); );
} }
}) })
], ],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
ListTile(
title: Text('data'),
)
],
)) ))
], ],
), ),
@ -364,7 +484,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return familyFileProvider.getUserViewRequest(user['PatientID']); return familyFileProvider.getUserViewRequest(user['PatientID']);
} }
Future getSentRequest() async { Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async {
// var user = await sharedPref.getObject(USER_PROFILE); // var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserSentRequest(); return familyFileProvider.getUserSentRequest();
} }
@ -419,4 +539,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
HOME, HOME,
); );
} }
deleteRequest(result, context){
}
acceptRequest(result, context){
}
} }

@ -85,7 +85,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future getUserSentRequest() async { Future<GetAllSharedRecordsByStatusResponse> getUserSentRequest() async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};

@ -25,7 +25,7 @@ class AppScaffold extends StatelessWidget {
final bool isShowAppBar; final bool isShowAppBar;
final bool hasAppBarParam; final bool hasAppBarParam;
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final bool isBottomBar;
AppScaffold( AppScaffold(
{@required this.body, {@required this.body,
this.appBarTitle = '', this.appBarTitle = '',
@ -33,7 +33,8 @@ class AppScaffold extends StatelessWidget {
this.isShowAppBar = false, this.isShowAppBar = false,
this.hasAppBarParam, this.hasAppBarParam,
this.bottomSheet, this.bottomSheet,
this.baseViewModel}); this.baseViewModel,
this.isBottomBar = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -74,7 +75,8 @@ class AppScaffold extends StatelessWidget {
) )
: buildBodyWidget(), : buildBodyWidget(),
bottomSheet: bottomSheet, bottomSheet: bottomSheet,
bottomNavigationBar: BottomBarSearch() bottomNavigationBar:
this.isBottomBar == true ? BottomBarSearch() : SizedBox()
//floatingActionButton: FloatingSearchButton(), //floatingActionButton: FloatingSearchButton(),
); );
} }
@ -84,6 +86,6 @@ class AppScaffold extends StatelessWidget {
} }
buildBodyWidget() { buildBodyWidget() {
return body ;//Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]); return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
} }
} }

@ -259,18 +259,11 @@ class _SearchBot extends State<BottomBarSearch> {
} else { } else {
goToClinic(clnicID); goToClinic(clnicID);
} }
speak(); // speak();
} }
break; break;
case '102': case '102':
{ {
// getDoctorsList(
// 0,
// 0,
// context,
// doctorId: null,
// doctorName: result['DoctorName'],
// );
getDoctorsList( getDoctorsList(
0, 0,
0, 0,
@ -278,7 +271,12 @@ class _SearchBot extends State<BottomBarSearch> {
doctorId: result['DoctorId'], doctorId: result['DoctorId'],
doctorName: null, doctorName: null,
); );
speak(); }
break;
case '103':
{
List clnicID = unique(result['ClinicId']);
goToClinic(clnicID);
} }
break; break;
default: default:
@ -424,7 +422,7 @@ class _SearchBot extends State<BottomBarSearch> {
type: 0, type: 0,
clnicIds: ids, clnicIds: ids,
))); )));
// eventProvider.setValue({"clinic_id": ids}); speak();
} }
List unique(List list) { List unique(List list) {

Loading…
Cancel
Save