my appointments implementation contd.

pull/18/head
Haroon Amjad 2 months ago
parent 003a161b52
commit f7d62ed2e8

@ -0,0 +1,8 @@
<svg id="user_21_" data-name="user (21)" xmlns="http://www.w3.org/2000/svg" width="110.999" height="110.999" viewBox="0 0 110.999 110.999">
<path id="Path_4696" data-name="Path 4696" d="M272.482,267.883a25.756,25.756,0,0,0,5.549-15.868,26.015,26.015,0,1,0-26.015,26.015,25.756,25.756,0,0,0,15.868-5.549l14.569,14.569a3.252,3.252,0,1,0,4.6-4.6ZM260.818,256.22a3.252,3.252,0,1,1-4.6,4.6l-4.2-4.2-4.2,4.2a3.252,3.252,0,0,1-4.6-4.6l4.2-4.2-4.2-4.2a3.252,3.252,0,0,1,4.6-4.6l4.2,4.2,4.2-4.2a3.252,3.252,0,1,1,4.6,4.6l-4.2,4.2Z" transform="translate(-177.004 -177.004)" fill="#ddd"/>
<circle id="Ellipse_165" data-name="Ellipse 165" cx="3.5" cy="3.5" r="3.5" transform="translate(35.5 19.499)" fill="#ddd"/>
<path id="Path_4697" data-name="Path 4697" d="M197.516,362h0Z" transform="translate(-154.695 -283.52)" fill="#ddd"/>
<path id="Path_4698" data-name="Path 4698" d="M197.516,332h0Z" transform="translate(-154.695 -260.021)" fill="#ddd"/>
<path id="Path_4699" data-name="Path 4699" d="M3.252,111H75.011a3.25,3.25,0,0,0,3.252-3.252v-.329a31.763,31.763,0,0,1-3.252.329,32.393,32.393,0,0,1-23.165-9.756H16.476a3.252,3.252,0,0,1,0-6.5H47.016v0a32.2,32.2,0,0,1-2.865-6.507H16.476a3.252,3.252,0,0,1,0-6.5H42.821c-.454-4.484-.454-2.022,0-6.5H16.476a3.252,3.252,0,1,1,0-6.5H44.152a32.468,32.468,0,0,1,7.694-13.009H26.232a3.25,3.25,0,0,1-3.252-3.252V45.96A13.021,13.021,0,0,1,35.988,32.953H39.24A9.756,9.756,0,1,1,49,23.2a9.767,9.767,0,0,1-9.756,9.756h3.252A13.021,13.021,0,0,1,55.5,45.96v3.252c0,.071-.036.13-.04.2a32.2,32.2,0,0,1,19.552-6.7,31.762,31.762,0,0,1,3.252.329V3.252A3.25,3.25,0,0,0,75.011,0H3.252A3.25,3.25,0,0,0,0,3.252v104.5A3.25,3.25,0,0,0,3.252,111Z" fill="#ddd"/>
<path id="Path_4700" data-name="Path 4700" d="M142.5,182a6.512,6.512,0,0,0-6.5,6.5h19.512a6.512,6.512,0,0,0-6.5-6.5Z" transform="translate(-106.516 -142.543)" fill="#ddd"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -7,13 +7,16 @@ import 'package:hmg_patient_app_new/core/api_consts.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/core/utils/utils.dart';
import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart';
import 'package:hmg_patient_app_new/services/logger_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:http/http.dart' as http;
import '../exceptions/api_failure.dart';
abstract class ApiClient {
static final NavigationService _navigationService = getIt.get<NavigationService>();
Future<void> post(
String endPoint, {
required Map<String, dynamic> body,
@ -105,7 +108,7 @@ class ApiClientImp implements ApiClient {
url = ApiConsts.baseUrl + endPoint;
}
}
try {
// try {
var user = _appState.getAuthenticatedUser();
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
if (!isExternal) {
@ -261,6 +264,8 @@ class ApiClientImp implements ApiClient {
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
}
}
} else if (!parsed['IsAuthenticated']) {
} else {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode, messageStatus: parsed['MessageStatus'], errorMessage: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
@ -285,16 +290,20 @@ class ApiClientImp implements ApiClient {
}
}
}
} catch (e, stackTrace) {
_loggerService.errorLogs(stackTrace.toString());
if (e.toString().contains("ClientException")) {
onFailure('ClientException: Something went wrong, Please try again', -1, failureType: InvalidCredentials('ClientException: Something went wrong, plase try again'));
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
} else {
onFailure(e.toString(), -1);
}
_analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url");
}
// } catch (e, stackTrace) {
// _loggerService.errorLogs(stackTrace.toString());
// if (e.toString().contains("ClientException")) {
// onFailure('ClientException: Something went wrong, Please try again', -1, failureType: InvalidCredentials('ClientException: Something went wrong, plase try again'));
// _analytics.errorTracking.log("internet_connectivity", error: "no internet available");
// } else {
// onFailure(e.toString(), -1);
// }
// _analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url");
// }
}
logout() async {
ApiClient._navigationService.pushAndReplace(AppRoutes.landingScreen);
}
@override

