fix swiope, now you can swipe from anywhere
This commit is contained in:
@@ -703,24 +703,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SwipeDetector(
|
||||
onSwipeLeft: (offset) {
|
||||
if (_selectedIndex == 0) {
|
||||
setState(() {
|
||||
_selectedIndex = 1;
|
||||
});
|
||||
}
|
||||
//print("swipe left");
|
||||
},
|
||||
onSwipeRight: (offset) {
|
||||
if (_selectedIndex == 1) {
|
||||
setState(() {
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
}
|
||||
//print("swipe right");
|
||||
},
|
||||
child: GridView.builder(
|
||||
GridView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.only(
|
||||
@@ -738,7 +721,6 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
return searchApp(pbswitch[_selectedIndex], appSearch)[index];
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -886,7 +868,24 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
final double width = size.width;
|
||||
final double height = size.height;
|
||||
|
||||
return MIHLayoutBuilder(
|
||||
return SwipeDetector(
|
||||
onSwipeLeft: (offset) {
|
||||
if (_selectedIndex == 0) {
|
||||
setState(() {
|
||||
_selectedIndex = 1;
|
||||
});
|
||||
}
|
||||
//print("swipe left");
|
||||
},
|
||||
onSwipeRight: (offset) {
|
||||
if (_selectedIndex == 1) {
|
||||
setState(() {
|
||||
_selectedIndex = 0;
|
||||
});
|
||||
}
|
||||
//print("swipe right");
|
||||
},
|
||||
child: MIHLayoutBuilder(
|
||||
actionButton: getActionButton(),
|
||||
header: getHeader(),
|
||||
secondaryActionButton: getSecondaryActionButton(),
|
||||
@@ -896,6 +895,7 @@ class _MIHHomeState extends State<MIHHome> {
|
||||
bottomNavBar: getBottomNavBar(),
|
||||
pullDownToRefresh: true,
|
||||
onPullDown: refreshNotifications,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user