forked from eatvio/eatvio_app
internet connection handling
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:eatvio_app/features/feed/repositories/feed_repository.dart';
|
||||
import 'package:eatvio_app/features/recipes/models/recipe_tag_model.dart';
|
||||
import 'package:eatvio_app/features/recipes/reporitories/recipe_repository.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'dart:developer';
|
||||
|
||||
class RecipesCubit extends Cubit<RecipesState> {
|
||||
final FeedRepository feedRepository;
|
||||
@@ -38,7 +39,8 @@ class RecipesCubit extends Cubit<RecipesState> {
|
||||
),
|
||||
);
|
||||
lastPage = currentPage;
|
||||
} catch (e) {
|
||||
} catch (e, st) {
|
||||
log(e.toString(), stackTrace: st);
|
||||
emit(RecipesState.error(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,4 +47,4 @@ class Recipes extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
children: [
|
||||
_iconButton('assets/icons/clock.svg', widget.recipes.cookingTime.toString() + ' минут'),
|
||||
SizedBox(width: 8),
|
||||
_iconButton('assets/icons/steps.svg', widget.recipes.steps.length.toString() + ' этапов'),
|
||||
_iconButton('assets/icons/steps.svg', '${widget.recipes.steps?.length ?? 0}' + ' этапов'),
|
||||
SizedBox(width: 8),
|
||||
_iconButton('assets/icons/calories.svg', '139.9 ккал'),
|
||||
],
|
||||
@@ -73,7 +73,7 @@ class _RecipesWidgetState extends State<RecipesWidget> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Text(
|
||||
widget.recipes.title,
|
||||
widget.recipes.title.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black87,
|
||||
|
||||
Reference in New Issue
Block a user