Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.7.2
* Remove Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions. The previous had bugs.

## 4.7.1
* Remove Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions.

## 4.7.0
* Fix Android compatibility issues after Flutter 3.29.0 upgrade (Thanks to [mufassalhussain](https://github.com/mufassalhussain), PR[#19](https://github.com/javaherisaber/open_filex/pull/19))

Expand Down
4 changes: 0 additions & 4 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<application>
<provider
android:name="com.crazecoder.openfile.FileProvider"
Expand Down
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-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
6 changes: 3 additions & 3 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ pluginManagement {
}

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.11.1" apply false
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
}

include ":app"
1 change: 1 addition & 0 deletions example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
13 changes: 5 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:async';
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:open_filex/open_filex.dart';
import 'package:open_filex/open_filex_plus.dart';
import 'package:permission_handler/permission_handler.dart';

void main() => runApp(const MyApp());
Expand All @@ -21,7 +21,7 @@ class MyAppState extends State<MyApp> {
if (Platform.isLinux) {
_openLinuxFile();
} else if (Platform.isAndroid) {
_openAndroidExternalImage();
_openAndroidExternalFile();
} else if (Platform.isWindows) {
_openWindowsFile();
} else if (Platform.isMacOS) {
Expand Down Expand Up @@ -82,12 +82,11 @@ class MyAppState extends State<MyApp> {
// ignore: unused_element
_openAndroidExternalImage() async {
//open an external storage image file on android 13
if (await Permission.photos.request().isGranted) {
final result = await OpenFilex.open("/sdcard/Download/flutter.png");
final result = await OpenFilex.open("/sdcard/Download/k.apk");
setState(() {
_openResult = "type=${result.type} message=${result.message}";
});
}

}

// ignore: unused_element
Expand Down Expand Up @@ -115,12 +114,10 @@ class MyAppState extends State<MyApp> {
// ignore: unused_element
_openAndroidExternalFile() async {
//open an external storage file
if (await Permission.manageExternalStorage.request().isGranted) {
final result = await OpenFilex.open("/sdcard/Android/data/R-C.xml");
final result = await OpenFilex.open("/sdcard/Download/k.apk");
setState(() {
_openResult = "type=${result.type} message=${result.message}";
});
}
}

@override
Expand Down
1 change: 1 addition & 0 deletions example/macos/Flutter/Flutter-Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
1 change: 1 addition & 0 deletions example/macos/Flutter/Flutter-Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
File renamed without changes.
3 changes: 2 additions & 1 deletion lib/src/platform/open_filex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import 'dart:convert';
import 'dart:io';

import 'package:flutter/services.dart';
import 'package:open_filex/src/common/open_result.dart';

import '../../open_filex_plus.dart';

/// OpenFilex class
class OpenFilex {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/web/open_filex.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'dart:async';
import 'package:open_filex/src/common/open_result.dart';
import 'package:open_filex_plus/src/common/open_result.dart';

import 'web.dart' as web;

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: open_filex
name: open_filex_plus
description: A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html)
version: 4.7.0
homepage: https://github.com/javaherisaber/open_file
version: 4.7.2
homepage: https://github.com/armin1440/open_filex

dependencies:
flutter:
Expand Down