@@ -114,7 +114,7 @@ class _DetailMealsScreenState extends State<DetailMealsScreen> {
114
114
return Column (
115
115
crossAxisAlignment: CrossAxisAlignment .start,
116
116
children: < Widget > [
117
- _buildTagMeal (detailMeals? .strTags ?? widget.favoriteMeal.strTags),
117
+ _buildTagMeal (detailMeals? .strTags ?? widget.favoriteMeal? .strTags ?? null ),
118
118
Padding (padding: EdgeInsets .only (top: 24.0 )),
119
119
_buildWidgetPanelInfoGeneralMeal (detailMeals),
120
120
Padding (padding: EdgeInsets .only (top: 24.0 )),
@@ -129,16 +129,16 @@ class _DetailMealsScreenState extends State<DetailMealsScreen> {
129
129
style: Theme .of (context).textTheme.title,
130
130
),
131
131
_buildWidgetInfoInstructions (
132
- detailMeals? .strInstructions ?? widget.favoriteMeal.strInstructions,
132
+ detailMeals? .strInstructions ?? widget.favoriteMeal? .strInstructions ?? "" ,
133
133
),
134
134
],
135
135
);
136
136
}
137
137
138
138
Widget _buildWidgetInfoInstructions (String strInstructions) {
139
139
return Padding (
140
- padding: EdgeInsets .only (left: 8.0 , top: 8.0 , right: 8.0 ),
141
- child: Text (strInstructions),
140
+ padding: EdgeInsets .only (left: 8.0 , top: 8.0 , right: 8.0 , bottom : 16.0 ),
141
+ child: Text (strInstructions.isEmpty ? "N/A" : strInstructions ),
142
142
);
143
143
}
144
144
@@ -315,17 +315,17 @@ class _DetailMealsScreenState extends State<DetailMealsScreen> {
315
315
mainAxisAlignment: MainAxisAlignment .spaceAround,
316
316
children: < Widget > [
317
317
_buildWidgetInfoPlayVideo (
318
- detailMeals? .strYoutube ?? widget.favoriteMeal.strYoutube),
318
+ detailMeals? .strYoutube ?? widget.favoriteMeal? .strYoutube ?? "" ),
319
319
Padding (padding: EdgeInsets .only (left: 8.0 )),
320
320
_buildVerticalDivider (),
321
321
Padding (padding: EdgeInsets .only (left: 8.0 )),
322
322
_buildWidgetInfoCategoryMeal (
323
- detailMeals? .strCategory ?? widget.favoriteMeal.strCategory),
323
+ detailMeals? .strCategory ?? widget.favoriteMeal? .strCategory ?? "" ),
324
324
Padding (padding: EdgeInsets .only (left: 8.0 )),
325
325
_buildVerticalDivider (),
326
326
Padding (padding: EdgeInsets .only (left: 8.0 )),
327
327
_buildWidgetInfoCountryMeal (
328
- detailMeals? .strArea ?? widget.favoriteMeal.strArea),
328
+ detailMeals? .strArea ?? widget.favoriteMeal? .strArea ?? "" ),
329
329
Padding (padding: EdgeInsets .only (left: 8.0 )),
330
330
],
331
331
);
@@ -335,7 +335,7 @@ class _DetailMealsScreenState extends State<DetailMealsScreen> {
335
335
return Column (
336
336
children: < Widget > [
337
337
Text ("Country" ),
338
- Text (strArea, style: TextStyle (fontWeight: FontWeight .bold)),
338
+ Text (strArea.isEmpty ? "N/A" : strArea , style: TextStyle (fontWeight: FontWeight .bold)),
339
339
],
340
340
);
341
341
}
@@ -344,7 +344,7 @@ class _DetailMealsScreenState extends State<DetailMealsScreen> {
344
344
return Column (
345
345
children: < Widget > [
346
346
Text ("Category" ),
347
- Text (strCategory, style: TextStyle (fontWeight: FontWeight .bold)),
347
+ Text (strCategory.isEmpty ? "N/A" : strCategory , style: TextStyle (fontWeight: FontWeight .bold)),
348
348
],
349
349
);
350
350
}
0 commit comments