Skip to content

Commit

Permalink
Merge pull request #5 from vuhuynh797/master
Browse files Browse the repository at this point in the history
Fix bug out of range albums
  • Loading branch information
phuongtinhbien authored Sep 23, 2023
2 parents 9416b35 + 4179ae7 commit 9719305
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.album_image_example">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<application
android:label="album_image_example"
Expand Down
6 changes: 3 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.7.21'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
2 changes: 1 addition & 1 deletion lib/src/album_image_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class _AlbumImagePickerState extends State<AlbumImagePicker>

void _getPermission() async {
var result = await PhotoManager.requestPermissionExtend(
requestOption: const PermisstionRequestOption(
requestOption: const PermissionRequestOption(
iosAccessLevel: IosAccessLevel.readWrite));
if (result.isAuth) {
PhotoManager.startChangeNotify();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/controller/gallery_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mixin PhotoDataProvider on ChangeNotifier {
list.sort(sortBy);
pathList.clear();
pathList.addAll(list);
currentPath = list[defaultIndex];
currentPath = list.isNotEmpty ? list[defaultIndex] : null;
pathListNotifier.value = pathList;
notifyListeners();
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment:
dependencies:
flutter:
sdk: flutter
photo_manager: ^2.5.0
photo_manager: ^2.7.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 9719305

Please sign in to comment.