diff --git a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_view.dart b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_view.dart index 4e938bf6..4bea1d15 100644 --- a/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_view.dart +++ b/Frontend/patient_manager/lib/mih_packages/patient_profile/patient_view.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:flutter_swipe_detector/flutter_swipe_detector.dart'; import 'package:patient_manager/mih_packages/patient_profile/patient_details.dart'; import 'package:patient_manager/mih_packages/patient_profile/patient_files.dart'; import 'package:patient_manager/mih_packages/patient_profile/patient_notes.dart'; @@ -244,16 +245,34 @@ class _PatientViewState extends State { height = size.height; }); checkScreenSize(); - return MIHLayoutBuilder( - actionButton: getActionButton(), - header: getHeader(), - secondaryActionButton: null, - body: getBody(), - actionDrawer: null, - secondaryActionDrawer: null, - bottomNavBar: null, - pullDownToRefresh: false, - onPullDown: () async {}, + return SwipeDetector( + onSwipeLeft: (offset) { + if (_selectedIndex < 2) { + setState(() { + _selectedIndex += 1; + }); + } + //print("swipe left"); + }, + onSwipeRight: (offset) { + if (_selectedIndex > 0) { + setState(() { + _selectedIndex -= 1; + }); + } + //print("swipe right"); + }, + child: MIHLayoutBuilder( + actionButton: getActionButton(), + header: getHeader(), + secondaryActionButton: null, + body: getBody(), + actionDrawer: null, + secondaryActionDrawer: null, + bottomNavBar: null, + pullDownToRefresh: false, + onPullDown: () async {}, + ), ); // return Scaffold( // body: SafeArea(