@ -291,7 +291,7 @@ class Utils {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SvgPicture.asset('assets/images/NoDataAvailableIcon.svg', width: 150.0, height: 150.0),
SvgPicture.asset('assets/images/svg/not_found.svg', width: 150.0, height: 150.0),
(errorText ?? LocaleKeys.noDataAvailable.tr()).toText16(isCenter: true).paddingOnly(top: 15),
],
).center;
@ -310,6 +310,19 @@ class Utils {
).center;
}
static Widget getSuccessWidget({String? loadingText}) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Lottie.asset(AppAnimations.checkmark, repeat: true, reverse: false, frameRate: FrameRate(60), width: 100.h, height: 100.h, fit: BoxFit.fill),
SizedBox(height: 8.h),
(loadingText ?? LocaleKeys.loadingText.tr()).toText16(color: AppColors.blackColor),
SizedBox(height: 8.h),
],
).center;
}
static bool isVidaPlusProject(AppState appState, int projectID) {
bool isVidaPlus = false;
for (var element in appState.vidaPlusProjectList) {

@ -125,6 +125,8 @@ extension EmailValidator on String {
bool isBold = false,
bool isCenter = false,
int maxLine = 0,
FontWeight? weight,
double? letterSpacing = -1
}) =>
Text(
this,
@ -132,9 +134,9 @@ extension EmailValidator on String {
maxLines: (maxLine > 0) ? maxLine : null,
style: TextStyle(
fontSize: 13.fSize,
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal),
color: color ?? AppColors.blackColor,
letterSpacing: -1,
letterSpacing: letterSpacing,
decoration: isUnderLine ? TextDecoration.underline : null),
);

@ -9,10 +9,9 @@ import 'package:hmg_patient_app_new/services/logger_service.dart';
abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments(
{required String patientId, required bool isActiveAppointment, required bool isArrivedAppointments});
{required bool isActiveAppointment, required bool isArrivedAppointments});
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment(
{required String patientId, required int projectID, required int clinicID, required String appointmentNo});
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment({required int projectID, required int clinicID, required String appointmentNo});
Future<Either<Failure, GenericApiModel<dynamic>>> createAdvancePayment(
{required String paymentMethodName,
@ -26,7 +25,9 @@ abstract class MyAppointmentsRepo {
Future<Either<Failure, GenericApiModel<dynamic>>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, required String appointmentNo});
Future<Either<Failure, GenericApiModel<dynamic>>> generateAppointmentQR({required String clinicID, required String projectID, required String appointmentNo, required int isFollowUp});
Future<Either<Failure, GenericApiModel<dynamic>>> generateAppointmentQR({required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp});
Future<Either<Failure, GenericApiModel<dynamic>>> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel});
}
class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@ -37,8 +38,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@override
Future<Either<Failure, GenericApiModel<List<PatientAppointmentHistoryResponseModel>>>> getPatientAppointments(
{required String patientId, required bool isActiveAppointment, required bool isArrivedAppointments}) async {
final mapDevice = {
{required bool isActiveAppointment, required bool isArrivedAppointments}) async {
Map<String, dynamic> mapDevice = {
"IsActiveAppointment": isActiveAppointment,
"isDentalAllowedBackend": false,
"PatientTypeID": 1,
@ -61,9 +62,9 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
final list = response['AppoimentAllHistoryResultList'];
if (list == null || list.isEmpty) {
throw Exception("Appointments list is empty");
}
// if (list == null || list.isEmpty) {
// throw Exception("Appointments list is empty");
// }
final appointmentsList = list.map((item) => PatientAppointmentHistoryResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientAppointmentHistoryResponseModel>();
@ -87,19 +88,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
}
@override
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment(
{required String patientId, required int projectID, required int clinicID, required String appointmentNo}) async {
final mapRequest = {
"ProjectID": projectID,
"ClinicID": clinicID,
"AppointmentNo": appointmentNo,
"IsActiveAppointment": true,
"PatientOutSA": 0,
"isDentalAllowedBackend": false,
"PatientID": patientId,
"PatientTypeID": 1,
"PatientType": 1,
};
Future<Either<Failure, GenericApiModel<PatientAppointmentShareResponseModel>>> getPatientShareAppointment({required int projectID, required int clinicID, required String appointmentNo}) async {
Map<String, dynamic> mapRequest = {"ProjectID": projectID, "ClinicID": clinicID, "AppointmentNo": appointmentNo, "IsActiveAppointment": true};
try {
GenericApiModel<PatientAppointmentShareResponseModel>? apiResponse;
@ -139,8 +129,6 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
throw UnimplementedError();
}
@override
@ -154,7 +142,7 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
required String patientID,
required int patientType,
}) async {
final requestBody = {
Map<String, dynamic> requestBody = {
"ProjectID": projectID,
"OnlineCheckInAppointment": {
"AppointmentNo": appointmentNo,
@ -202,7 +190,7 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
@override
Future<Either<Failure, GenericApiModel>> addAdvanceNumberRequest({required String advanceNumber, required String paymentReference, required String appointmentNo}) async {
final requestBody = {
Map<String, dynamic> requestBody = {
"AdvanceNumber": advanceNumber,
"AdvanceNumber_VP": advanceNumber,
"PaymentReferenceNumber": paymentReference,
@ -240,8 +228,8 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
}
@override
Future<Either<Failure, GenericApiModel>> generateAppointmentQR({required String clinicID, required String projectID, required String appointmentNo, required int isFollowUp}) async {
final requestBody = {
Future<Either<Failure, GenericApiModel>> generateAppointmentQR({required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp}) async {
Map<String, dynamic> requestBody = {
"AppointmentNo": appointmentNo,
"ClinicID": clinicID,
"ProjectID": projectID,
@ -277,4 +265,49 @@ class MyAppointmentsRepoImp implements MyAppointmentsRepo {
return Left(UnknownFailure(e.toString()));
}
}
@override
Future<Either<Failure, GenericApiModel>> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel}) async {
Map<String, dynamic> requestBody = {
"AppointmentID": patientAppointmentHistoryResponseModel.appointmentNo,
"ClinicID": patientAppointmentHistoryResponseModel.clinicID,
"ProjectID": patientAppointmentHistoryResponseModel.projectID,
"CancelToReschadual": false,
"EndTime": patientAppointmentHistoryResponseModel.endTime,
"StartTime": patientAppointmentHistoryResponseModel.startTime,
"DoctorID": patientAppointmentHistoryResponseModel.doctorID,
"IsForLiveCare": patientAppointmentHistoryResponseModel.isLiveCareAppointment,
"OriginalClinicID": patientAppointmentHistoryResponseModel.originalClinicID,
"OriginalProjectID": patientAppointmentHistoryResponseModel.originalProjectID
};
try {
GenericApiModel<dynamic>? apiResponse;
Failure? failure;
await apiClient.post(
CANCEL_APPOINTMENT,
body: requestBody,
onFailure: (error, statusCode, {messageStatus, failureType}) {
failure = failureType;
},
onSuccess: (response, statusCode, {messageStatus, errorMessage}) {
try {
apiResponse = GenericApiModel<dynamic>(
messageStatus: messageStatus,
statusCode: statusCode,
errorMessage: null,
data: response,
);
} catch (e) {
failure = DataParsingFailure(e.toString());
}
},
);
if (failure != null) return Left(failure!);
if (apiResponse == null) return Left(ServerFailure("Unknown error"));
return Right(apiResponse!);
} catch (e) {
return Left(UnknownFailure(e.toString()));
}
}
}

@ -49,7 +49,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
Future<void> getPatientAppointments(bool isActiveAppointment, bool isArrivedAppointments, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientAppointments(patientId: "3628599", isActiveAppointment: isActiveAppointment, isArrivedAppointments: isArrivedAppointments);
final result = await myAppointmentsRepo.getPatientAppointments(isActiveAppointment: isActiveAppointment, isArrivedAppointments: isArrivedAppointments);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
@ -69,7 +69,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
Future<void> getPatientShareAppointment(int projectID, int clinicID, String appointmentNo, {Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.getPatientShareAppointment(patientId: "3628599", projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo);
final result = await myAppointmentsRepo.getPatientShareAppointment(projectID: projectID, clinicID: clinicID, appointmentNo: appointmentNo);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
@ -108,7 +108,7 @@ class MyAppointmentsViewModel extends ChangeNotifier {
}
Future<void> generateAppointmentQR(
{required String clinicID, required String projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async {
{required int clinicID, required int projectID, required String appointmentNo, required int isFollowUp, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.generateAppointmentQR(clinicID: clinicID, projectID: projectID, appointmentNo: appointmentNo, isFollowUp: isFollowUp);
result.fold(
@ -126,6 +126,25 @@ class MyAppointmentsViewModel extends ChangeNotifier {
);
}
Future<void> cancelAppointment({required PatientAppointmentHistoryResponseModel patientAppointmentHistoryResponseModel, Function(dynamic)? onSuccess, Function(String)? onError}) async {
final result = await myAppointmentsRepo.cancelAppointment(patientAppointmentHistoryResponseModel: patientAppointmentHistoryResponseModel);
result.fold(
(failure) async => await errorHandlerService.handleError(failure: failure),
(apiResponse) {
if (apiResponse.messageStatus == 2) {
onError!(apiResponse.errorMessage!);
// dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {});
} else if (apiResponse.messageStatus == 1) {
notifyListeners();
if (onSuccess != null) {
onSuccess(apiResponse);
}
}
},
);
}
Future<void> createAdvancePayment(
{required String paymentMethodName,
required int projectID,

@ -16,6 +16,7 @@ import 'package:hmg_patient_app_new/presentation/appointments/appointment_paymen
import 'package:hmg_patient_app_new/presentation/appointments/widgets/appointment_doctor_card.dart';
import 'package:hmg_patient_app_new/theme/colors.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/transitions/fade_page.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
@ -58,7 +59,33 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
AppointmentDoctorCard(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onAskDoctorTap: () {},
onCancelTap: () {},
onCancelTap: () async {
showCommonBottomSheet(context,
child: Utils.getLoadingWidget(),
callBackFunc: (str) {},
title: "",
height: ResponsiveExtension.screenHeight * 0.3,
isCloseButtonVisible: false,
isDismissible: false,
isFullScreen: false);
await myAppointmentsViewModel.cancelAppointment(
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
onSuccess: (apiResponse) {
Navigator.of(context).pop();
showCommonBottomSheet(context,
child: Utils.getSuccessWidget(loadingText: "Appointment Cancelled Successfully".needTranslation),
callBackFunc: (str) {
},
title: "",
height: ResponsiveExtension.screenHeight * 0.3,
isCloseButtonVisible: false,
isDismissible: false,
isFullScreen: false,
isSuccessDialog: true);
});
Navigator.of(context).pop();
Navigator.of(context).pop();
},
onRescheduleTap: () {},
),
SizedBox(height: 16.h),

@ -354,8 +354,8 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
print(value);
await myAppointmentsViewModel.addAdvanceNumberRequest(
advanceNumber: Utils.isVidaPlusProject(appState, widget.patientAppointmentHistoryResponseModel.projectID)
? value['data']['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: value['data']['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!,
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
onSuccess: (value) async {

@ -6,6 +6,7 @@ import 'package:flutter_staggered_animations/flutter_staggered_animations.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/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/my_appointments/my_appointments_view_model.dart';
@ -59,7 +60,7 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
tabs: [
CustomTabBarModel(null, "All Appt.".needTranslation),
CustomTabBarModel(null, "Upcoming".needTranslation),
CustomTabBarModel(null, LocaleKeys.request.tr(context: context)),
CustomTabBarModel(null, "Completed".needTranslation),
],
onTabChange: (index) {
print(index);
@ -74,11 +75,11 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: myAppointmentsVM.isMyAppointmentsLoading ? 5 : myAppointmentsVM.patientAppointmentsHistoryList.length,
itemCount: myAppointmentsVM.isMyAppointmentsLoading ? 5 : myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty ? myAppointmentsVM.patientAppointmentsHistoryList.length : 1,
itemBuilder: (context, index) {
return myAppointmentsVM.isMyAppointmentsLoading
? const MoviesShimmerWidget().paddingSymmetrical(24.h, 0.h)
: AnimationConfiguration.staggeredList(
: myAppointmentsVM.patientAppointmentsHistoryList.isNotEmpty ? AnimationConfiguration.staggeredList(
position: index,
duration: const Duration(milliseconds: 500),
child: SlideAnimation(
@ -96,7 +97,7 @@ class _MyAppointmentsPageState extends State<MyAppointmentsPage> {
).paddingSymmetrical(24.h, 0.h),
),
),
);
) : Utils.getNoDataWidget(context);
},
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
),

@ -158,11 +158,14 @@ class _AppointmentCardState extends State<AppointmentCard> {
child: CustomButton(
text: AppointmentType.getNextActionText(widget.patientAppointmentHistoryResponseModel.nextAction),
onPressed: () {
Navigator.of(context).push(
FadePage(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
),
);
Navigator.of(context)
.push(FadePage(
page: AppointmentDetailsPage(patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel),
))
.then((val) {
widget.myAppointmentsViewModel.initAppointmentsViewModel();
widget.myAppointmentsViewModel.getPatientAppointments(true, false);
});
},
backgroundColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.1),
borderColor: AppointmentType.getNextActionButtonColor(widget.patientAppointmentHistoryResponseModel.nextAction).withOpacity(0.01),

@ -7,7 +7,14 @@ import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
void showCommonBottomSheet(BuildContext context,
{required Widget child, Function(String?)? callBackFunc, String? title, required double height, bool isCloseButtonVisible = true, bool isFullScreen = true, bool isDismissible = true}) {
{required Widget child,
Function(String?)? callBackFunc,
String? title,
required double height,
bool isCloseButtonVisible = true,
bool isFullScreen = true,
bool isDismissible = true,
bool isSuccessDialog = false}) {
showModalBottomSheet<String>(
sheetAnimationStyle: AnimationStyle(
duration: Duration(milliseconds: 500), // Custom animation duration
@ -17,7 +24,7 @@ void showCommonBottomSheet(BuildContext context,
isScrollControlled: true,
showDragHandle: false,
isDismissible: isDismissible,
backgroundColor: AppColors.scaffoldBgColor,
backgroundColor: isSuccessDialog ? AppColors.whiteColor : AppColors.scaffoldBgColor,
builder: (BuildContext context) {
return Container(
height: height,
@ -30,9 +37,9 @@ void showCommonBottomSheet(BuildContext context,
),
);
}).then((value) {
if(value != null) {
callBackFunc!(value);
}
if (value != null) {
callBackFunc!(value);
}
});
}
@ -67,13 +74,18 @@ class ButtonSheetContent extends StatelessWidget {
// Close button
isCloseButtonVisible && isFullScreen
? Column(children: [
SizedBox(height: 40.h,),
Padding(
padding: EdgeInsets.symmetric(horizontal: 16,),
child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32).onPress(() {
Navigator.of(context).pop();
}),
)])
SizedBox(
height: 40.h,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: 16,
),
child: Utils.buildSvgWithAssets(icon: AppAssets.closeBottomNav, width: 32, height: 32).onPress(() {
Navigator.of(context).pop();
}),
)
])
: SizedBox(),
isFullScreen

@ -102,7 +102,7 @@ class _CustomTabBarState extends State<CustomTabBar> {
children: [
if (tabBar.image != null) Utils.buildSvgWithAssets(icon: tabBar.image!, height: 18, width: 18, iconColor: isSelected ? widget.activeTextColor : widget.inActiveTextColor),
tabBar.title
.toText14(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1),
.toText13(weight: isSelected ? FontWeight.w600 : FontWeight.w500, color: isSelected ? widget.activeTextColor : widget.inActiveTextColor, letterSpacing: isSelected ? -0.3 : -0.1),
],
)).onPress(() {
setState(() {

Loading…
Cancel
Save