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:
@@ -1,4 +1,5 @@
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/core/routing/route_constants.dart';
|
||||
import 'package:eatvio_app/core/theme/custom_text_style.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:eatvio_app/features/cancel_plan_bottom_sheet/cancel_plan_bottom_sheet.dart';
|
||||
@@ -24,20 +25,21 @@ import 'package:go_router/go_router.dart';
|
||||
class InfoByOrderScreen extends StatelessWidget {
|
||||
static const name = 'infoByOrderScreen';
|
||||
static const path = '/info-by-order-screen';
|
||||
const InfoByOrderScreen({super.key, this.successfulPayment, required this.planId, this.customerSlug});
|
||||
const InfoByOrderScreen({super.key, this.successfulPayment, required this.planId, this.customerSlug, this.isConsultantView = false});
|
||||
final bool? successfulPayment;
|
||||
final int planId;
|
||||
final String? customerSlug;
|
||||
final bool isConsultantView;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => sl<OrderInfoCubit>()..getChosenPlan(id: planId, customerSlug: customerSlug),
|
||||
create: (context) => sl<OrderInfoCubit>()..getChosenPlan(id: planId, customerSlug: customerSlug, isConsultantView: isConsultantView),
|
||||
child: InfoByOrderScreenContent(successfulPayment: successfulPayment, planId: planId, customerSlug: customerSlug),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InfoByOrderScreenContent extends StatefulWidget {
|
||||
class InfoByOrderScreenContent extends StatefulWidget {
|
||||
const InfoByOrderScreenContent({super.key, required this.planId, required this.successfulPayment, this.customerSlug});
|
||||
final int planId;
|
||||
final bool? successfulPayment;
|
||||
@@ -61,7 +63,11 @@ class _InfoByOrderScreenContentState extends State<InfoByOrderScreenContent> {
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
GoRouter.of(context).pop();
|
||||
if (GoRouter.of(context).canPop()) {
|
||||
GoRouter.of(context).pop();
|
||||
} else {
|
||||
GoRouter.of(context).go(RouteConstants.feedScreen);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -75,7 +81,11 @@ class _InfoByOrderScreenContentState extends State<InfoByOrderScreenContent> {
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
GoRouter.of(context).pop();
|
||||
if (GoRouter.of(context).canPop()) {
|
||||
GoRouter.of(context).pop();
|
||||
} else {
|
||||
GoRouter.of(context).go(RouteConstants.feedScreen);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -110,7 +120,11 @@ class _InfoByOrderScreenContentState extends State<InfoByOrderScreenContent> {
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
GoRouter.of(context).pop();
|
||||
if (GoRouter.of(context).canPop()) {
|
||||
GoRouter.of(context).pop();
|
||||
} else {
|
||||
GoRouter.of(context).go(RouteConstants.feedScreen);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -134,7 +148,7 @@ class _InfoByOrderScreenContentState extends State<InfoByOrderScreenContent> {
|
||||
const SizedBox(height: 8),
|
||||
OptionWidget(option: chosenOption, disableDuration: true, duration: plan.plan.duration),
|
||||
const SizedBox(height: 8),
|
||||
PlanState(state: plan.chosenPlanState, hasPersonalDiet: chosenOption?.hasPersonalDiet ?? false,),
|
||||
PlanState(state: plan.chosenPlanState, hasPersonalDiet: chosenOption?.hasPersonalDiet ?? false),
|
||||
const SizedBox(height: 20),
|
||||
if (widget.successfulPayment == null)
|
||||
CustomOutlinedButton(
|
||||
|
||||
Reference in New Issue
Block a user