Fix swipe to go back interaction for iOS

This commit is contained in:
Neeraj Gupta 2022-06-20 15:20:03 +05:30
parent 480fe878c0
commit 6a884b7bd0
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -1,9 +1,21 @@
import 'dart:io';
import 'package:flutter/material.dart';
Future<T> routeToPage<T extends Object>(BuildContext context, Widget page) {
return Navigator.of(context).push(
_buildPageRoute(page),
);
if (Platform.isAndroid) {
return Navigator.of(context).push(
_buildPageRoute(page),
);
} else {
return Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return page;
},
),
);
}
}
void replacePage(BuildContext context, Widget page) {