swipe to navigate patient view

This commit is contained in:
2024-11-08 10:22:10 +02:00
parent 09f5e94f00
commit 653f592849

View File

@@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; 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_details.dart';
import 'package:patient_manager/mih_packages/patient_profile/patient_files.dart'; import 'package:patient_manager/mih_packages/patient_profile/patient_files.dart';
import 'package:patient_manager/mih_packages/patient_profile/patient_notes.dart'; import 'package:patient_manager/mih_packages/patient_profile/patient_notes.dart';
@@ -244,16 +245,34 @@ class _PatientViewState extends State<PatientView> {
height = size.height; height = size.height;
}); });
checkScreenSize(); checkScreenSize();
return MIHLayoutBuilder( return SwipeDetector(
actionButton: getActionButton(), onSwipeLeft: (offset) {
header: getHeader(), if (_selectedIndex < 2) {
secondaryActionButton: null, setState(() {
body: getBody(), _selectedIndex += 1;
actionDrawer: null, });
secondaryActionDrawer: null, }
bottomNavBar: null, //print("swipe left");
pullDownToRefresh: false, },
onPullDown: () async {}, 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( // return Scaffold(
// body: SafeArea( // body: SafeArea(