packages upgrade

This commit is contained in:
Thibault Deckers 2020-01-08 09:36:22 +09:00
parent 7fa23f66b2
commit 286eeeb80e
2 changed files with 45 additions and 49 deletions

View file

@ -6,7 +6,6 @@ import 'package:aves/widgets/fullscreen/video.dart';
import 'package:flutter/material.dart';
import 'package:photo_view/photo_view.dart';
import 'package:photo_view/photo_view_gallery.dart';
import 'package:provider/provider.dart';
import 'package:tuple/tuple.dart';
import 'package:video_player/video_player.dart';
@ -37,54 +36,51 @@ class ImagePageState extends State<ImagePage> with AutomaticKeepAliveClientMixin
@override
Widget build(BuildContext context) {
super.build(context);
return Selector<MediaQueryData, Size>(
selector: (c, mq) => mq.size,
builder: (c, mqSize, child) => PhotoViewGallery.builder(
itemCount: entries.length,
builder: (context, index) {
final entry = entries[index];
if (entry.isVideo) {
final videoController = widget.videoControllers.firstWhere((kv) => kv.item1 == entry.path, orElse: () => null)?.item2;
return PhotoViewGalleryPageOptions.customChild(
child: videoController != null
? AvesVideo(
entry: entry,
controller: videoController,
)
: const SizedBox(),
childSize: mqSize,
// no hero as most videos fullscreen image is different from its thumbnail
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
onTapUp: (tapContext, details, value) => widget.onTap?.call(),
);
}
return PhotoViewGalleryPageOptions(
imageProvider: FileImage(File(entry.path)),
heroAttributes: PhotoViewHeroAttributes(
tag: entry.uri,
transitionOnUserGestures: true,
),
return PhotoViewGallery.builder(
itemCount: entries.length,
builder: (context, index) {
final entry = entries[index];
if (entry.isVideo) {
final videoController = widget.videoControllers.firstWhere((kv) => kv.item1 == entry.path, orElse: () => null)?.item2;
return PhotoViewGalleryPageOptions.customChild(
child: videoController != null
? AvesVideo(
entry: entry,
controller: videoController,
)
: const SizedBox(),
// no hero as most videos fullscreen image is different from its thumbnail
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
onTapUp: (tapContext, details, value) => widget.onTap?.call(),
);
},
loadingChild: const Center(
child: SizedBox(
width: 64,
height: 64,
child: CircularProgressIndicator(
strokeWidth: 2,
),
}
return PhotoViewGalleryPageOptions(
imageProvider: FileImage(File(entry.path)),
heroAttributes: PhotoViewHeroAttributes(
tag: entry.uri,
transitionOnUserGestures: true,
),
minScale: PhotoViewComputedScale.contained,
initialScale: PhotoViewComputedScale.contained,
onTapUp: (tapContext, details, value) => widget.onTap?.call(),
filterQuality: FilterQuality.low,
);
},
loadingChild: const Center(
child: SizedBox(
width: 64,
height: 64,
child: CircularProgressIndicator(
strokeWidth: 2,
),
),
backgroundDecoration: BoxDecoration(color: Colors.transparent),
pageController: widget.pageController,
onPageChanged: widget.onPageChanged,
scaleStateChangedCallback: widget.onScaleChanged,
scrollPhysics: const BouncingScrollPhysics(),
),
backgroundDecoration: BoxDecoration(color: Colors.transparent),
pageController: widget.pageController,
onPageChanged: widget.onPageChanged,
scaleStateChangedCallback: widget.onScaleChanged,
scrollPhysics: const BouncingScrollPhysics(),
);
}

View file

@ -35,7 +35,7 @@ packages:
name: barcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.5.0"
boolean_selector:
dependency: transitive
description:
@ -159,14 +159,14 @@ packages:
name: intl
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.0"
version: "0.16.1"
logger:
dependency: "direct main"
description:
name: logger
url: "https://pub.dartlang.org"
source: hosted
version: "0.8.1"
version: "0.8.2"
matcher:
dependency: transitive
description:
@ -222,7 +222,7 @@ packages:
name: pdf
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.29"
version: "1.4.0"
pedantic:
dependency: "direct main"
description:
@ -250,7 +250,7 @@ packages:
name: photo_view
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.0"
version: "0.9.1"
printing:
dependency: "direct main"
description:
@ -416,7 +416,7 @@ packages:
name: video_player
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.5"
version: "0.10.5+1"
video_player_platform_interface:
dependency: transitive
description:
@ -439,5 +439,5 @@ packages:
source: hosted
version: "3.5.0"
sdks:
dart: ">=2.6.0 <3.0.0"
dart: ">=2.7.0 <3.0.0"
flutter: ">=1.12.13+hotfix.4 <2.0.0"