add current rating to service
This commit is contained in:
@@ -188,6 +188,7 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
_reviewTitleController.text,
|
_reviewTitleController.text,
|
||||||
_reviewDescriptionController.text,
|
_reviewDescriptionController.text,
|
||||||
_reviewScoreController.text,
|
_reviewScoreController.text,
|
||||||
|
widget.business.rating.isEmpty ? "0.0" : widget.business.rating,
|
||||||
)
|
)
|
||||||
.then((statusCode) {
|
.then((statusCode) {
|
||||||
Navigator.of(context).pop(); //Remove loading dialog
|
Navigator.of(context).pop(); //Remove loading dialog
|
||||||
@@ -242,6 +243,8 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
_reviewScoreController.text = widget.businessReview!.rating_score;
|
_reviewScoreController.text = widget.businessReview!.rating_score;
|
||||||
_reviewReviewerController.text = widget.businessReview!.reviewer;
|
_reviewReviewerController.text = widget.businessReview!.reviewer;
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
_reviewScoreController.text = "1.0"; // Default score
|
||||||
}
|
}
|
||||||
SuperTokens.getUserId().then((value) {
|
SuperTokens.getUserId().then((value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -336,11 +339,17 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
print(_reviewScoreController.text);
|
print(_reviewScoreController.text);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
Visibility(
|
||||||
MihTextFormField(
|
visible: widget.readOnly,
|
||||||
|
child: const SizedBox(height: 10),
|
||||||
|
),
|
||||||
|
Visibility(
|
||||||
|
visible: widget.readOnly,
|
||||||
|
child: MihTextFormField(
|
||||||
// width: 200,
|
// width: 200,
|
||||||
fillColor:
|
fillColor: MzansiInnovationHub.of(context)!
|
||||||
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
.theme
|
||||||
|
.secondaryColor(),
|
||||||
inputColor:
|
inputColor:
|
||||||
MzansiInnovationHub.of(context)!.theme.primaryColor(),
|
MzansiInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
controller: _reviewReviewerController,
|
controller: _reviewReviewerController,
|
||||||
@@ -352,6 +361,7 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
// width: 200,
|
// width: 200,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ class MihMzansiDirectoryServices {
|
|||||||
String rating_title,
|
String rating_title,
|
||||||
String rating_description,
|
String rating_description,
|
||||||
String rating_score,
|
String rating_score,
|
||||||
|
String current_rating,
|
||||||
) async {
|
) async {
|
||||||
var response = await http.post(
|
var response = await http.post(
|
||||||
Uri.parse(
|
Uri.parse(
|
||||||
@@ -57,6 +58,7 @@ class MihMzansiDirectoryServices {
|
|||||||
"rating_title": rating_title,
|
"rating_title": rating_title,
|
||||||
"rating_description": rating_description,
|
"rating_description": rating_description,
|
||||||
"rating_score": rating_score,
|
"rating_score": rating_score,
|
||||||
|
"current_rating": current_rating,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
if (response.statusCode == 201) {
|
if (response.statusCode == 201) {
|
||||||
|
|||||||
Reference in New Issue
Block a user