Feedback page implementation contd.

pull/101/head
haroon amjad 2 weeks ago
parent 73b05276f6
commit 9f845f1de8

@ -6,8 +6,6 @@ class DateUtil {
/// convert String To Date function
/// [date] String we want to convert
static DateTime convertStringToDate(String? date) {
print("the date is $date");
if (date == null) return DateTime.now();
if (date.isEmpty) return DateTime.now();

@ -22,6 +22,8 @@ class ContactUsViewModel extends ChangeNotifier {
int selectedLiveChatProjectIndex = -1;
List<String> feedbackAttachmentList = [];
ContactUsViewModel({required this.contactUsRepo, required this.errorHandlerService, required this.appState});
initContactUsViewModel() {
@ -31,6 +33,7 @@ class ContactUsViewModel extends ChangeNotifier {
hmgHospitalsLocationsList.clear();
hmgPharmacyLocationsList.clear();
liveChatProjectsList.clear();
feedbackAttachmentList.clear();
getHMGLocations();
notifyListeners();
}

@ -12,6 +12,7 @@ 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/image_picker.dart';
import 'package:hmg_patient_app_new/widgets/input_widget.dart';
import 'package:provider/provider.dart';
@ -25,10 +26,12 @@ class FeedbackPage extends StatelessWidget {
contactUsViewModel = Provider.of<ContactUsViewModel>(context);
return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
body: Column(
body: Consumer<ContactUsViewModel>(builder: (context, contactUsVM, child) {
return Column(
children: [
Expanded(
child: CollapsingListView(
isLeading: Navigator.canPop(context),
title: LocaleKeys.feedback.tr(),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -53,7 +56,10 @@ class FeedbackPage extends StatelessWidget {
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
customBorder: BorderRadius.only(
topLeft: Radius.circular(24.h),
topRight: Radius.circular(24.h),
),
hasShadow: true,
),
child: CustomButton(
@ -73,7 +79,8 @@ class FeedbackPage extends StatelessWidget {
).paddingSymmetrical(24.h, 24.h),
),
],
),
);
}),
);
}
@ -87,7 +94,7 @@ class FeedbackPage extends StatelessWidget {
Container(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: AppColors.whiteColor,
borderRadius: 24.h,
borderRadius: 16.r,
hasShadow: false,
),
child: Padding(
@ -124,12 +131,28 @@ class FeedbackPage extends StatelessWidget {
SizedBox(height: 16.h),
TextInputWidget(
labelText: "Subject".needTranslation,
hintText: "Type subject here".needTranslation,
hintText: "Enter 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),
TextInputWidget(
labelText: "Message".needTranslation,
hintText: "Enter message here".needTranslation,
// controller: searchEditingController,
isEnable: true,
prefix: null,
autoFocus: false,
isBorderAllowed: false,
isMultiline: true,
keyboardType: TextInputType.text,
padding: EdgeInsets.symmetric(
vertical: ResponsiveExtension(10).h,
@ -137,6 +160,35 @@ class FeedbackPage extends StatelessWidget {
),
),
SizedBox(height: 16.h),
CustomButton(
text: LocaleKeys.selectAttachment.tr(context: context),
onPressed: () async {
ImageOptions.showImageOptionsNew(
context,
true,
(String image, file) {
print(image);
print(file);
Navigator.pop(context);
// setState(() {
// EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${medicalReportImages.length + 1}.png', base64String: image);
// medicalReportImages.add(eReferralAttachment);
// });
},
);
},
backgroundColor: AppColors.secondaryLightRedColor,
borderColor: AppColors.secondaryLightRedColor,
textColor: AppColors.primaryRedColor,
fontSize: 14.f,
fontWeight: FontWeight.w500,
borderRadius: 10.r,
padding: EdgeInsets.symmetric(horizontal: 10.w),
height: isTablet || isFoldable ? 46.h : 40.h,
icon: AppAssets.file_icon,
iconColor: AppColors.primaryRedColor,
iconSize: 16.h,
)
],
);
} else {

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_state.dart';
import 'package:hmg_patient_app_new/core/dependencies.dart';
import 'package:hmg_patient_app_new/presentation/book_appointment/book_appointment_page.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/feedback_page.dart';
import 'package:hmg_patient_app_new/presentation/hmg_services/services_page.dart';
import 'package:hmg_patient_app_new/presentation/home/landing_page.dart';
import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart';
@ -29,7 +30,7 @@ class _LandingNavigationState extends State<LandingNavigation> {
physics: const NeverScrollableScrollPhysics(),
children: [
const LandingPage(),
appState.isAuthenticated ? MedicalFilePage() : /* need add feedback page */ const LandingPage(),
appState.isAuthenticated ? MedicalFilePage() : /* need add feedback page */ FeedbackPage(),
BookAppointmentPage(),
const ToDoPage(),
appState.isAuthenticated ? /* need add news page */ ServicesPage() : const LandingPage(),

@ -43,6 +43,11 @@ class TextInputWidget extends StatelessWidget {
final Color? labelColor;
final Function(String)? onSubmitted;
// new multiline options
final bool isMultiline;
final int minLines;
final int maxLines;
// final List<Country> countryList;
// final Function(Country)? onCountryChange;
@ -73,7 +78,11 @@ class TextInputWidget extends StatelessWidget {
this.isWalletAmountInput = false,
this.suffix,
this.labelColor,
this.onSubmitted
this.onSubmitted,
// multiline defaults
this.isMultiline = false,
this.minLines = 3,
this.maxLines = 6,
// this.countryList = const [],
// this.onCountryChange,
});
@ -113,7 +122,7 @@ class TextInputWidget extends StatelessWidget {
children: [
Container(
padding: padding,
height: 64.h,
height: isMultiline ? null : 64.h,
alignment: Alignment.center,
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
color: Colors.white,
@ -238,7 +247,7 @@ class TextInputWidget extends StatelessWidget {
return TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: keyboardType,
keyboardType: isMultiline ? TextInputType.multiline : keyboardType,
controller: controller,
readOnly: isReadOnly,
textAlignVertical: TextAlignVertical.top,
@ -253,7 +262,15 @@ class TextInputWidget extends StatelessWidget {
FocusManager.instance.primaryFocus?.unfocus();
},
onSubmitted: onSubmitted,
style: TextStyle(fontSize: fontS, height: isWalletAmountInput! ? 1 / 4 : 0, fontWeight: FontWeight.w500, color: AppColors.textColor, letterSpacing: -1),
minLines: isMultiline ? minLines : 1,
maxLines: isMultiline ? maxLines : 1,
style: TextStyle(
fontSize: fontS,
height: isMultiline ? 1.2 : (isWalletAmountInput! ? 1 / 4 : 0),
fontWeight: FontWeight.w500,
color: AppColors.textColor,
letterSpacing: -1,
),
decoration: InputDecoration(
isDense: true,
hintText: hintText,

Loading…
Cancel
Save