Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushar1805 committed Jul 7, 2021
1 parent 97c15a4 commit 34206ec
Show file tree
Hide file tree
Showing 58 changed files with 4,640 additions and 837 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.health.prism"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
4 changes: 4 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Generic
9 changes: 5 additions & 4 deletions lib/Assesment/Forms/Bathroom/bathroom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ import 'package:tryapp/Assesment/newassesment/newassesmentpro.dart';
import 'package:provider/provider.dart';

class Bathroom extends StatelessWidget {
String roomname;
String roomname, docID;
var accessname;
List<Map<String, dynamic>> wholelist;
Bathroom(this.roomname, this.wholelist, this.accessname);
Bathroom(this.roomname, this.wholelist, this.accessname, this.docID);
@override
Widget build(BuildContext context) {
return MultiProvider(providers: [
ChangeNotifierProvider<NewAssesmentProvider>(
create: (_) => NewAssesmentProvider("")),
ChangeNotifierProvider<BathroomPro>(create: (_) => BathroomPro(roomname, wholelist, accessname))
], child: BathroomUI(roomname, wholelist, accessname));
ChangeNotifierProvider<BathroomPro>(
create: (_) => BathroomPro(roomname, wholelist, accessname, docID))
], child: BathroomUI(roomname, wholelist, accessname, docID));
// return Scaffold(
// body: Center(
// child: ChangeNotifierProvider<NewAssesmentProvider>(
Expand Down
53 changes: 31 additions & 22 deletions lib/Assesment/Forms/Bathroom/bathroomUI.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
import 'package:firebase_auth/firebase_auth.dart';
import 'package:tryapp/Assesment/Forms/Bathroom/bathroompro.dart';
import 'package:tryapp/Assesment/newassesment/newassesmentrepo.dart';

final _colorgreen = Color.fromRGBO(10, 80, 106, 1);

class BathroomUI extends StatefulWidget {
String roomname;
String roomname, docID;
var accessname;
List<Map<String, dynamic>> wholelist;
BathroomUI(this.roomname, this.wholelist, this.accessname);
BathroomUI(this.roomname, this.wholelist, this.accessname, this.docID);
@override
_BathroomUIState createState() => _BathroomUIState();
}
Expand Down Expand Up @@ -435,10 +436,10 @@ class _BathroomUIState extends State<BathroomUI> {
assesmentprovider.setdata(7, value);
setState(() {
widget.wholelist[5][widget.accessname]
['question'][7]['doorwidth'] = 0;
['question']["7"]['doorwidth'] = 0;

widget.wholelist[5][widget.accessname]
['question'][7]['doorwidth'] =
['question']["7"]['doorwidth'] =
int.parse(value);
});
}),
Expand All @@ -448,14 +449,14 @@ class _BathroomUIState extends State<BathroomUI> {
SizedBox(
height: 5,
),
(widget.wholelist[5][widget.accessname]['question'][7]
(widget.wholelist[5][widget.accessname]['question']["7"]
['doorwidth'] <
30 &&
widget.wholelist[5][widget.accessname]
['question'][7]['doorwidth'] >
['question']["7"]['doorwidth'] >
0 &&
widget.wholelist[5][widget.accessname]
['question'][7]['doorwidth'] !=
['question']["7"]['doorwidth'] !=
'')
? assesmentprovider.getrecomain(
assesmentprovider, 7, true, 'Comments (if any)')
Expand Down Expand Up @@ -934,12 +935,13 @@ class _BathroomUIState extends State<BathroomUI> {
onChanged: (value) {
widget.wholelist[5]
[widget.accessname]
['question'][15]
['question']["15"]
['ManageInOut'] = value;
},
value: widget.wholelist[5]
[widget.accessname]
['question'][15]['ManageInOut'],
[widget.accessname]
['question']["15"]
['ManageInOut'],
)
],
),
Expand Down Expand Up @@ -1035,22 +1037,23 @@ class _BathroomUIState extends State<BathroomUI> {
],
onChanged: (value) {
setState(() {
widget.wholelist[5]
[widget.accessname][
'question'][16]['Grabbar']
widget.wholelist[5][
widget.accessname]
['question']["16"]
['Grabbar']
['Grabneeded'] = value;
});
},
value: widget.wholelist[5]
[widget.accessname]
['question'][16]['Grabbar']
['question']["16"]['Grabbar']
['Grabneeded'],
)
],
),
),
(widget.wholelist[5][widget.accessname]
['question'][16]['Grabbar']
['question']["16"]['Grabbar']
['Grabneeded'] ==
'Yes')
? Column(
Expand Down Expand Up @@ -1105,14 +1108,16 @@ class _BathroomUIState extends State<BathroomUI> {
widget.wholelist[5][widget
.accessname]
['question']
[16]['Grabbar'][
[
"16"]['Grabbar']
[
'Grabbartype'] = value;
});
},
value: widget.wholelist[5][
widget
.accessname]
['question'][16][
['question']["16"][
'Grabbar']['Grabbartype'],
)
],
Expand Down Expand Up @@ -1159,15 +1164,17 @@ class _BathroomUIState extends State<BathroomUI> {
widget.wholelist[5][widget
.accessname]
['question']
[16]['Grabbar'][
[
"16"]['Grabbar']
[
'Grabattachment'] = value;
});
},
value: widget.wholelist[5][
widget
.accessname]
['question'][16]
['Grabbar']
['question']
["16"]['Grabbar']
['Grabattachment'],
)
],
Expand Down Expand Up @@ -1267,13 +1274,13 @@ class _BathroomUIState extends State<BathroomUI> {
// print(widget.accessname);
setState(() {
widget.wholelist[5][widget.accessname]
['question'][17]
['question']["17"]
['sidefentrance'] = value;
});
},
value: widget.wholelist[5]
[widget.accessname]['question']
[17]['sidefentrance'],
["17"]['sidefentrance'],
)
],
),
Expand Down Expand Up @@ -1764,6 +1771,8 @@ class _BathroomUIState extends State<BathroomUI> {
child: Text('Done'),
onPressed: () {
listenbutton(assesmentprovider);
NewAssesmentRepository().updateLatestChangeDate(
Timestamp.now(), widget.docID);
},
))
],
Expand Down
59 changes: 32 additions & 27 deletions lib/Assesment/Forms/Bathroom/bathroompro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:avatar_glow/avatar_glow.dart';

