diff --git a/lib/util/goto.dart b/lib/util/goto.dart index f46c7a7..685a21b 100644 --- a/lib/util/goto.dart +++ b/lib/util/goto.dart @@ -1,9 +1,11 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:page_transition/page_transition.dart'; import '../pages/community.dart'; import '../pages/full_post.dart'; import '../pages/instance.dart'; +import '../pages/media_view.dart'; import '../pages/user.dart'; /// Pushes onto the navigator stack the given widget @@ -59,3 +61,10 @@ abstract class goToUser { void goToPost(BuildContext context, String instanceUrl, int postId) => goTo( context, (context) => FullPostPage(instanceUrl: instanceUrl, id: postId)); + +void goToMedia(BuildContext context, String url) => Navigator.push( + context, + PageTransition( + type: PageTransitionType.fade, + child: MediaViewPage(url), + )); diff --git a/lib/widgets/fullscreenable_image.dart b/lib/widgets/fullscreenable_image.dart index 6aedf8e..049a0ce 100644 --- a/lib/widgets/fullscreenable_image.dart +++ b/lib/widgets/fullscreenable_image.dart @@ -16,7 +16,7 @@ class FullscreenableImage extends StatelessWidget { }) : super(key: key); _onTap(BuildContext c) { - goTo(c, (context) => MediaViewPage(url)); + goToMedia(c, url); } @override diff --git a/pubspec.lock b/pubspec.lock index 3022e63..994e06f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -28,14 +28,14 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.1" build: dependency: transitive description: @@ -105,14 +105,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.2.0-nullsafety.1" checked_yaml: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.1.0-nullsafety.1" code_builder: dependency: transitive description: @@ -147,7 +147,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.13" + version: "1.15.0-nullsafety.3" convert: dependency: transitive description: @@ -203,7 +203,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.1" ffi: dependency: transitive description: @@ -400,14 +400,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.8" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -471,13 +471,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.4.3" + page_transition: + dependency: "direct main" + description: + name: page_transition + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.7+2" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0-nullsafety.1" path_provider: dependency: transitive description: @@ -664,7 +671,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0-nullsafety.2" sqflite: dependency: transitive description: @@ -685,14 +692,14 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.1" stream_transform: dependency: transitive description: @@ -706,7 +713,7 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.0-nullsafety.1" synchronized: dependency: transitive description: @@ -720,14 +727,14 @@ packages: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.17" + version: "0.2.19-nullsafety.2" timeago: dependency: "direct main" description: @@ -748,7 +755,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0-nullsafety.3" url_launcher: dependency: "direct main" description: @@ -804,7 +811,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.3" watcher: dependency: transitive description: @@ -841,5 +848,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.9.0 <3.0.0" + dart: ">=2.10.0-110 <2.11.0" flutter: ">=1.20.0 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 18a80ae..82bd97f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -18,10 +18,11 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 0.1.0 environment: - sdk: '>=2.7.0 <3.0.0' + sdk: ">=2.7.0 <3.0.0" dependencies: # widgets + page_transition: "^1.1.7+2" flutter_speed_dial: ^1.2.5 flutter_slidable: ^0.5.7 photo_view: ^0.10.2 @@ -32,7 +33,7 @@ dependencies: # native esys_flutter_share: ^1.0.2 url_launcher: ^5.5.1 - shared_preferences: '>=0.5.0 <2.0.0' + shared_preferences: ">=0.5.0 <2.0.0" package_info: ^0.4.3 # state management