Add reviewer name to review window and list
This commit is contained in:
@@ -38,6 +38,8 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
final _formKey = GlobalKey<FormState>();
|
final _formKey = GlobalKey<FormState>();
|
||||||
final TextEditingController _reviewTitleController = TextEditingController();
|
final TextEditingController _reviewTitleController = TextEditingController();
|
||||||
final TextEditingController _reviewScoreController = TextEditingController();
|
final TextEditingController _reviewScoreController = TextEditingController();
|
||||||
|
final TextEditingController _reviewReviewerController =
|
||||||
|
TextEditingController();
|
||||||
final TextEditingController _reviewDescriptionController =
|
final TextEditingController _reviewDescriptionController =
|
||||||
TextEditingController();
|
TextEditingController();
|
||||||
late final VoidCallback _reviewDescriptionListener;
|
late final VoidCallback _reviewDescriptionListener;
|
||||||
@@ -211,7 +213,7 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
if (widget.readOnly) {
|
if (widget.readOnly) {
|
||||||
return "Review Details";
|
return "Review Details";
|
||||||
} else if (widget.businessReview != null) {
|
} else if (widget.businessReview != null) {
|
||||||
return "Edit Review";
|
return "Update Review";
|
||||||
} else {
|
} else {
|
||||||
return "Add Review";
|
return "Add Review";
|
||||||
}
|
}
|
||||||
@@ -238,6 +240,7 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
_reviewDescriptionController.text =
|
_reviewDescriptionController.text =
|
||||||
widget.businessReview!.rating_description;
|
widget.businessReview!.rating_description;
|
||||||
_reviewScoreController.text = widget.businessReview!.rating_score;
|
_reviewScoreController.text = widget.businessReview!.rating_score;
|
||||||
|
_reviewReviewerController.text = widget.businessReview!.reviewer;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
SuperTokens.getUserId().then((value) {
|
SuperTokens.getUserId().then((value) {
|
||||||
@@ -334,6 +337,22 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
MihTextFormField(
|
||||||
|
// width: 200,
|
||||||
|
fillColor:
|
||||||
|
MzansiInnovationHub.of(context)!.theme.secondaryColor(),
|
||||||
|
inputColor:
|
||||||
|
MzansiInnovationHub.of(context)!.theme.primaryColor(),
|
||||||
|
controller: _reviewReviewerController,
|
||||||
|
multiLineInput: false,
|
||||||
|
requiredText: true,
|
||||||
|
readOnly: true,
|
||||||
|
hintText: "Reviewer",
|
||||||
|
validator: (value) {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
MihTextFormField(
|
MihTextFormField(
|
||||||
// width: 200,
|
// width: 200,
|
||||||
fillColor:
|
fillColor:
|
||||||
@@ -422,7 +441,7 @@ class _MihReviewBusinessWindowState extends State<MihReviewBusinessWindow> {
|
|||||||
width: 300,
|
width: 300,
|
||||||
child: Text(
|
child: Text(
|
||||||
widget.businessReview != null
|
widget.businessReview != null
|
||||||
? "Edit Review"
|
? "Update Review"
|
||||||
: "Add Review",
|
: "Add Review",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: MzansiInnovationHub.of(context)!
|
color: MzansiInnovationHub.of(context)!
|
||||||
|
|||||||
@@ -115,6 +115,13 @@ class _MihBusinessReviewsState extends State<MihBusinessReviews> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
children: [
|
children: [
|
||||||
|
// Text(
|
||||||
|
// "${reviews[index].reviewer} ",
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 15,
|
||||||
|
// fontWeight: FontWeight.bold,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
Text(
|
Text(
|
||||||
reviews[index].rating_title,
|
reviews[index].rating_title,
|
||||||
softWrap: true,
|
softWrap: true,
|
||||||
@@ -131,16 +138,12 @@ class _MihBusinessReviewsState extends State<MihBusinessReviews> {
|
|||||||
fontWeight: FontWeight.normal,
|
fontWeight: FontWeight.normal,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Text(
|
||||||
children: [
|
"${reviews[index].date_time.split("T")[0]} ",
|
||||||
Text(
|
style: TextStyle(
|
||||||
reviews[index].date_time.split("T")[0],
|
fontSize: 15,
|
||||||
style: TextStyle(
|
fontWeight: FontWeight.normal,
|
||||||
fontSize: 15,
|
),
|
||||||
fontWeight: FontWeight.normal,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user