forked from eatvio/eatvio_app
feat(app): refactoring of sentry using, feat(become_consultant): fixed possible infinite loading, feat(push_notifications): fixed push navigation from paid plan push
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:eatvio_app/features/my_finance/models/payment_url_model.dart';
|
||||
import 'package:eatvio_app/features/my_finance/presentation/cubit/user_cards_cubit/user_cards_state.dart';
|
||||
import 'package:eatvio_app/features/my_finance/repositories/cards_repository.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:eatvio_app/core/error_reporting/report_from.dart';
|
||||
|
||||
class UserCardsCubit extends Cubit<UserCardsState> {
|
||||
final CardsRepository cardsRepository;
|
||||
@@ -15,6 +16,7 @@ class UserCardsCubit extends Cubit<UserCardsState> {
|
||||
try {
|
||||
return await cardsRepository.addCard();
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
log(e.toString(), stackTrace: st);
|
||||
}
|
||||
return null;
|
||||
@@ -27,6 +29,7 @@ class UserCardsCubit extends Cubit<UserCardsState> {
|
||||
final cards = await cardsRepository.getCards();
|
||||
emit(state.copyWith(cards: cards, state: BaseState.success));
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
log(e.toString(), stackTrace: st);
|
||||
emit(state.copyWith(state: BaseState.error, error: e.toString()));
|
||||
}
|
||||
@@ -47,6 +50,7 @@ class UserCardsCubit extends Cubit<UserCardsState> {
|
||||
try {
|
||||
await cardsRepository.markAsDefault(id: id);
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
emit(state.copyWith(cards: oldCards));
|
||||
log(e.toString(), stackTrace: st);
|
||||
}
|
||||
@@ -61,6 +65,7 @@ class UserCardsCubit extends Cubit<UserCardsState> {
|
||||
emit(state.copyWith(cards: cards));
|
||||
await cardsRepository.deleteCard(id: id);
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
emit(state.copyWith(cards: oldCards, error: e.toString(), state: BaseState.error));
|
||||
log(e.toString(), stackTrace: st);
|
||||
}
|
||||
@@ -71,6 +76,7 @@ class UserCardsCubit extends Cubit<UserCardsState> {
|
||||
await cardsRepository.collectCharge(chosenPlaId: chosenPlaId);
|
||||
return true;
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
log(e.toString(), stackTrace: st);
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user