diff --git a/lib/utils/ui_utils.dart b/lib/utils/ui_utils.dart index 905a428..ac3ab4c 100644 --- a/lib/utils/ui_utils.dart +++ b/lib/utils/ui_utils.dart @@ -3,6 +3,7 @@ import 'package:comunic/helpers/preferences_helper.dart'; import 'package:comunic/utils/intl_utils.dart'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; +import 'package:photo_view/photo_view.dart'; /// User interface utilities /// @@ -68,9 +69,8 @@ Widget buildErrorCard(String message, /// Show an image with a given [url] in full screen void showImageFullScreen(BuildContext context, String url) { Navigator.of(context).push(MaterialPageRoute(builder: (c) { - // TODO : add better support later - return CachedNetworkImage( - imageUrl: url, + return PhotoView( + imageProvider: CachedNetworkImageProvider(url), ); })); } diff --git a/pubspec.lock b/pubspec.lock index 9830311..ffcc54d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -212,6 +212,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.4.0" + photo_view: + dependency: "direct main" + description: + name: photo_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.2" pie_chart: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index fe116b9..8103894 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,6 +63,9 @@ dependencies: # Generate random strings random_string: ^2.0.1 + # Display zoomable images + photo_view: ^0.9.2 + dev_dependencies: flutter_test: sdk: flutter