|
@@ -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) {
|