dev_sultan
Sultan khan 12 hours ago
commit b46e73565a

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 11C4 7.13401 7.13401 4 11 4C14.866 4 18 7.13401 18 11C18 14.866 14.866 18 11 18C7.13401 18 4 14.866 4 11ZM11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C13.125 20 15.078 19.2635 16.6177 18.0319L20.2929 21.7071C20.6834 22.0976 21.3166 22.0976 21.7071 21.7071C22.0976 21.3166 22.0976 20.6834 21.7071 20.2929L18.0319 16.6177C19.2635 15.078 20 13.125 20 11C20 6.02944 15.9706 2 11 2Z" fill="#000000"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 14C10 14.5523 10.4477 15 11 15C11.5523 15 12 14.5523 12 14V12H14C14.5523 12 15 11.5523 15 11C15 10.4477 14.5523 10 14 10H12V8C12 7.44772 11.5523 7 11 7C10.4477 7 10 7.44772 10 8V10H8C7.44772 10 7 10.4477 7 11C7 11.5523 7.44772 12 8 12H10V14Z" fill="#000000"/>
</svg>

After

Width:  |  Height:  |  Size: 1004 B

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"><defs><style>.a{fill:none;stroke:#000000;stroke-linejoin:round;}</style></defs><path class="a" d="M34.86,18.63V29.16l8.64,7.16V11.68Z"/><path class="a" d="M6.42,12.31h21.7c3.16,0,6.53,2.53,6.53,5.9V33.37a2.11,2.11,0,0,1-2.1,2.11H10.22c-3.59,0-5.69-3.37-5.69-6.53V14.41A1.83,1.83,0,0,1,6.42,12.31Z"/></svg>

After

Width:  |  Height:  |  Size: 514 B

@ -0,0 +1,26 @@
<?xml version="1.0" ?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<title/>
<g id="Complete">
<g id="zoom-out">
<g>
<circle cx="10.1" cy="10.1" fill="none" r="8" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
<line fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="21.9" x2="16.3" y1="21.9" y2="16.3"/>
<line fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" x1="13.1" x2="7.1" y1="10.1" y2="10.1"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 711 B

