packages upgrade and minor changes
This commit is contained in:
parent
1a997be925
commit
d2918a29c8
6 changed files with 16 additions and 27 deletions
|
@ -12,10 +12,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
void main() async {
|
||||
await settings.init();
|
||||
await androidFileUtils.init();
|
||||
await IconUtils.init();
|
||||
void main() {
|
||||
runApp(AvesApp());
|
||||
}
|
||||
|
||||
|
@ -51,11 +48,7 @@ class HomePage extends StatefulWidget {
|
|||
class _HomePageState extends State<HomePage> {
|
||||
static const EventChannel eventChannel = EventChannel('deckers.thibault/aves/mediastore');
|
||||
|
||||
ImageCollection localMediaCollection = ImageCollection(
|
||||
entries: List(),
|
||||
groupFactor: settings.collectionGroupFactor,
|
||||
sortFactor: settings.collectionSortFactor,
|
||||
);
|
||||
ImageCollection localMediaCollection = ImageCollection(entries: List());
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -65,6 +58,12 @@ class _HomePageState extends State<HomePage> {
|
|||
}
|
||||
|
||||
setup() async {
|
||||
await androidFileUtils.init();
|
||||
await IconUtils.init();
|
||||
await settings.init();
|
||||
localMediaCollection.groupFactor = settings.collectionGroupFactor;
|
||||
localMediaCollection.sortFactor = settings.collectionSortFactor;
|
||||
|
||||
final permissions = await PermissionHandler().requestPermissions([PermissionGroup.storage]);
|
||||
if (permissions[PermissionGroup.storage] != PermissionStatus.granted) {
|
||||
SystemNavigator.pop();
|
||||
|
|
|
@ -15,8 +15,8 @@ class ImageCollection with ChangeNotifier {
|
|||
|
||||
ImageCollection({
|
||||
@required List<ImageEntry> entries,
|
||||
@required this.groupFactor,
|
||||
@required this.sortFactor,
|
||||
this.groupFactor,
|
||||
this.sortFactor,
|
||||
}) : _rawEntries = entries {
|
||||
updateSections();
|
||||
}
|
||||
|
|
|
@ -2,8 +2,6 @@ import 'package:path/path.dart';
|
|||
|
||||
final AndroidFileUtils androidFileUtils = AndroidFileUtils._private();
|
||||
|
||||
typedef void AndroidFileUtilsCallback(String key, dynamic oldValue, dynamic newValue);
|
||||
|
||||
class AndroidFileUtils {
|
||||
String externalStorage, dcimPath, downloadPath, picturesPath;
|
||||
|
||||
|
|
|
@ -385,7 +385,10 @@ class ImagePageState extends State<ImagePage> with AutomaticKeepAliveClientMixin
|
|||
}
|
||||
return PhotoViewGalleryPageOptions(
|
||||
imageProvider: FileImage(File(entry.path)),
|
||||
heroTag: entry.uri,
|
||||
heroAttributes: PhotoViewHeroAttributes(
|
||||
tag: entry.uri,
|
||||
transitionOnUserGestures: true,
|
||||
),
|
||||
minScale: PhotoViewComputedScale.contained,
|
||||
initialScale: PhotoViewComputedScale.contained,
|
||||
onTapUp: (tapContext, details, value) => widget.onTap?.call(),
|
||||
|
@ -397,7 +400,6 @@ class ImagePageState extends State<ImagePage> with AutomaticKeepAliveClientMixin
|
|||
pageController: widget.pageController,
|
||||
onPageChanged: widget.onPageChanged,
|
||||
scaleStateChangedCallback: widget.onScaleChanged,
|
||||
transitionOnUserGestures: true,
|
||||
scrollPhysics: BouncingScrollPhysics(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
after_layout:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: after_layout
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.7+2"
|
||||
archive:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -199,7 +192,7 @@ packages:
|
|||
name: photo_view
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.2"
|
||||
version: "0.5.0"
|
||||
printing:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
@ -13,13 +13,10 @@ description: A new Flutter application.
|
|||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
chewie:
|
||||
chewie: 0.9.7
|
||||
collection:
|
||||
flushbar:
|
||||
flutter_sticky_header:
|
||||
|
|
Loading…
Reference in a new issue