forked from eatvio/eatvio_app
feat(l10n): localize rating place and favorite error messages
- add rating_place and error_try_again_later ARB keys (ru/en) - use S.rating_place in profile screen, plan widget and author card - use S.current.error_try_again_later in profile plans cubit - hide rating badge when rating place is null instead of rendering null-й - initialize localization in profile plans cubit test
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
||||
import 'package:eatvio_app/features/plans/repositories/plan_repository.dart';
|
||||
import 'package:eatvio_app/features/plans/repositories/plans_repository.dart';
|
||||
import 'package:eatvio_app/features/profile/presentation/bloc/plans_cubit/plans_state.dart';
|
||||
import 'package:eatvio_app/generated/l10n.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class PlansCubit extends Cubit<PlansState> {
|
||||
@@ -16,7 +17,6 @@ class PlansCubit extends Cubit<PlansState> {
|
||||
final PlanRepository planRepository;
|
||||
|
||||
static const Duration _debounceDuration = Duration(milliseconds: 200);
|
||||
static const String _favoriteErrorMessage = 'Произошла ошибка. Попробуйте ещё раз через некоторое время';
|
||||
|
||||
late final StreamSubscription<LikesState> likesStateSubscription;
|
||||
late final StreamSubscription<FavoriteState> favoriteStateSubscription;
|
||||
@@ -109,7 +109,7 @@ class PlansCubit extends Cubit<PlansState> {
|
||||
await reportFrom(e, st, this);
|
||||
if (isClosed) return;
|
||||
_updatePlanBySlug(slug, (plan) => plan.copyWith(isFavorite: previousIsFavorite));
|
||||
showErrorToast(_favoriteErrorMessage);
|
||||
showErrorToast(S.current.error_try_again_later);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user