class BathroomPro extends ChangeNotifier {
String roomname;
String roomname, docID;
var accessname;
List<Map<String, dynamic>> wholelist;
final firestoreInstance = Firestore.instance;
Expand All @@ -29,42 +29,43 @@ class BathroomPro extends ChangeNotifier {
final FormsRepository formsRepository = FormsRepository();
final FirebaseAuth auth = FirebaseAuth.instance;

BathroomPro(this.roomname, this.wholelist, this.accessname) {
BathroomPro(this.roomname, this.wholelist, this.accessname, this.docID) {
_speech = stt.SpeechToText();
for (int i = 0; i < wholelist[5][accessname]['question'].length; i++) {
controllers["field${i + 1}"] = TextEditingController();
controllerstreco["field${i + 1}"] = TextEditingController();
isListening["field${i + 1}"] = false;
controllers["field${i + 1}"].text =
wholelist[5][accessname]['question'][i + 1]['Recommendation'];
wholelist[5][accessname]['question']["${i + 1}"]['Recommendation'];
controllerstreco["field${i + 1}"].text =
'${wholelist[5][accessname]['question'][i + 1]['Recommendationthera']}';
'${wholelist[5][accessname]['question']["${i + 1}"]['Recommendationthera']}';
colorsset["field${i + 1}"] = Color.fromRGBO(10, 80, 106, 1);
}
getRole();
setinitials();
}

Future<void> setinitials() async {
if (wholelist[5][accessname]['question'][7].containsKey('doorwidth')) {
if (wholelist[5][accessname]['question']["7"].containsKey('doorwidth')) {
} else {
print('getting created');
wholelist[5][accessname]['question'][7]['doorwidth'] = 0;
wholelist[5][accessname]['question']["7"]['doorwidth'] = 0;
}

if (wholelist[5][accessname]['question'][15].containsKey('ManageInOut')) {
if (wholelist[5][accessname]['question']["15"].containsKey('ManageInOut')) {
} else {
wholelist[5][accessname]['question'][15]['ManageInOut'] = '';
wholelist[5][accessname]['question']["15"]['ManageInOut'] = '';
}

if (wholelist[5][accessname]['question'][16].containsKey('Grabbar')) {
if (wholelist[5][accessname]['question']["16"].containsKey('Grabbar')) {
} else {
wholelist[5][accessname]['question'][16]['Grabbar'] = {};
wholelist[5][accessname]['question']["16"]['Grabbar'] = {};
}

if (wholelist[5][accessname]['question'][17].containsKey('sidefentrance')) {
if (wholelist[5][accessname]['question']["17"]
.containsKey('sidefentrance')) {
} else {
wholelist[5][accessname]['question'][17]['sidefentrance'] = '';
wholelist[5][accessname]['question']["17"]['sidefentrance'] = '';
}
}

Expand All @@ -80,51 +81,55 @@ class BathroomPro extends ChangeNotifier {

setdata(index, value) {
if (value.length == 0) {
if (wholelist[5][accessname]['question'][index]['Answer'].length == 0) {
if (wholelist[5][accessname]['question']["$index"]['Answer'].length ==
0) {
} else {
wholelist[5][accessname]['complete'] -= 1;
wholelist[5][accessname]['question'][index]['Answer'] = value;
wholelist[5][accessname]['question']["$index"]['Answer'] = value;
notifyListeners();
}
} else {
if (wholelist[5][accessname]['question'][index]['Answer'].length == 0) {
if (wholelist[5][accessname]['question']["$index"]['Answer'].length ==
0) {
wholelist[5][accessname]['complete'] += 1;
notifyListeners();
}
wholelist[5][accessname]['question'][index]['Answer'] = value;
wholelist[5][accessname]['question']["$index"]['Answer'] = value;
notifyListeners();
}
}

setreco(index, value) {
wholelist[5][accessname]['question'][index]['Recommendation'] = value;
wholelist[5][accessname]['question']["$index"]['Recommendation'] = value;
notifyListeners();
}

getvalue(index) {
return wholelist[5][accessname]['question'][index]['Answer'];
return wholelist[5][accessname]['question']["$index"]['Answer'];
}

getreco(index) {
return wholelist[5][accessname]['question'][index]['Recommendation'];
return wholelist[5][accessname]['question']["$index"]['Recommendation'];
}

setrecothera(index, value) {
wholelist[5][accessname]['question'][index]['Recommendationthera'] = value;
wholelist[5][accessname]['question']["$index"]['Recommendationthera'] =
value;
notifyListeners();
}

setprio(index, value) {
wholelist[5][accessname]['question'][index]['Priority'] = value;
wholelist[5][accessname]['question']["$index"]['Priority'] = value;
notifyListeners();
}

getprio(index) {
return wholelist[5][accessname]['question'][index]['Priority'];
return wholelist[5][accessname]['question']["$index"]['Priority'];
}

getrecothera(index) {
return wholelist[5][accessname]['question'][index]['Recommendationthera'];
return wholelist[5][accessname]['question']["$index"]
['Recommendationthera'];
}

Widget getrecomain(
Expand Down Expand Up @@ -311,7 +316,7 @@ class BathroomPro extends ChangeNotifier {
_speech.listen(
onResult: (val) {
controllerstreco["field$index"].text = wholelist[5][accessname]
['question'][index]['Recommendationthera'] +
['question']["$index"]['Recommendationthera'] +
" " +
val.recognizedWords;
notifyListeners();
Expand All @@ -328,7 +333,7 @@ class BathroomPro extends ChangeNotifier {
}

setdatalistenthera(index) {
wholelist[5][accessname]['question'][index]['Recommendationthera'] =
wholelist[5][accessname]['question']["$index"]['Recommendationthera'] =
controllerstreco["field$index"].text;
cur = !cur;
notifyListeners();
Expand All @@ -353,7 +358,7 @@ class BathroomPro extends ChangeNotifier {
notifyListeners();
_speech.listen(onResult: (val) {
controllers["field$index"].text = wholelist[5][accessname]['question']
[index]['Recommendation'] +
["$index"]['Recommendation'] +
" " +
val.recognizedWords;
if (val.hasConfidenceRating && val.confidence > 0) {
Expand All @@ -372,7 +377,7 @@ class BathroomPro extends ChangeNotifier {
}

setdatalisten(index) {
wholelist[5][accessname]['question'][index]['Recommendation'] =
wholelist[5][accessname]['question']["$index"]['Recommendation'] =
controllers["field$index"].text;
cur = !cur;
notifyListeners();
Expand Down
Loading

0 comments on commit 34206ec

Please sign in to comment.