Explorar el Código

force custom routeBuilder while showing DetailPage

Neeraj Gupta hace 3 años
padre
commit
8777dfb77d

+ 1 - 0
lib/ui/deduplicate_page.dart

@@ -378,6 +378,7 @@ class _DeduplicatePageState extends State<DeduplicatePage> {
               mode: DetailPageMode.minimalistic,
             ),
           ),
+          forceCustomPageRoute: true,
         );
       },
       child: Container(

+ 1 - 1
lib/ui/huge_listview/lazy_loading_gallery.dart

@@ -367,6 +367,6 @@ class _LazyLoadingGridViewState extends State<LazyLoadingGridView> {
         widget.tag,
       ),
     );
-    routeToPage(context, page);
+    routeToPage(context, page, forceCustomPageRoute: true);
   }
 }

+ 6 - 2
lib/utils/navigation_util.dart

@@ -2,8 +2,12 @@ import 'dart:io';
 
 import 'package:flutter/material.dart';
 
-Future<T> routeToPage<T extends Object>(BuildContext context, Widget page) {
-  if (Platform.isAndroid) {
+Future<T> routeToPage<T extends Object>(
+  BuildContext context,
+  Widget page, {
+  bool forceCustomPageRoute = false,
+}) {
+  if (Platform.isAndroid || forceCustomPageRoute) {
     return Navigator.of(context).push(
       _buildPageRoute(page),
     );