diff --git a/lib/components/image_bubble.dart b/lib/components/image_bubble.dart index 81b1f076..024d1d67 100644 --- a/lib/components/image_bubble.dart +++ b/lib/components/image_bubble.dart @@ -1,5 +1,4 @@ import 'package:famedlysdk/famedlysdk.dart'; -import 'package:fluffychat/utils/app_route.dart'; import 'package:fluffychat/views/image_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter/foundation.dart'; @@ -235,8 +234,8 @@ class _ImageBubbleState extends State { onTap: () { if (!widget.tapToView) return; Navigator.of(context).push( - AppRoute( - ImageView(widget.event, onLoaded: () { + MaterialPageRoute( + builder: (_) => ImageView(widget.event, onLoaded: () { // If the original file didn't load yet, we want to do that now. // This is so that the original file displays after going on the image viewer, // waiting for it to load, and then hitting back. This ensures that we always diff --git a/lib/utils/app_route.dart b/lib/utils/app_route.dart deleted file mode 100644 index a44ebf60..00000000 --- a/lib/utils/app_route.dart +++ /dev/null @@ -1,35 +0,0 @@ -import 'package:adaptive_page_layout/adaptive_page_layout.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class AppRoute extends PageRouteBuilder { - static Route defaultRoute(BuildContext context, Widget page) { - return context != null && - !AdaptivePageLayout.of(context).columnMode(context) - ? CupertinoPageRoute( - builder: (BuildContext context) => page, - ) - : AppRoute(page); - } - - final Widget page; - AppRoute(this.page) - : super( - pageBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - ) => - page, - transitionsBuilder: ( - BuildContext context, - Animation animation, - Animation secondaryAnimation, - Widget child, - ) => - FadeTransition( - opacity: animation, - child: child, - ), - ); -} diff --git a/lib/utils/event_extension.dart b/lib/utils/event_extension.dart index c22e67cc..b75684d9 100644 --- a/lib/utils/event_extension.dart +++ b/lib/utils/event_extension.dart @@ -4,7 +4,6 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_cache_manager/flutter_cache_manager.dart'; import 'matrix_file_extension.dart'; -import 'app_route.dart'; import '../views/image_view.dart'; extension LocalizedBody on Event { @@ -12,9 +11,7 @@ extension LocalizedBody on Event { if (!downloadOnly && [MessageTypes.Image, MessageTypes.Sticker].contains(messageType)) { await Navigator.of(context).push( - AppRoute( - ImageView(this), - ), + MaterialPageRoute(builder: (_) => ImageView(this)), ); return; }