forked from eatvio/eatvio_app
feat(diary): consultant comments
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'package:eatvio_app/core/locator_service.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';
|
||||
import 'package:eatvio_app/core/widgets/custom_outlined_button.dart';
|
||||
import 'package:eatvio_app/core/widgets/loader.dart';
|
||||
import 'package:eatvio_app/features/diets/presentation/widgets/author_card.dart';
|
||||
import 'package:eatvio_app/features/feed/models/plan_pagination_model.dart';
|
||||
@@ -117,55 +119,72 @@ class _InfoByOrderScreenContentState extends State<InfoByOrderScreenContent> {
|
||||
planStatus = PlanStatusValues.pendingPayment;
|
||||
}
|
||||
return Scaffold(
|
||||
backgroundColor: appTheme.gray100,
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
s.infoAboutOrder,
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
GoRouter.of(context).pop();
|
||||
}),
|
||||
backgroundColor: appTheme.gray100,
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
s.infoAboutOrder,
|
||||
style: TextStyles.headingXLSemibold.copyWith(color: appTheme.black),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
if (widget.successfulPayment != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
PaymentBanner(
|
||||
successfulPayment: widget.successfulPayment ?? false,
|
||||
),
|
||||
],
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
GoRouter.of(context).pop();
|
||||
}),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
if (widget.successfulPayment != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
AuthorCard(
|
||||
author: plan.plan.author,
|
||||
title: s.plan_seller,
|
||||
titleStyle: TextStyles.textSSemibold.copyWith(color: appTheme.gray),
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
PaymentBanner(
|
||||
successfulPayment: widget.successfulPayment ?? false,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
PlanProps(planDuration: plan.plan.duration, planPrice: chosenOption?.price.toDouble() ?? 0, planStatus: planStatus),
|
||||
const SizedBox(height: 8),
|
||||
PlanInfo(
|
||||
title: plan.plan.name,
|
||||
description: plan.plan.details,
|
||||
imagePath: plan.plan.image,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OptionWidget(
|
||||
option: chosenOption,
|
||||
disableDuration: true,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
PlanState(
|
||||
state: plan.chosenPlanState,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
],
|
||||
),
|
||||
));
|
||||
const SizedBox(height: 8),
|
||||
AuthorCard(
|
||||
author: plan.plan.author,
|
||||
title: s.plan_seller,
|
||||
titleStyle: TextStyles.textSSemibold.copyWith(color: appTheme.gray),
|
||||
backgroundColor: appTheme.whiteA700,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
PlanProps(planDuration: plan.plan.duration, planPrice: chosenOption?.price.toDouble() ?? 0, planStatus: planStatus),
|
||||
const SizedBox(height: 8),
|
||||
PlanInfo(
|
||||
title: plan.plan.name,
|
||||
description: plan.plan.details,
|
||||
imagePath: plan.plan.image,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OptionWidget(
|
||||
option: chosenOption,
|
||||
disableDuration: true,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
PlanState(
|
||||
state: plan.chosenPlanState,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
if (widget.successfulPayment == null)
|
||||
CustomOutlinedButton(
|
||||
text: s.cancelConsultation,
|
||||
height: 52,
|
||||
buttonTextStyle: TextStyles.textMSemibold.copyWith(color: appTheme.strongRed),
|
||||
buttonStyle: ButtonStyle(side: const WidgetStatePropertyAll(BorderSide.none), backgroundColor: WidgetStatePropertyAll(appTheme.lightRed)),
|
||||
onPressed: () async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (context) => CancelPlanBottomSheet(
|
||||
enableForm: plan.chosenPlanState.isStateAfterPaidState(),
|
||||
planId: plan.id,
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -142,20 +142,6 @@ class _PaymentBannerState extends State<PaymentBanner> {
|
||||
],
|
||||
),
|
||||
)
|
||||
])
|
||||
// ? Column(children: [
|
||||
// SizedBox(
|
||||
// width: size.width * 0.6,
|
||||
// child: Text(
|
||||
// s.smth_went_wrong_payment_failed,
|
||||
// style: TextStyles.textLSemibold.copyWith(color: appTheme.black),
|
||||
// ),
|
||||
// ),
|
||||
// ])
|
||||
// : Padding(
|
||||
// padding: const EdgeInsets.only(right: 16),
|
||||
// child: ,
|
||||
// ),
|
||||
);
|
||||
]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class PlanStatusBox extends StatelessWidget {
|
||||
final s = S.of(context);
|
||||
final title = switch (status) {
|
||||
PlanStatusValues.paid => s.order_paid,
|
||||
PlanStatusValues.pendingPayment => s.payment_failed,
|
||||
PlanStatusValues.pendingPayment => s.pending_payment,
|
||||
PlanStatusValues.paymentFailed => s.payment_failed,
|
||||
};
|
||||
return Container(
|
||||
|
||||
Reference in New Issue
Block a user