speech to text

er_location
Sultan Khan 5 years ago
parent f6a3f0e615
commit 0f63b922d1

@ -173,7 +173,9 @@ class PatientDoctorAppointmentList {
List<DoctorList> patientDoctorAppointmentList = List();
PatientDoctorAppointmentList(
{this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) {
{this.filterName,
this.distanceInKMs,
DoctorList 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/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
@ -28,29 +30,35 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(text: TranslationBase.of(context).clinicName),
Tab(
text: TranslationBase.of(context).doctorName,
)
],
controller: _tabController,
),
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(text: TranslationBase.of(context).clinicName),
Tab(
text: TranslationBase.of(context).doctorName,
)
],
controller: _tabController,
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
SearchByClinic(
clnicIds: widget.clnicIds,
),
SearchByDoctor()
],
controller: _tabController),
bottomNavigationBar: BottomBarSearch());
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
SearchByClinic(
clnicIds: widget.clnicIds,
),
SearchByDoctor()
],
controller: _tabController),
);
}
}

@ -1,5 +1,5 @@
import "dart:collection";
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -29,7 +30,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<ListClinicCentralized> clinicsList = [];
List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false;
bool isLoaded = false;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -58,40 +59,70 @@ class _SearchByClinicState extends State<SearchByClinic> {
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
],
),
Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Clinic"),
value: dropdownValue,
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString(),
child: new Text(item.clinicDescription),
);
}).toList(),
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
),
)),
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,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Clinic"),
value: dropdownValue,
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString(),
child: new Text(item.clinicDescription),
);
}).toList(),
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
if (!isDentalSelectedAndSupported()) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
),
)),
isDentalSelectedAndSupported() == true || nearestAppo
? Container(
height: 60.0,
@ -202,15 +233,18 @@ class _SearchByClinicState extends State<SearchByClinic> {
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorList'].length != 0) {
print(res['DoctorList']);
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
try {
doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters
.toString());
arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v)
.projectDistanceInKiloMeters
.toString());
} catch (issue) {
print(issue);
}
});
} else {}
});
@ -260,7 +294,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
clinicsList = clinicsList
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList();
print(clinicsList);
isLoaded = true;
///print(clinicsList);
}
});
}

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

@ -106,113 +106,113 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column(
children: <Widget>[
Expanded(
flex: 1,
child: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
flex:4,
child: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (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 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 Padding(
padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
)),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 2,
child: IconButton(
icon: Icon(Icons.group),
child: Column(children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 2,
child: IconButton(
icon: Icon(Icons.group),
color: Colors.black,
onPressed: () {
switchUser(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
onPressed: () {
switchUser(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteFamily(
result, context);
},
)),
],
))
: SizedBox();
}).toList())
]));
}
},
)),
),
onPressed: () {
deleteFamily(
result, context);
},
)),
],
))
: SizedBox();
}).toList())
]));
}
},
),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
))
flex:1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
),
)
],
));
}
@ -270,7 +270,53 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
],
),
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(
future: getSentRequest(), // async work
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) {
case ConnectionState.waiting:
return Padding(
@ -305,44 +401,68 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
TranslationBase.of(context)
.deleteView,
)),
],
),
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']);
}
Future getSentRequest() async {
Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async {
// var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserSentRequest();
}
@ -419,4 +539,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
HOME,
);
}
deleteRequest(result, context){
}
acceptRequest(result, context){
}
}

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

@ -25,7 +25,7 @@ class AppScaffold extends StatelessWidget {
final bool isShowAppBar;
final bool hasAppBarParam;
final BaseViewModel baseViewModel;
final bool isBottomBar;
AppScaffold(
{@required this.body,
this.appBarTitle = '',
@ -33,7 +33,8 @@ class AppScaffold extends StatelessWidget {
this.isShowAppBar = false,
this.hasAppBarParam,
this.bottomSheet,
this.baseViewModel});
this.baseViewModel,
this.isBottomBar = true});
@override
Widget build(BuildContext context) {
@ -74,7 +75,8 @@ class AppScaffold extends StatelessWidget {
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
bottomNavigationBar: BottomBarSearch()
bottomNavigationBar:
this.isBottomBar == true ? BottomBarSearch() : SizedBox()
//floatingActionButton: FloatingSearchButton(),
);
}
@ -84,6 +86,6 @@ class AppScaffold extends StatelessWidget {
}
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 {
goToClinic(clnicID);
}
speak();
// speak();
}
break;
case '102':
{
// getDoctorsList(
// 0,
// 0,
// context,
// doctorId: null,
// doctorName: result['DoctorName'],
// );
getDoctorsList(
0,
0,
@ -278,7 +271,12 @@ class _SearchBot extends State<BottomBarSearch> {
doctorId: result['DoctorId'],
doctorName: null,
);
speak();
}
break;
case '103':
{
List clnicID = unique(result['ClinicId']);
goToClinic(clnicID);
}
break;
default:
@ -424,7 +422,7 @@ class _SearchBot extends State<BottomBarSearch> {
type: 0,
clnicIds: ids,
)));
// eventProvider.setValue({"clinic_id": ids});
speak();
}
List unique(List list) {

Loading…
Cancel
Save