add swipe patient manager
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'package:flutter_swipe_detector/flutter_swipe_detector.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -645,16 +646,34 @@ class _PatientManagerState extends State<PatientManager> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
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 {},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user