@ -47,6 +47,12 @@ class SymptomsCheckerViewModel extends ChangeNotifier {
final Set<String> _selectedOrganIds = {};
bool _isBottomSheetExpanded = false;
// Zoom state
double _currentZoomScale = 1.0;
static const double _minZoomScale = 1.0;
static const double _maxZoomScale = 2.0;
static const double _zoomStep = 1.0;
// Tooltip state
String? _tooltipOrganId;
Timer? _tooltipTimer;
@ -135,6 +141,8 @@ class SymptomsCheckerViewModel extends ChangeNotifier {
String? get tooltipOrganId => _tooltipOrganId;
double get currentZoomScale => _currentZoomScale;
String get currentSessionAuthToken => symptomsUserDetailsResponseModel?.tokenDetails?.authToken ?? "";
String get currentSessionId => symptomsUserDetailsResponseModel?.sessionId ?? "";
@ -231,6 +239,7 @@ class SymptomsCheckerViewModel extends ChangeNotifier {
void toggleView() {
_currentView = _currentView == BodyView.front ? BodyView.back : BodyView.front;
_currentZoomScale = 1.0; // Reset zoom when switching views
notifyListeners();
}
@ -261,6 +270,20 @@ class SymptomsCheckerViewModel extends ChangeNotifier {
notifyListeners();
}
toggleZoomIn() {
if (_currentZoomScale < _maxZoomScale) {
_currentZoomScale = (_currentZoomScale + _zoomStep).clamp(_minZoomScale, _maxZoomScale);
notifyListeners();
}
}
toggleZoomOut(){
if (_currentZoomScale > _minZoomScale) {
_currentZoomScale = (_currentZoomScale - _zoomStep).clamp(_minZoomScale, _maxZoomScale);
notifyListeners();
}
}
void _showTooltip(String organId) {
_tooltipTimer?.cancel();
@ -865,6 +888,7 @@ class SymptomsCheckerViewModel extends ChangeNotifier {
_triageEvidenceList.clear();
_selectedTriageChoicesByItemId.clear();
_triageQuestionCount = 0; // Reset question count
_currentZoomScale = 1.0; // Reset zoom scale
bodySymptomResponse = null;
riskFactorsResponse = null;
suggestionsResponse = null;

@ -80,7 +80,9 @@ class FindUsPage extends StatelessWidget {
contactUsVM.sortHMGLocations(true);
// }
},
onFailure: () {},
onFailure: () {
locationUtils.onFailureDilouge();
},
);
} else {
contactUsVM.sortHMGLocations(false);

@ -80,6 +80,7 @@ class _OrganSelectorPageState extends State<OrganSelectorPage> {
children: [
_buildBodyViewer(viewModel),
_buildViewToggleButtons(viewModel),
_buildViewZoomButtons(viewModel),
_buildBottomSheet(viewModel),
],
),
@ -161,6 +162,7 @@ class _OrganSelectorPageState extends State<OrganSelectorPage> {
isBodyHidden: viewModel.isBodyHidden,
tooltipOrganId: viewModel.tooltipOrganId,
isArabic: _appState.isArabic(),
zoomScale: viewModel.currentZoomScale,
);
},
),
@ -212,6 +214,26 @@ class _OrganSelectorPageState extends State<OrganSelectorPage> {
);
}
Widget _buildViewZoomButtons(SymptomsCheckerViewModel viewModel) {
return PositionedDirectional(
end: 16.w,
top: 36.h,
child: Column(
children: [
_buildToggleButton(
icon: "assets/images/svg/zoom-in.svg",
onTap: viewModel.toggleZoomIn,
),
SizedBox(height: 16.h),
_buildToggleButton(
icon: "assets/images/svg/zoom_out.svg",
onTap: viewModel.toggleZoomOut,
),
],
),
);
}
Widget _buildToggleButton({required String icon, required VoidCallback onTap}) {
return GestureDetector(
onTap: onTap,

@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
import 'package:hmg_patient_app_new/features/symptoms_checker/models/organ_model.dart';
import 'package:hmg_patient_app_new/presentation/symptoms_checker/widgets/organ_dot_widget.dart';
import 'package:hmg_patient_app_new/presentation/symptoms_checker/widgets/organ_tooltip_widget.dart';
import 'package:vector_math/vector_math_64.dart' show Vector3;
class InteractiveBodyWidget extends StatefulWidget {
final String bodyImageAsset;
@ -14,6 +15,7 @@ class InteractiveBodyWidget extends StatefulWidget {
final Function(String organId) onOrganTap;
final String? tooltipOrganId;
final bool isArabic;
final double zoomScale;
const InteractiveBodyWidget({
super.key,
@ -24,6 +26,7 @@ class InteractiveBodyWidget extends StatefulWidget {
this.isBodyHidden = false,
this.tooltipOrganId,
this.isArabic = false,
this.zoomScale = 1.0,
});
@override
@ -48,6 +51,11 @@ class _InteractiveBodyWidgetState extends State<InteractiveBodyWidget> {
// Reset zoom when switching views
_transformationController.value = Matrix4.identity();
}
// Update zoom when zoomScale changes
if (oldWidget.zoomScale != widget.zoomScale) {
_updateZoom(widget.zoomScale);
}
}
@override
@ -69,6 +77,19 @@ class _InteractiveBodyWidgetState extends State<InteractiveBodyWidget> {
}
}
void _updateZoom(double scale) {
// Get current translation
final currentTransform = _transformationController.value;
final currentTranslation = currentTransform.getTranslation();
// Create new transformation with updated scale while preserving translation
final newTransform = Matrix4.identity()
..setTranslation(currentTranslation)
..scaleByVector3(Vector3(scale, scale, 1.0));
_transformationController.value = newTransform;
}
@override
Widget build(BuildContext context) {
if (_imageAspectRatio == null) {

Loading…
Cancel
Save