Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/open_file_mac/.idea/
29 changes: 29 additions & 0 deletions open_file_ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
47 changes: 47 additions & 0 deletions open_file_ios/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

coverage/
34 changes: 34 additions & 0 deletions open_file_ios/example/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
3 changes: 1 addition & 2 deletions open_file_ios/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '12.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -29,7 +29,6 @@ flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
Expand Down
22 changes: 22 additions & 0 deletions open_file_ios/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PODS:
- Flutter (1.0.0)
- open_file_ios (1.0.3):
- Flutter

DEPENDENCIES:
- Flutter (from `Flutter`)
- open_file_ios (from `.symlinks/plugins/open_file_ios/ios`)

EXTERNAL SOURCES:
Flutter:
:path: Flutter
open_file_ios:
:path: ".symlinks/plugins/open_file_ios/ios"

SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
open_file_ios: 46184d802ee7959203f6392abcfa0dd49fdb5be0

PODFILE CHECKSUM: 4305caec6b40dde0ae97be1573c53de1882a07e5

COCOAPODS: 1.16.2
126 changes: 73 additions & 53 deletions open_file_ios/example/ios/Runner.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Prepare Flutter Framework Script"
scriptText = "/bin/sh &quot;$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh&quot; prepare&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down Expand Up @@ -59,6 +77,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions open_file_ios/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@

import 'dart:typed_data';
import 'dart:async';

import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:open_file_ios/open_file_ios.dart';
import 'dart:async';



void main() => runApp(MyApp());

Expand All @@ -24,23 +20,23 @@ class _MyAppState extends State<MyApp> {
}

// ignore: unused_element
_openPickFile() async {
Future<void> _openPickFile() async {
FilePickerResult? fileResult = await FilePicker.platform.pickFiles();
if (fileResult?.files.first != null) {

final result =
await OpenFileIOS().open(fileResult!.files.first.path);
final result = await OpenFileIOS().open(fileResult!.files.first.path);
setState(() {
_openResult = "type=${result.type} message=${result.message}";
});
}
}

_openExternalImage() async {
Future<void> _openExternalImage() async {
setState(() {
canRequestFocus = false;
});
final result = await OpenFileIOS().open("/Users/crazecoder/Library/Developer/CoreSimulator/Devices/9FDE8459-AD12-4665-A0C0-FF1A5D82CF9D/data/Downloads/1.jpeg",isIOSAppOpen: true);
final result = await OpenFileIOS().open(
"/Users/crazecoder/Library/Developer/CoreSimulator/Devices/9FDE8459-AD12-4665-A0C0-FF1A5D82CF9D/data/Downloads/1.jpeg",
isIOSAppOpen: true);
// final result = await OpenFileIOS().open("/Users/crazecoder/Library/Developer/CoreSimulator/Devices/9FDE8459-AD12-4665-A0C0-FF1A5D82CF9D/data/Downloads/R-C.jpeg");
setState(() {
_openResult = "type=${result.type} message=${result.message}";
Expand All @@ -60,9 +56,12 @@ class _MyAppState extends State<MyApp> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('open result: $_openResult\n'),
TextField(autofocus: false,canRequestFocus: canRequestFocus,),
TextField(
autofocus: false,
canRequestFocus: canRequestFocus,
),
TextButton(
onPressed: openFile,
onPressed: _openPickFile,
child: const Text('Tap to open file'),
),
],
Expand Down
Loading