1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 12:59:21 +00:00

Can zoom full screen images

This commit is contained in:
Pierre HUBERT 2020-04-17 08:53:46 +02:00
parent 7e01947da9
commit ef9a2c7190
3 changed files with 13 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import 'package:comunic/helpers/preferences_helper.dart';
import 'package:comunic/utils/intl_utils.dart'; import 'package:comunic/utils/intl_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:html/parser.dart'; import 'package:html/parser.dart';
import 'package:photo_view/photo_view.dart';
/// User interface utilities /// User interface utilities
/// ///
@ -68,9 +69,8 @@ Widget buildErrorCard(String message,
/// Show an image with a given [url] in full screen /// Show an image with a given [url] in full screen
void showImageFullScreen(BuildContext context, String url) { void showImageFullScreen(BuildContext context, String url) {
Navigator.of(context).push(MaterialPageRoute(builder: (c) { Navigator.of(context).push(MaterialPageRoute(builder: (c) {
// TODO : add better support later return PhotoView(
return CachedNetworkImage( imageProvider: CachedNetworkImageProvider(url),
imageUrl: url,
); );
})); }));
} }

View File

@ -212,6 +212,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.0" 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: pie_chart:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -63,6 +63,9 @@ dependencies:
# Generate random strings # Generate random strings
random_string: ^2.0.1 random_string: ^2.0.1
# Display zoomable images
photo_view: ^0.9.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter