Feedback page implementation contd.
parent
c88bff8cf2
commit
73b05276f6
@ -0,0 +1,146 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/contact_us/contact_us_view_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/common_bottom_sheet.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class FeedbackPage extends StatelessWidget {
|
||||||
|
FeedbackPage({super.key});
|
||||||
|
|
||||||
|
late ContactUsViewModel contactUsViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
contactUsViewModel = Provider.of<ContactUsViewModel>(context);
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.bgScaffoldColor,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CollapsingListView(
|
||||||
|
title: LocaleKeys.feedback.tr(),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
CustomTabBar(
|
||||||
|
activeTextColor: AppColors.primaryRedColor,
|
||||||
|
activeBackgroundColor: AppColors.primaryRedColor.withValues(alpha: .1),
|
||||||
|
tabs: [
|
||||||
|
CustomTabBarModel(null, "Send".needTranslation),
|
||||||
|
CustomTabBarModel(null, "Status".needTranslation),
|
||||||
|
],
|
||||||
|
onTabChange: (index) {
|
||||||
|
contactUsViewModel.setIsSendFeedbackTabSelected(index == 0);
|
||||||
|
},
|
||||||
|
).paddingSymmetrical(24.h, 0.h),
|
||||||
|
getSelectedTabWidget(context).paddingSymmetrical(24.h, 16.w),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||||
|
color: AppColors.whiteColor,
|
||||||
|
borderRadius: 24.h,
|
||||||
|
hasShadow: true,
|
||||||
|
),
|
||||||
|
child: CustomButton(
|
||||||
|
text: LocaleKeys.submit.tr(context: context),
|
||||||
|
onPressed: () async {},
|
||||||
|
backgroundColor: AppColors.primaryRedColor,
|
||||||
|
borderColor: AppColors.primaryRedColor,
|
||||||
|
textColor: AppColors.whiteColor,
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
borderRadius: 12,
|
||||||
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
|
height: 50.h,
|
||||||
|
icon: AppAssets.feedback,
|
||||||
|
iconColor: AppColors.whiteColor,
|
||||||
|
iconSize: 20.h,
|
||||||
|
).paddingSymmetrical(24.h, 24.h),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget getSelectedTabWidget(BuildContext context) {
|
||||||
|
if (contactUsViewModel.isSendFeedbackTabSelected) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.likeToHear.tr().toText14(weight: FontWeight.w500),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
Container(
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||||
|
color: AppColors.whiteColor,
|
||||||
|
borderRadius: 24.h,
|
||||||
|
hasShadow: false,
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(16.h),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Utils.buildSvgWithAssets(icon: AppAssets.ask_doctor_icon, width: 24.w, height: 24.h, iconColor: AppColors.greyTextColor),
|
||||||
|
SizedBox(width: 12.w),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
LocaleKeys.feedbackType.tr().toText16(color: AppColors.textColor, weight: FontWeight.w500),
|
||||||
|
LocaleKeys.select.tr().toText14(color: AppColors.greyTextColor, weight: FontWeight.w500),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Utils.buildSvgWithAssets(icon: AppAssets.arrow_down, width: 25.h, height: 25.h),
|
||||||
|
],
|
||||||
|
).onPress(() {
|
||||||
|
showCommonBottomSheetWithoutHeight(context,
|
||||||
|
title: "Select Feedback Type".needTranslation, child: Container(), callBackFunc: () {}, isFullScreen: false, isCloseButtonVisible: true);
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
TextInputWidget(
|
||||||
|
labelText: "Subject".needTranslation,
|
||||||
|
hintText: "Type subject here".needTranslation,
|
||||||
|
// controller: searchEditingController,
|
||||||
|
isEnable: true,
|
||||||
|
prefix: null,
|
||||||
|
autoFocus: false,
|
||||||
|
isBorderAllowed: false,
|
||||||
|
keyboardType: TextInputType.text,
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
vertical: ResponsiveExtension(10).h,
|
||||||
|
horizontal: ResponsiveExtension(15).h,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue