* 'master' of http://34.17.182.140/Haroon6138/HMG_Patient_App_New:
  updates
  fixed the suggested design changes. (Not reminder ones)
  fixed the suggested design changes. (Not reminder ones)
pull/140/head
Sultan khan 2 weeks ago
commit dc8031bb41

@ -210,7 +210,7 @@ class ApiClientImp implements ApiClient {
final int statusCode = response.statusCode;
log("uri: ${Uri.parse(url.trim())}");
log("body: ${json.encode(body)}");
log("response.body: ${response.body}");
// log("response.body: ${response.body}");
if (statusCode < 200 || statusCode >= 400) {
onFailure('Error While Fetching data', statusCode, failureType: StatusCodeFailure("Error While Fetching data"));
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);

@ -182,6 +182,7 @@ class PrescriptionsRepoImp implements PrescriptionsRepo {
"To": Utils.appState.getAuthenticatedUser()!.emailAddress,
"SetupID": prescriptionsResponseModel.setupID,
"IsDownload": true,
"isDentalAllowedBackend": false,
};
try {

@ -18,6 +18,7 @@ import 'package:hmg_patient_app_new/routes/app_routes.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart';
import 'package:hmg_patient_app_new/services/navigation_service.dart';
import 'package:hmg_patient_app_new/services/notification_service.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
class WaterMonitorViewModel extends ChangeNotifier {
WaterMonitorRepo waterMonitorRepo;
@ -277,7 +278,7 @@ class WaterMonitorViewModel extends ChangeNotifier {
}
}
Future<void> fetchUserDetailsForMonitoring() async {
Future<void> fetchUserDetailsForMonitoring({Function(dynamic)? onSuccess, Function(String)? onError}) async {
try {
_isLoading = true;
@ -287,14 +288,21 @@ class WaterMonitorViewModel extends ChangeNotifier {
if (authenticated == null) {
_isLoading = false;
notifyListeners();
if (onError != null) onError('User not authenticated');
return;
}
final mobile = (authenticated.mobileNumber ?? '').replaceAll('+', '');
final identification = authenticated.patientIdentificationNo ?? '';
final result = await waterMonitorRepo.getUserDetailsForWaterMonitoring(progress: 1, mobileNumber: mobile, identificationNo: identification);
final result = await waterMonitorRepo.getUserDetailsForWaterMonitoring(
progress: 1,
mobileNumber: mobile,
identificationNo: identification,
);
result.fold((failure) {
_userDetailData = null;
if (onError != null) onError(failure.message);
}, (apiModel) {
_userDetailData = apiModel.data;
@ -302,9 +310,12 @@ class WaterMonitorViewModel extends ChangeNotifier {
if (_userDetailData != null) {
_populateFormFields(_userDetailData);
}
if (onSuccess != null) onSuccess(_userDetailData);
});
} catch (e) {
_userDetailData = null;
if (onError != null) onError(e.toString());
} finally {
_isLoading = false;
notifyListeners();
@ -424,6 +435,48 @@ class WaterMonitorViewModel extends ChangeNotifier {
}
}
/// Populate form fields from authenticated user data (for new users)
void populateFromAuthenticatedUser() {
try {
final authenticated = _appState.getAuthenticatedUser();
if (authenticated == null) return;
// Name - use firstName if available
if (authenticated.firstName != null && authenticated.firstName!.isNotEmpty) {
nameController.text = authenticated.firstName!;
}
// Gender - map from patient gender
if (authenticated.gender != null) {
final gender = (authenticated.gender == 1 ? 'male' : 'female').toLowerCase();
if (gender.contains('m') || gender == 'male') {
_selectedGender = 'Male';
} else if (gender.contains('f') || gender == 'female') {
_selectedGender = 'Female';
}
}
// Age - calculate from DOB if available
if (authenticated.dateofBirth != null && authenticated.dateofBirth!.isNotEmpty) {
final age = _calculateAgeFromDOB(authenticated.dateofBirth!);
if (age > 0) {
ageController.text = age.toString();
}
}
// Set default units and activity level
_selectedHeightUnit = 'cm';
_selectedWeightUnit = 'kg';
_selectedActivityLevel = 'Lightly active';
_selectedNumberOfReminders = '3 Time';
log('Form fields populated from authenticated user: ${authenticated.firstName}');
notifyListeners();
} catch (e) {
log('Error populating from authenticated user: $e');
}
}
// Reset all fields to default
void resetFields() {
nameController.clear();
@ -755,15 +808,15 @@ class WaterMonitorViewModel extends ChangeNotifier {
final percent = progressPercent;
if (percent >= 90) {
return const Color(0xFF00C853); // Dark Green
return AppColors.successColor; // Dark Green
} else if (percent >= 70) {
return const Color(0xFF4CAF50); // Green
return AppColors.successColor; // Green
} else if (percent >= 50) {
return const Color(0xFFFFC107); // Amber
return AppColors.warningColorYellow; //orange
} else if (percent >= 30) {
return const Color(0xFFFF9800); // Orange
return AppColors.warningColorYellow; // Orange
} else {
return const Color(0xFFF44336); // Red
return AppColors.errorColor; // Red
}
}

@ -246,7 +246,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
],
),
SizedBox(height: 8.h),
Wrap(
bookAppointmentsViewModel.appointmentNearestGateResponseModel != null ? Wrap(
direction: Axis.horizontal,
spacing: 8.w,
runSpacing: 8.h,
@ -261,7 +261,7 @@ class _AppointmentDetailsPageState extends State<AppointmentDetailsPage> {
"Nearest Gate: ${getIt.get<AppState>().isArabic() ? bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumberN : bookAppointmentsVM.appointmentNearestGateResponseModel!.nearestGateNumber}")
.toShimmer2(isShow: bookAppointmentsVM.isAppointmentNearestGateLoading),
],
),
) : SizedBox.shrink(),
],
),
),

@ -179,7 +179,13 @@ class AppointmentCard extends StatelessWidget {
? '${patientAppointmentHistoryResponseModel.clinicName!.substring(0, 12)}...'
: patientAppointmentHistoryResponseModel.clinicName!),
).toShimmer2(isShow: isLoading),
AppCustomChipWidget(labelText: isLoading ? 'Olaya' : patientAppointmentHistoryResponseModel.projectName!).toShimmer2(isShow: isLoading),
AppCustomChipWidget(
labelText: isLoading
? 'Olaya'
: patientAppointmentHistoryResponseModel.projectName!.length > 15
? '${patientAppointmentHistoryResponseModel.projectName!.substring(0, 12)}...'
: patientAppointmentHistoryResponseModel.projectName!)
.toShimmer2(isShow: isLoading),
AppCustomChipWidget(
labelPadding: EdgeInsetsDirectional.only(start: -4.w, end: 6.w),
icon: AppAssets.appointment_calendar_icon,

@ -6,12 +6,14 @@ import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/app_export.dart';
import 'package:hmg_patient_app_new/core/enums.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/route_extensions.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/blood_donation/blood_donation_view_model.dart';
import 'package:hmg_patient_app_new/features/habib_wallet/habib_wallet_view_model.dart';
import 'package:hmg_patient_app_new/features/hmg_services/models/ui_models/hmg_services_component_model.dart';
import 'package:hmg_patient_app_new/features/medical_file/medical_file_view_model.dart';
import 'package:hmg_patient_app_new/features/water_monitor/water_monitor_view_model.dart';
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
import 'package:hmg_patient_app_new/presentation/blood_donation/blood_donation_page.dart';
import 'package:hmg_patient_app_new/presentation/contact_us/contact_us.dart';
@ -87,12 +89,12 @@ class ServicesPage extends StatelessWidget {
LoaderBottomSheet.showLoader(loadingText: "Fetching Data...");
await bloodDonationViewModel.getRegionSelectedClinics(onSuccess: (val) async {
// await bloodDonationViewModel.getPatientBloodGroupDetails(onSuccess: (val) {
LoaderBottomSheet.hideLoader();
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: BloodDonationPage(),
),
);
LoaderBottomSheet.hideLoader();
Navigator.of(GetIt.instance<NavigationService>().navigatorKey.currentContext!).push(
CustomPageRoute(
page: BloodDonationPage(),
),
);
// }, onError: (err) {
// LoaderBottomSheet.hideLoader();
// });
@ -153,7 +155,27 @@ class ServicesPage extends StatelessWidget {
AppAssets.daily_water_monitor_icon,
bgColor: AppColors.whiteColor,
true,
route: AppRoutes.waterConsumptionScreen,
route: null, // Set to null since we handle navigation in onTap
onTap: () async {
LoaderBottomSheet.showLoader(loadingText: "Fetching your water intake details.".needTranslation);
final waterMonitorVM = getIt.get<WaterMonitorViewModel>();
final context = getIt.get<NavigationService>().navigatorKey.currentContext!;
await waterMonitorVM.fetchUserDetailsForMonitoring(
onSuccess: (userDetail) {
LoaderBottomSheet.hideLoader();
if (userDetail == null) {
waterMonitorVM.populateFromAuthenticatedUser();
context.navigateWithName(AppRoutes.waterMonitorSettingsScreen);
} else {
context.navigateWithName(AppRoutes.waterConsumptionScreen);
}
},
onError: (error) {
LoaderBottomSheet.hideLoader();
context.navigateWithName(AppRoutes.waterConsumptionScreen);
},
);
},
),
HmgServicesComponentModel(
11,

@ -146,7 +146,7 @@ class InsuranceApprovalDetailsPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
"${LocaleKeys.usageStatus.tr(context: context)}: ".toText14(isBold: true),
insuranceApprovalResponseModel.apporvalDetails!.isInvoicedDesc!.toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
(insuranceApprovalResponseModel.apporvalDetails!.isInvoicedDesc ?? "").toText12(fontWeight: FontWeight.w500, color: AppColors.greyTextColor),
],
),
],

@ -48,8 +48,9 @@ class PatientInsuranceCard extends StatelessWidget {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true),
"Policy: ${insuranceCardDetailsModel.insurancePolicyNo}".toText12(isBold: true, color: AppColors.lightGrayColor),
SizedBox(
width: MediaQuery.of(context).size.width * 0.45, child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}".toText18(isBold: true)),
"Policy: ${insuranceCardDetailsModel.insurancePolicyNo}".needTranslation.toText12(isBold: true, color: AppColors.lightGrayColor),
],
),
AppCustomChipWidget(

@ -208,8 +208,11 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}"
.toText18(isBold: true, weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 1),
SizedBox(
width: MediaQuery.of(context).size.width * 0.6,
child: "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}"
.toText18(isBold: true, weight: FontWeight.w600, textOverflow: TextOverflow.ellipsis, maxlines: 2),
),
SizedBox(height: 4.h),
Wrap(
direction: Axis.horizontal,

@ -84,7 +84,7 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
// ),
// ],
// ).paddingSymmetrical(24.h, 0.h),
SizedBox(height: 20.h),
SizedBox(height: 8.h),
Row(
children: [
CustomButton(
@ -162,7 +162,7 @@ class _MedicalReportsPageState extends State<MedicalReportsPage> {
patientMedicalReportResponseModel: PatientMedicalReportResponseModel(),
medicalFileViewModel: medicalFileVM,
isLoading: true,
).paddingSymmetrical(24.h, 8.h)
).paddingSymmetrical(0.h, 8.h)
: medicalFileViewModel.patientMedicalReportList.isNotEmpty
? AnimationConfiguration.staggeredList(
position: index,

@ -219,7 +219,15 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported!
? LocaleKeys.resendOrder.tr(context: context)
: LocaleKeys.prescriptionDeliveryError.tr(context: context),
onPressed: () {},
onPressed: () async {
if (widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported!) {
LoaderBottomSheet.showLoader(loadingText: "Fetching prescription details...".needTranslation);
await prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel, onSuccess: (val) {
LoaderBottomSheet.hideLoader();
prescriptionsViewModel.initiatePrescriptionDelivery();
});
}
},
backgroundColor: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.successColor : AppColors.greyF7Color,
borderColor: AppColors.successColor.withOpacity(0.01),
textColor:

@ -126,14 +126,27 @@ class _WaterConsumptionScreenState extends State<WaterConsumptionScreen> {
),
SizedBox(width: 8.w),
InkWell(
onTap: () => _showHistoryDurationBottomsheet(context, viewModel),
child: Utils.buildSvgWithAssets(icon: AppAssets.doctor_calendar_icon, height: 24.h, width: 24.h))
onTap: () => _showHistoryDurationBottomsheet(context, viewModel),
child: Container(
padding: EdgeInsets.symmetric(vertical: 6.h, horizontal: 6.h),
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
backgroundColor: AppColors.greyColor,
borderRadius: 8.r,
hasShadow: true,
),
child: Row(
children: [
viewModel.selectedDurationFilter.toText12(fontWeight: FontWeight.w500),
Utils.buildSvgWithAssets(icon: AppAssets.arrow_down),
],
),
),
)
],
),
],
),
SizedBox(height: 12.h),
if (!viewModel.isGraphView) _buildHistoryListView(viewModel) else _buildHistoryGraph()
if (!viewModel.isGraphView) _buildHistoryListView(viewModel) else ...[SizedBox(height: 16.h), _buildHistoryGraph()]
],
);
}),
@ -450,6 +463,7 @@ class _WaterConsumptionScreenState extends State<WaterConsumptionScreen> {
showGridLines: true,
maxY: maxY,
minY: minY,
showLinePoints: true,
maxX: dataPoints.length > 1 ? dataPoints.length.toDouble() - 0.75 : 1.0,
horizontalInterval: horizontalInterval,
leftLabelInterval: leftLabelInterval,
@ -515,7 +529,7 @@ class _WaterConsumptionScreenState extends State<WaterConsumptionScreen> {
// For daily, show all 7 time labels (last 7 entries)
if (selectedDuration == 'Daily' && index < 7) {
return Padding(
padding: EdgeInsets.only(top: 5.h),
padding: EdgeInsets.only(top: 10.h),
child: data[index].label.toText8(
fontWeight: FontWeight.w600,
color: AppColors.labelTextColor,
@ -526,7 +540,7 @@ class _WaterConsumptionScreenState extends State<WaterConsumptionScreen> {
// For weekly, show all 7 days (today + last 6 days)
if (selectedDuration == 'Weekly' && index < 7) {
return Padding(
padding: EdgeInsets.only(top: 5.h),
padding: EdgeInsets.only(top: 10.h),
child: data[index].label.toText10(
weight: FontWeight.w600,
color: AppColors.labelTextColor,
@ -537,11 +551,8 @@ class _WaterConsumptionScreenState extends State<WaterConsumptionScreen> {
// For monthly, show all 7 months (current month + last 6 months)
if (selectedDuration == 'Monthly' && index < 7) {
return Padding(
padding: EdgeInsets.only(top: 5.h),
child: data[index].label.toText10(
weight: FontWeight.w600,
color: AppColors.labelTextColor,
),
padding: EdgeInsets.only(top: 10.h),
child: data[index].label.toText10(weight: FontWeight.w600, color: AppColors.labelTextColor),
);
}

@ -142,10 +142,10 @@ class _WaterMonitorSettingsScreenState extends State<WaterMonitorSettingsScreen>
}
// Reusable method to build text field
Widget _buildTextField(TextEditingController controller, String hintText) {
Widget _buildTextField(TextEditingController controller, String hintText, {TextInputType keyboardType = TextInputType.name}) {
return TextField(
controller: controller,
keyboardType: TextInputType.number,
keyboardType: keyboardType,
maxLines: 1,
cursorHeight: 14.h,
textAlignVertical: TextAlignVertical.center,
@ -293,19 +293,31 @@ class _WaterMonitorSettingsScreenState extends State<WaterMonitorSettingsScreen>
_buildSettingsRow(
icon: AppAssets.calendarGrey,
label: "Age (11-120) yrs".needTranslation,
inputField: _buildTextField(viewModel.ageController, '20'),
inputField: _buildTextField(
viewModel.ageController,
'20',
keyboardType: TextInputType.number,
),
),
_buildSettingsRow(
icon: AppAssets.heightIcon,
label: "Height".needTranslation,
inputField: _buildTextField(viewModel.heightController, '175'),
inputField: _buildTextField(
viewModel.heightController,
'175',
keyboardType: TextInputType.number,
),
unit: viewModel.selectedHeightUnit,
onUnitTap: () => _showHeightUnitSelectionBottomSheet(context, viewModel),
),
_buildSettingsRow(
icon: AppAssets.weightScaleIcon,
label: "Weight".needTranslation,
inputField: _buildTextField(viewModel.weightController, '75'),
inputField: _buildTextField(
viewModel.weightController,
'75',
keyboardType: TextInputType.number,
),
unit: viewModel.selectedWeightUnit,
onUnitTap: () => _showWeightUnitSelectionBottomsheet(context, viewModel),
),

@ -313,6 +313,7 @@ class _CustomizeCupBottomSheetState extends State<CustomizeCupBottomSheet> {
viewModel.selectCup(newCup.id);
Navigator.pop(context);
Navigator.pop(context);
},
backgroundColor: AppColors.primaryRedColor,
textColor: AppColors.whiteColor,

@ -17,6 +17,8 @@ class WaterActionButtonsWidget extends StatelessWidget {
Widget build(BuildContext context) {
return Consumer<WaterMonitorViewModel>(builder: (context, vm, _) {
final cupAmount = vm.selectedCupCapacityMl;
final isGoalAchieved = vm.progressPercent >= 100 || vm.nextDrinkTime.toLowerCase().contains('goal achieved');
return Column(
children: [
Row(
@ -48,16 +50,21 @@ class WaterActionButtonsWidget extends StatelessWidget {
color: AppColors.whiteColor,
),
),
InkWell(
onTap: () async {
if (cupAmount > 0) {
await vm.insertUserActivity(quantityIntake: cupAmount);
}
},
child: Utils.buildSvgWithAssets(
icon: AppAssets.addIconDark,
height: 20.h,
width: 20.h,
Opacity(
opacity: isGoalAchieved ? 0.4 : 1.0,
child: InkWell(
onTap: isGoalAchieved
? null
: () async {
if (cupAmount > 0) {
await vm.insertUserActivity(quantityIntake: cupAmount);
}
},
child: Utils.buildSvgWithAssets(
icon: AppAssets.addIconDark,
height: 20.h,
width: 20.h,
),
),
),
],
@ -75,29 +82,7 @@ class WaterActionButtonsWidget extends StatelessWidget {
),
_buildActionButton(
context: context,
onTap: () async {
final success = await vm.scheduleTestNotification();
if (success) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Test notification will appear in 5 seconds!'.needTranslation),
backgroundColor: AppColors.blueColor,
behavior: SnackBarBehavior.floating,
margin: EdgeInsets.all(16.w),
duration: const Duration(seconds: 2),
),
);
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Failed to schedule test notification'.needTranslation),
backgroundColor: AppColors.errorColor,
behavior: SnackBarBehavior.floating,
margin: EdgeInsets.all(16.w),
),
);
}
},
onTap: () async {},
title: "Plain Water".needTranslation,
icon: Utils.buildSvgWithAssets(icon: AppAssets.glassIcon, height: 24.w, width: 24.w),
),

@ -47,8 +47,19 @@ class WaterIntakeSummaryWidget extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
"Next Drink Time".needTranslation.toText18(weight: FontWeight.w600, color: AppColors.textColor),
vm.nextDrinkTime.toText32(weight: FontWeight.w600, color: AppColors.blueColor),
// Don't show label if goal is achieved
if (!vm.nextDrinkTime.toLowerCase().contains('goal achieved'))
// Show "Tomorrow" if nextDrinkTime contains "tomorrow", otherwise "Next Drink Time"
(vm.nextDrinkTime.toLowerCase().contains('tomorrow') ? "Tomorrow" : "Next Drink Time")
.needTranslation
.toText18(weight: FontWeight.w600, color: AppColors.textColor),
// Extract only time if "tomorrow" is present, otherwise show as is
(vm.nextDrinkTime.toLowerCase().contains('tomorrow')
? vm.nextDrinkTime.replaceAll(RegExp(r'tomorrow', caseSensitive: false), '').trim()
: vm.nextDrinkTime)
.toText32(weight: FontWeight.w600, color: AppColors.blueColor),
SizedBox(height: 12.h),
_buildStatusColumn(title: "Your Goal".needTranslation, subTitle: "${goalMl}ml"),
SizedBox(height: 8.h),

@ -78,7 +78,7 @@ class AppCustomChipWidget extends StatelessWidget {
fit: BoxFit.contain,
)
: SizedBox.shrink(),
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
label: richText ?? (labelText?? "").toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor),
padding: padding,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
labelPadding: labelPadding ?? EdgeInsetsDirectional.only(end: deleteIcon?.isNotEmpty == true ? 2.w : 8.w),
@ -104,7 +104,7 @@ class AppCustomChipWidget extends StatelessWidget {
)
: Chip(
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
label: richText ?? labelText!.toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor, isCenter: true),
label: richText ?? (labelText?? "").toText10(weight: FontWeight.w500, letterSpacing: 0, color: textColor, isCenter: true),
padding: EdgeInsets.zero,
backgroundColor: backgroundColor,
shape: shape ??

@ -63,6 +63,7 @@ class CustomGraph extends StatelessWidget {
final double? horizontalInterval;
final double? minY;
final bool showShadow;
final bool showLinePoints;
final double? cutOffY;
final RangeAnnotations? rangeAnnotations;
@ -104,6 +105,7 @@ class CustomGraph extends StatelessWidget {
this.horizontalInterval,
this.minY,
this.showShadow = false,
this.showLinePoints = false,
this.cutOffY = 0,
this.rangeAnnotations});
@ -195,7 +197,7 @@ class CustomGraph extends StatelessWidget {
top: BorderSide.none,
),
),
lineBarsData: _buildColoredLineSegments(dataPoints),
lineBarsData: _buildColoredLineSegments(dataPoints, showLinePoints),
gridData: FlGridData(
show: showGridLines ?? true,
drawVerticalLine: false,
@ -217,7 +219,7 @@ class CustomGraph extends StatelessWidget {
);
}
List<LineChartBarData> _buildColoredLineSegments(List<DataPoint> dataPoints) {
List<LineChartBarData> _buildColoredLineSegments(List<DataPoint> dataPoints, bool showLinePoints) {
final List<FlSpot> allSpots = dataPoints.asMap().entries.map((entry) {
double value = (makeGraphBasedOnActualValue) ? double.tryParse(entry.value.actualValue) ?? 0.0 : entry.value.value;
return FlSpot(entry.key.toDouble(), value);
@ -235,9 +237,7 @@ class CustomGraph extends StatelessWidget {
begin: Alignment.centerLeft,
end: Alignment.centerRight,
),
dotData: FlDotData(
show: false,
),
dotData: FlDotData(show: showLinePoints),
belowBarData: BarAreaData(
show: showShadow,
applyCutOffY: cutOffY != null,

Loading…
Cancel
Save