fix display6ing review with no description
This commit is contained in:
@@ -59,6 +59,7 @@ class _MihBusinessReviewsState extends State<MihBusinessReviews> {
|
|||||||
} else if (asyncSnapshot.connectionState == ConnectionState.done &&
|
} else if (asyncSnapshot.connectionState == ConnectionState.done &&
|
||||||
asyncSnapshot.hasData) {
|
asyncSnapshot.hasData) {
|
||||||
List<BusinessReview> reviews = asyncSnapshot.data!;
|
List<BusinessReview> reviews = asyncSnapshot.data!;
|
||||||
|
print("Reviews: ${reviews.length}");
|
||||||
if (reviews.isEmpty) {
|
if (reviews.isEmpty) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -133,11 +134,16 @@ class _MihBusinessReviewsState extends State<MihBusinessReviews> {
|
|||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Visibility(
|
||||||
"${reviews[index].rating_description.substring(0, reviews[index].rating_description.length >= descriptionDisplayCOunt ? descriptionDisplayCOunt : reviews[index].rating_description.length - 1)}${reviews[index].rating_description.length >= descriptionDisplayCOunt ? "..." : ""}",
|
visible: reviews[index].rating_description.isNotEmpty,
|
||||||
style: TextStyle(
|
child: Text(
|
||||||
fontSize: 18,
|
reviews[index].rating_description.isEmpty
|
||||||
fontWeight: FontWeight.normal,
|
? ""
|
||||||
|
: "${reviews[index].rating_description.substring(0, reviews[index].rating_description.length >= descriptionDisplayCOunt ? descriptionDisplayCOunt : reviews[index].rating_description.length - 1)}${reviews[index].rating_description.length >= descriptionDisplayCOunt ? "..." : ""}",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
|
|||||||
Reference in New Issue
Block a user