Skip to content

Commit

Permalink
[pasteboard] add iOS support. (#44)
Browse files Browse the repository at this point in the history
* [pasteboard] add iOS support.

* update readme.
  • Loading branch information
boyan01 authored Dec 23, 2021
1 parent 34131c7 commit 5cbab54
Show file tree
Hide file tree
Showing 52 changed files with 1,275 additions and 9 deletions.
4 changes: 4 additions & 0 deletions packages/pasteboard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.2 (2021/12/22)

* add get/write image on iOS.

## 0.0.1 (2021/11/04)

* add Linux,Windows,macOS support.
Expand Down
14 changes: 8 additions & 6 deletions packages/pasteboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

A flutter plugin which could read image,files from clipboard and write files to clipboard.

| | |
| -------- | ------- |
| Windows ||
| Linux ||
| macOS ||
| | |
|----------|-----|
| Windows ||
| Linux ||
| macOS ||
| iOS ||

## Getting Started

Expand All @@ -18,13 +19,14 @@ A flutter plugin which could read image,files from clipboard and write files to
pasteboard: ^latest
```
2. example.
```dart
import 'package:pasteboard/pasteboard.dart';

Future<void> readAndWriteFiles() async {
final paths = ['your_file_path'];
await Pasteboard.writeFiles(paths);

final files = await Pasteboard.files();
print(files);
}
Expand Down
34 changes: 34 additions & 0 deletions packages/pasteboard/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
26 changes: 26 additions & 0 deletions packages/pasteboard/example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
</dict>
</plist>
2 changes: 2 additions & 0 deletions packages/pasteboard/example/ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
2 changes: 2 additions & 0 deletions packages/pasteboard/example/ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
41 changes: 41 additions & 0 deletions packages/pasteboard/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
22 changes: 22 additions & 0 deletions packages/pasteboard/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PODS:
- Flutter (1.0.0)
- pasteboard (0.0.1):
- Flutter

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

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

SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
pasteboard: 982969ebaa7c78af3e6cc7761e8f5e77565d9ce0

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c

COCOAPODS: 1.11.2
Loading

0 comments on commit 5cbab54

Please sign in to comment.