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