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: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),
);
}));
}

View File

@ -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:

View File

@ -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