[
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: VolodymyrLykhonis\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n.dart_tool/\n\n.packages\n.pub/\npubspec.lock\n\n.idea/\n*.iml\n\nbuild/\n\nexample/.flutter-plugins-dependencies\nexample/ios/Flutter/flutter_export_environment.sh\n"
  },
  {
    "path": ".vscode/launch.json",
    "content": "{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Example\",\n            \"request\": \"launch\",\n            \"type\": \"dart\",\n            \"program\": \"${workspaceFolder}/example/lib/main.dart\"\n        }\n    ]\n}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "## 0.4.1\n\nCommunity Contributions. Thank you!\n\n* Dart 2.17 #89 (#91)\n* Fixed a few typos (#87)\n* Resolve #40 (#81)\n\n## 0.4.0\n\n* adds null safety\n\n## 0.3.4\n\n* fixes several issues related to scaling and multi-touch support\n\n## 0.3.3\n\n* migrate to the new Android APIs based on FlutterPlugin\n\n## 0.3.2\n\n* Fixes #33. Image rotation bug after cropping on iOS\n* Flutter upgrade v1.13.5\n\n## 0.3.1\n\n* Fixes #19. Painting of the image is independent of top/left handles\n* Visual correction of a grid. It was tilted by 1 point\n\n## 0.3.0\n\n* Android gradle upgrade to 3.4.1. Gradle 5.1.1\n* Flutter upgrade 1.6.6\n* Android target SDK 28\n\n## 0.2.1\n\n* Read exif information to provide proper width/height according to the orientation\n* Rotate image prior cropping as needed per exif information\n\n## 0.2.0\n\n* Fit sampled images to specified maximum width/height on both iOS and Android\n* Preserve exif information on Android when crop/sample image\n* Updated example to illustrate higher quality cropped image production\n\n## 0.1.3\n\n* New widget options: Maximum scale, always show grid\n* Adjusted scale to reflect original image size. If image scaled and fits in cropped area, scale is 1x\n* Calculate sample size against large side of image to match smaller to preferred width/height\n* Bug: ensure to display image on first frame\n* Optimization: do not resample if image is smaller than preferred width/height\n\n## 0.1.2\n\n* Limit image to a crop area instead of view boundaries\n* Don't adjust a size during scale to avoid misalignment\n* After editing snap image back to a crop area. Auto scale if needed\n\n## 0.1.1\n\n* Fixed an exception when aspect ratio is not supplied\n* Updated README with more information and screenshots\n\n## 0.1.0\n\n* Tools to resample by a factor, crop, and get options of images\n* Display image provider\n* Scale and crop image via widget\n* Optional aspect ratio of crop area\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2018 Volodymyr Lykhonis\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "# Image Cropping plugin for Flutter\n\nA flutter plugin to crop image on iOS and Android.\n\n![Image Cropping Preview](assets/image_cropping_preview.gif)\n\nThe plugin comes with a `Crop` widget. The widget renders only image, overlay, and handles to crop an image. Thus it can be composed with other widgets to build custom image cropping experience. \n\nThe plugin is working with files to avoid passing large amount of data through method channels. Files are stored in cache folders of iOS and Android. Thus if there is a need to save actual cropped image, ensure to copy the file to other location.\n\nAll of the computation intensive work is done off a main thread via dispatch queues on iOS and cache thread pool on Android.\n\n*Note*: This plugin is still under development, some features are not available yet and testing has been limited.\n\n## Installation\nAdd `image_crop` [![image_crop](https://img.shields.io/pub/v/image_crop.svg)](https://pub.dartlang.org/packages/image_crop) as [a dependency in `pubspec.yaml`](https://flutter.io/using-packages/#managing-package-dependencies--versions).\n\n## Using\nCreate a widget to load and edit an image:\n```dart\nfinal cropKey = GlobalKey<CropState>();\n\nWidget _buildCropImage() {\n  return Container(\n      color: Colors.black,\n      padding: const EdgeInsets.all(20.0),\n      child: Crop(\n        key: cropKey,\n        image: Image.file(imageFile),\n        aspectRatio: 4.0 / 3.0,\n      ),\n  );\n}\n```\nAccess cropping values:\n- scale is a factor to proportionally scale image's width and height when cropped. `1.0` is no scale needed.\n- area is a rectangle indicating fractional positions on the image to crop from.\n```dart\nfinal crop = cropKey.currentState;\n// or\n// final crop = Crop.of(context);\nfinal scale = crop.scale;\nfinal area = crop.area;\n\nif (area == null) {\n    // cannot crop, widget is not setup\n    // ...\n}\n```\nAccessing and working with images. As a convenience function to request permissions to access photos.\n```dart\nfinal permissionsGranted = await ImageCrop.requestPermissions();\n``` \nRead image options, such as: width and height. This is efficient implementation that does not decode nor load actual image into a memory.\n```dart\nfinal options = await getImageOptions(file: file);\ndebugPrint('image width: ${options.width}, height: ${options.height}');\n```\nIf a large image is to be loaded into the memory, there is a sampling function that relies on a native platform to proportionally scale down the image before loading it to the memory. e.g. resample image to get down to `1024x4096` dimension as close as possible. If it is a square `preferredSize` can be used to specify both width and height. Prefer to leverage this functionality when displaying images in UI.\n```dart\nfinal sampleFile = await ImageCrop.sampleImage(\n    file: originalFile,\n    preferredWidth: 1024,\n    preferredHeight: 4096,\n);\n```\nOnce `Crop` widget is ready, there is a native support of cropping and scaling an image. In order to produce higher quality cropped image, rely on sampling image with preferred maximum width and height. Scale up a resolution of the sampled image. When cropped, the image is in higher resolution. Example is illustrated below:\n```dart\nfinal sampledFile = await ImageCrop.sampleImage(\n    file: originalFile,\n    preferredWidth: (1024 / crop.scale).round(),\n    preferredHeight: (4096 / crop.scale).round(),\n);\n\nfinal croppedFile = await ImageCrop.cropImage(\n    file: sampledFile,\n    area: crop.area,\n);\n```\n"
  },
  {
    "path": "RELEASE.md",
    "content": "## Prepare for Release\n\nVersion format is `v{major}.{minor}.{patch}`. e.g. `v0.1.1`.\n\n1. Do `flutter analyze`. Ensure no issues found!\n2. Do `flutter format lib/`. Format all dart code.\n3. Update `pubsec.yaml` with new version.\n4. Update `CHANGELOG.md` with new version and add details describing what's new and/or changed.\n5. Do `flutter packages pub publish --dry-run`. Check to ensure there are no warnings!\n6. Do `git commit -am \"{version}\"`.\n7. Do `git tag {version}`.\n8. Do `flutter packages pub publish` to publish new version.\n9. Push changes `git push && git push --tags`\n"
  },
  {
    "path": "android/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n"
  },
  {
    "path": "android/build.gradle",
    "content": "group 'com.lykhonis.imagecrop'\nversion '1.0-SNAPSHOT'\n\nbuildscript {\n    repositories {\n        google()\n        jcenter()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.4.1'\n    }\n}\n\nrootProject.allprojects {\n    repositories {\n        google()\n        jcenter()\n    }\n}\n\napply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 28\n\n    defaultConfig {\n        minSdkVersion 16\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    lintOptions {\n        disable 'InvalidPackage'\n    }\n}\n\ndependencies {\n    implementation 'androidx.exifinterface:exifinterface:1.0.0'\n}\n"
  },
  {
    "path": "android/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Jun 01 05:18:58 PDT 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.1.1-all.zip\n"
  },
  {
    "path": "android/gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx1536M\n"
  },
  {
    "path": "android/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "android/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windows variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "android/settings.gradle",
    "content": "rootProject.name = 'image_crop'\n"
  },
  {
    "path": "android/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"com.lykhonis.imagecrop\">\n\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>\n</manifest>\n"
  },
  {
    "path": "android/src/main/java/com/lykhonis/imagecrop/ImageCropPlugin.java",
    "content": "package com.lykhonis.imagecrop;\n\nimport android.app.Activity;\nimport android.content.pm.PackageManager;\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Canvas;\nimport android.graphics.Matrix;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.os.Build;\nimport android.util.Log;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport java.util.Arrays;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.UUID;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\nimport androidx.annotation.NonNull;\nimport androidx.exifinterface.media.ExifInterface;\n\nimport io.flutter.plugin.common.BinaryMessenger;\nimport io.flutter.plugin.common.MethodCall;\nimport io.flutter.plugin.common.MethodChannel;\nimport io.flutter.plugin.common.MethodChannel.MethodCallHandler;\nimport io.flutter.plugin.common.MethodChannel.Result;\nimport io.flutter.plugin.common.PluginRegistry;\nimport io.flutter.plugin.common.PluginRegistry.Registrar;\nimport io.flutter.embedding.engine.plugins.FlutterPlugin;\nimport io.flutter.embedding.engine.plugins.activity.ActivityAware;\nimport io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding;\n\nimport static android.Manifest.permission.READ_EXTERNAL_STORAGE;\nimport static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;\n\npublic final class ImageCropPlugin implements FlutterPlugin , ActivityAware, MethodCallHandler, PluginRegistry.RequestPermissionsResultListener {\n    private static final int PERMISSION_REQUEST_CODE = 13094;\n\n    private MethodChannel channel;\n\n    private ActivityPluginBinding binding;\n    private Activity activity;\n    private Result permissionRequestResult;\n    private ExecutorService executor;\n\n    private ImageCropPlugin(Activity activity) {\n        this.activity = activity;\n    }\n\n    public ImageCropPlugin(){ }\n\n    /**\n     * legacy APIs\n     */\n    public static void registerWith(Registrar registrar) {\n        ImageCropPlugin instance = new ImageCropPlugin(registrar.activity());\n        instance.setup(registrar.messenger());\n        registrar.addRequestPermissionsResultListener(instance);\n    }\n\n    @Override\n    public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) {\n      this.setup(binding.getBinaryMessenger());\n    }\n  \n    @Override\n    public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) {\n        channel.setMethodCallHandler(null);\n        channel = null;\n    }\n\n    @Override\n    public void onAttachedToActivity(ActivityPluginBinding activityPluginBinding) {\n        binding = activityPluginBinding;\n        activity = activityPluginBinding.getActivity();\n        activityPluginBinding.addRequestPermissionsResultListener(this);\n    }\n   \n    @Override\n    public void onDetachedFromActivity() {\n        activity = null;\n        if(binding != null){\n            binding.removeRequestPermissionsResultListener(this);\n        }\n    }\n\n    @Override\n    public void onReattachedToActivityForConfigChanges(ActivityPluginBinding activityPluginBinding) {\n        this.onAttachedToActivity(activityPluginBinding);\n    }\n  \n    @Override\n    public void onDetachedFromActivityForConfigChanges() {\n        this.onDetachedFromActivity();\n    }\n  \n    private void setup(BinaryMessenger messenger) {\n        channel = new MethodChannel(messenger, \"plugins.lykhonis.com/image_crop\");\n        channel.setMethodCallHandler(this);\n    }\n\n\n    @SuppressWarnings(\"ConstantConditions\")\n    @Override\n    public void onMethodCall(MethodCall call, Result result) {\n        if (\"cropImage\".equals(call.method)) {\n            String path = call.argument(\"path\");\n            double scale = call.argument(\"scale\");\n            double left = call.argument(\"left\");\n            double top = call.argument(\"top\");\n            double right = call.argument(\"right\");\n            double bottom = call.argument(\"bottom\");\n            RectF area = new RectF((float) left, (float) top, (float) right, (float) bottom);\n            cropImage(path, area, (float) scale, result);\n        } else if (\"sampleImage\".equals(call.method)) {\n            String path = call.argument(\"path\");\n            int maximumWidth = call.argument(\"maximumWidth\");\n            int maximumHeight = call.argument(\"maximumHeight\");\n            sampleImage(path, maximumWidth, maximumHeight, result);\n        } else if (\"getImageOptions\".equals(call.method)) {\n            String path = call.argument(\"path\");\n            getImageOptions(path, result);\n        } else if (\"requestPermissions\".equals(call.method)) {\n            requestPermissions(result);\n        } else {\n            result.notImplemented();\n        }\n    }\n\n    private synchronized void io(@NonNull Runnable runnable) {\n        if (executor == null) {\n            executor = Executors.newCachedThreadPool();\n        }\n        executor.execute(runnable);\n    }\n\n    private void ui(@NonNull Runnable runnable) {\n        activity.runOnUiThread(runnable);\n    }\n\n    private void cropImage(final String path, final RectF area, final float scale, final Result result) {\n        io(new Runnable() {\n            @Override\n            public void run() {\n                File srcFile = new File(path);\n                if (!srcFile.exists()) {\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.error(\"INVALID\", \"Image source cannot be opened\", null);\n                        }\n                    });\n                    return;\n                }\n\n                Bitmap srcBitmap = BitmapFactory.decodeFile(path, null);\n                if (srcBitmap == null) {\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.error(\"INVALID\", \"Image source cannot be decoded\", null);\n                        }\n                    });\n                    return;\n                }\n\n                ImageOptions options = decodeImageOptions(path);\n                if (options.isFlippedDimensions()) {\n                    Matrix transformations = new Matrix();\n                    transformations.postRotate(options.getDegrees());\n                    Bitmap oldBitmap = srcBitmap;\n                    srcBitmap = Bitmap.createBitmap(oldBitmap,\n                                                    0, 0,\n                                                    oldBitmap.getWidth(), oldBitmap.getHeight(),\n                                                    transformations, true);\n                    oldBitmap.recycle();\n                }\n\n                int width = (int) (options.getWidth() * area.width() * scale);\n                int height = (int) (options.getHeight() * area.height() * scale);\n\n                Bitmap dstBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);\n                Canvas canvas = new Canvas(dstBitmap);\n\n                Paint paint = new Paint();\n                paint.setAntiAlias(true);\n                paint.setFilterBitmap(true);\n                paint.setDither(true);\n\n                Rect srcRect = new Rect((int) (srcBitmap.getWidth() * area.left),\n                                        (int) (srcBitmap.getHeight() * area.top),\n                                        (int) (srcBitmap.getWidth() * area.right),\n                                        (int) (srcBitmap.getHeight() * area.bottom));\n                Rect dstRect = new Rect(0, 0, width, height);\n                canvas.drawBitmap(srcBitmap, srcRect, dstRect, paint);\n\n                // TODO: Research a way to optimize rendering via matrix to reduce memory print.\n//                Matrix transformations = new Matrix();\n//                transformations.mapRect(new RectF(0, 0,\n//                                                  options.getWidth(), options.getHeight()));\n//                transformations.postTranslate(-options.getWidth() / 2f * area.left,\n//                                              -options.getHeight() / 2f * area.top);\n//                transformations.postRotate(options.getDegrees(),\n//                                           options.getWidth() / 2f * area.width(),\n//                                           options.getHeight() / 2f * area.height());\n//                canvas.drawBitmap(srcBitmap, transformations, paint);\n\n                try {\n                    final File dstFile = createTemporaryImageFile();\n                    compressBitmap(dstBitmap, dstFile);\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.success(dstFile.getAbsolutePath());\n                        }\n                    });\n                } catch (final IOException e) {\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.error(\"INVALID\", \"Image could not be saved\", e);\n                        }\n                    });\n                } finally {\n                    canvas.setBitmap(null);\n                    dstBitmap.recycle();\n                    srcBitmap.recycle();\n                }\n            }\n        });\n    }\n\n    private void sampleImage(final String path, final int maximumWidth, final int maximumHeight, final Result result) {\n        io(new Runnable() {\n            @Override\n            public void run() {\n                File srcFile = new File(path);\n                if (!srcFile.exists()) {\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.error(\"INVALID\", \"Image source cannot be opened\", null);\n                        }\n                    });\n                    return;\n                }\n\n                ImageOptions options = decodeImageOptions(path);\n                BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();\n                bitmapOptions.inSampleSize = calculateInSampleSize(options.getWidth(), options.getHeight(),\n                                                                   maximumWidth, maximumHeight);\n\n                Bitmap bitmap = BitmapFactory.decodeFile(path, bitmapOptions);\n                if (bitmap == null) {\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.error(\"INVALID\", \"Image source cannot be decoded\", null);\n                        }\n                    });\n                    return;\n                }\n\n                if (options.getWidth() > maximumWidth && options.getHeight() > maximumHeight) {\n                    float ratio = Math.max(maximumWidth / (float) options.getWidth(), maximumHeight / (float) options.getHeight());\n                    Bitmap sample = bitmap;\n                    bitmap = Bitmap.createScaledBitmap(sample, Math.round(bitmap.getWidth() * ratio), Math.round(bitmap.getHeight() * ratio), true);\n                    sample.recycle();\n                }\n\n                try {\n                    final File dstFile = createTemporaryImageFile();\n                    compressBitmap(bitmap, dstFile);\n                    copyExif(srcFile, dstFile);\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.success(dstFile.getAbsolutePath());\n                        }\n                    });\n                } catch (final IOException e) {\n                    ui(new Runnable() {\n                        @Override\n                        public void run() {\n                            result.error(\"INVALID\", \"Image could not be saved\", e);\n                        }\n                    });\n                } finally {\n                    bitmap.recycle();\n                }\n            }\n        });\n    }\n\n    @SuppressWarnings(\"TryFinallyCanBeTryWithResources\")\n    private void compressBitmap(Bitmap bitmap, File file) throws IOException {\n        OutputStream outputStream = new FileOutputStream(file);\n        try {\n            boolean compressed = bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);\n            if (!compressed) {\n                throw new IOException(\"Failed to compress bitmap into JPEG\");\n            }\n        } finally {\n            try {\n                outputStream.close();\n            } catch (IOException ignore) {\n            }\n        }\n    }\n\n    private int calculateInSampleSize(int width, int height, int maximumWidth, int maximumHeight) {\n        int inSampleSize = 1;\n\n        if (height > maximumHeight || width > maximumWidth) {\n            int halfHeight = height / 2;\n            int halfWidth = width / 2;\n\n            while ((halfHeight / inSampleSize) >= maximumHeight && (halfWidth / inSampleSize) >= maximumWidth) {\n                inSampleSize *= 2;\n            }\n        }\n\n        return inSampleSize;\n    }\n\n    private void getImageOptions(final String path, final Result result) {\n        io(new Runnable() {\n            @Override\n            public void run() {\n                File file = new File(path);\n                if (!file.exists()) {\n                    result.error(\"INVALID\", \"Image source cannot be opened\", null);\n                    return;\n                }\n\n                ImageOptions options = decodeImageOptions(path);\n                final Map<String, Object> properties = new HashMap<>();\n                properties.put(\"width\", options.getWidth());\n                properties.put(\"height\", options.getHeight());\n\n                ui(new Runnable() {\n                    @Override\n                    public void run() {\n                        result.success(properties);\n                    }\n                });\n            }\n        });\n    }\n\n    private void requestPermissions(Result result) {\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n            if (activity.checkSelfPermission(READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED &&\n                    activity.checkSelfPermission(WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {\n                result.success(true);\n            } else {\n                permissionRequestResult = result;\n                activity.requestPermissions(new String[]{READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);\n            }\n        } else {\n            result.success(true);\n        }\n    }\n\n    @Override\n    public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {\n        if (requestCode == PERMISSION_REQUEST_CODE && permissionRequestResult != null) {\n            int readExternalStorage = getPermissionGrantResult(READ_EXTERNAL_STORAGE, permissions, grantResults);\n            int writeExternalStorage = getPermissionGrantResult(WRITE_EXTERNAL_STORAGE, permissions, grantResults);\n            permissionRequestResult.success(readExternalStorage == PackageManager.PERMISSION_GRANTED &&\n                                                    writeExternalStorage == PackageManager.PERMISSION_GRANTED);\n            permissionRequestResult = null;\n        }\n        return false;\n    }\n\n    private int getPermissionGrantResult(String permission, String[] permissions, int[] grantResults) {\n        for (int i = 0; i < permission.length(); i++) {\n            if (permission.equals(permissions[i])) {\n                return grantResults[i];\n            }\n        }\n        return PackageManager.PERMISSION_DENIED;\n    }\n\n    private File createTemporaryImageFile() throws IOException {\n        File directory = activity.getCacheDir();\n        String name = \"image_crop_\" + UUID.randomUUID().toString();\n        return File.createTempFile(name, \".jpg\", directory);\n    }\n\n    private ImageOptions decodeImageOptions(String path) {\n        int rotationDegrees = 0;\n        try {\n            ExifInterface exif = new ExifInterface(path);\n            rotationDegrees = exif.getRotationDegrees();\n        } catch (IOException e) {\n            Log.e(\"ImageCrop\", \"Failed to read a file \" + path, e);\n        }\n        BitmapFactory.Options options = new BitmapFactory.Options();\n        options.inJustDecodeBounds = true;\n        BitmapFactory.decodeFile(path, options);\n        return new ImageOptions(options.outWidth, options.outHeight, rotationDegrees);\n    }\n\n    private void copyExif(File source, File destination) {\n        try {\n            ExifInterface sourceExif = new ExifInterface(source.getAbsolutePath());\n            ExifInterface destinationExif = new ExifInterface(destination.getAbsolutePath());\n\n            List<String> tags =\n                    Arrays.asList(\n                            ExifInterface.TAG_F_NUMBER,\n                            ExifInterface.TAG_EXPOSURE_TIME,\n                            ExifInterface.TAG_PHOTOGRAPHIC_SENSITIVITY,\n                            ExifInterface.TAG_GPS_ALTITUDE,\n                            ExifInterface.TAG_GPS_ALTITUDE_REF,\n                            ExifInterface.TAG_FOCAL_LENGTH,\n                            ExifInterface.TAG_GPS_DATESTAMP,\n                            ExifInterface.TAG_WHITE_BALANCE,\n                            ExifInterface.TAG_GPS_PROCESSING_METHOD,\n                            ExifInterface.TAG_GPS_TIMESTAMP,\n                            ExifInterface.TAG_DATETIME,\n                            ExifInterface.TAG_FLASH,\n                            ExifInterface.TAG_GPS_LATITUDE,\n                            ExifInterface.TAG_GPS_LATITUDE_REF,\n                            ExifInterface.TAG_GPS_LONGITUDE,\n                            ExifInterface.TAG_GPS_LONGITUDE_REF,\n                            ExifInterface.TAG_MAKE,\n                            ExifInterface.TAG_MODEL,\n                            ExifInterface.TAG_ORIENTATION);\n\n            for (String tag : tags) {\n                String attribute = sourceExif.getAttribute(tag);\n                if (attribute != null) {\n                    destinationExif.setAttribute(tag, attribute);\n                }\n            }\n\n            destinationExif.saveAttributes();\n        } catch (IOException e) {\n            Log.e(\"ImageCrop\", \"Failed to preserve Exif information\", e);\n        }\n    }\n\n    private static final class ImageOptions {\n        private final int width;\n        private final int height;\n        private final int degrees;\n\n        ImageOptions(int width, int height, int degrees) {\n            this.width = width;\n            this.height = height;\n            this.degrees = degrees;\n        }\n\n        int getHeight() {\n            return (isFlippedDimensions() && degrees != 180) ? width : height;\n        }\n\n        int getWidth() {\n            return (isFlippedDimensions() && degrees != 180)  ? height : width;\n        }\n\n        int getDegrees() {\n            return degrees;\n        }\n\n        boolean isFlippedDimensions() {\n            return degrees == 90 || degrees == 270 || degrees == 180;\n        }\n\n        public boolean isRotated() {\n            return degrees != 0;\n        }\n    }\n}\n"
  },
  {
    "path": "example/.gitignore",
    "content": "# Miscellaneous\n*.class\n*.lock\n*.log\n*.pyc\n*.swp\n.DS_Store\n.atom/\n.buildlog/\n.history\n.svn/\n\n# IntelliJ related\n*.iml\n*.ipr\n*.iws\n.idea/\n\n# Visual Studio Code related\n.vscode/\n\n# Flutter/Dart/Pub related\n**/doc/api/\n.dart_tool/\n.flutter-plugins\n.packages\n.pub-cache/\n.pub/\nbuild/\n\n# Android related\n**/android/**/gradle-wrapper.jar\n**/android/.gradle\n**/android/captures/\n**/android/gradlew\n**/android/gradlew.bat\n**/android/local.properties\n**/android/**/GeneratedPluginRegistrant.java\n\n# iOS/XCode related\n**/ios/**/*.mode1v3\n**/ios/**/*.mode2v3\n**/ios/**/*.moved-aside\n**/ios/**/*.pbxuser\n**/ios/**/*.perspectivev3\n**/ios/**/*sync/\n**/ios/**/.sconsign.dblite\n**/ios/**/.tags*\n**/ios/**/.vagrant/\n**/ios/**/DerivedData/\n**/ios/**/Icon?\n**/ios/**/Pods/\n**/ios/**/.symlinks/\n**/ios/**/profile\n**/ios/**/xcuserdata\n**/ios/.generated/\n**/ios/Flutter/App.framework\n**/ios/Flutter/Flutter.framework\n**/ios/Flutter/Generated.xcconfig\n**/ios/Flutter/app.flx\n**/ios/Flutter/app.zip\n**/ios/Flutter/flutter_assets/\n**/ios/ServiceDefinitions.json\n**/ios/Runner/GeneratedPluginRegistrant.*\n\n# Exceptions to above rules.\n!**/ios/**/default.mode1v3\n!**/ios/**/default.mode2v3\n!**/ios/**/default.pbxuser\n!**/ios/**/default.perspectivev3\n!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages\n"
  },
  {
    "path": "example/README.md",
    "content": "# image_crop_example\n\nDemonstrates how to use the image_crop plugin.\n\n## Getting Started\n\nFor help getting started with Flutter, view our online\n[documentation](https://flutter.io/).\n"
  },
  {
    "path": "example/android/app/build.gradle",
    "content": "def localProperties = new Properties()\ndef localPropertiesFile = rootProject.file('local.properties')\nif (localPropertiesFile.exists()) {\n    localPropertiesFile.withReader('UTF-8') { reader ->\n        localProperties.load(reader)\n    }\n}\n\ndef flutterRoot = localProperties.getProperty('flutter.sdk')\nif (flutterRoot == null) {\n    throw new GradleException(\"Flutter SDK not found. Define location with flutter.sdk in the local.properties file.\")\n}\n\ndef flutterVersionCode = localProperties.getProperty('flutter.versionCode')\nif (flutterVersionCode == null) {\n    flutterVersionCode = '1'\n}\n\ndef flutterVersionName = localProperties.getProperty('flutter.versionName')\nif (flutterVersionName == null) {\n    flutterVersionName = '1.0'\n}\n\napply plugin: 'com.android.application'\napply from: \"$flutterRoot/packages/flutter_tools/gradle/flutter.gradle\"\n\nandroid {\n    compileSdkVersion 28\n\n    lintOptions {\n        disable 'InvalidPackage'\n    }\n\n    defaultConfig {\n        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).\n        applicationId \"com.lykhonis.imagecropexample\"\n        minSdkVersion 16\n        targetSdkVersion 28\n        versionCode flutterVersionCode.toInteger()\n        versionName flutterVersionName\n        testInstrumentationRunner \"android.support.test.runner.AndroidJUnitRunner\"\n    }\n\n    buildTypes {\n        release {\n            // TODO: Add your own signing config for the release build.\n            // Signing with the debug keys for now, so `flutter run --release` works.\n            signingConfig signingConfigs.debug\n        }\n    }\n}\n\nflutter {\n    source '../..'\n}\n\ndependencies {\n    testImplementation 'junit:junit:4.12'\n\n    androidTestImplementation 'com.android.support.test:runner:1.0.2'\n    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n}\n"
  },
  {
    "path": "example/android/app/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"com.lykhonis.imagecropexample\">\n\n    <!-- The INTERNET permission is required for development. Specifically,\n         flutter needs it to communicate with the running application\n         to allow setting breakpoints, to provide hot reload, etc.\n    -->\n    <uses-permission android:name=\"android.permission.INTERNET\"/>\n\n    <!-- io.flutter.app.FlutterApplication is an android.app.Application that\n         calls FlutterMain.startInitialization(this); in its onCreate method.\n         In most cases you can leave this as-is, but you if you want to provide\n         additional functionality it is fine to subclass or reimplement\n         FlutterApplication and put your custom class here. -->\n    <application\n        android:name=\"io.flutter.app.FlutterApplication\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"image_crop_example\">\n        <activity\n            android:name=\".MainActivity\"\n            android:configChanges=\"orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density\"\n            android:hardwareAccelerated=\"true\"\n            android:launchMode=\"singleTop\"\n            android:screenOrientation=\"userPortrait\"\n            android:theme=\"@style/LaunchTheme\"\n            android:windowSoftInputMode=\"adjustResize\">\n            <!-- This keeps the window background of the activity showing\n                 until Flutter renders its first frame. It can be removed if\n                 there is no splash screen (such as the default splash screen\n                 defined in @style/LaunchTheme). -->\n            <meta-data\n                android:name=\"io.flutter.app.android.SplashScreenUntilFirstFrame\"\n                android:value=\"true\"/>\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n    </application>\n</manifest>\n"
  },
  {
    "path": "example/android/app/src/main/java/com/lykhonis/imagecropexample/MainActivity.java",
    "content": "package com.lykhonis.imagecropexample;\n\nimport android.os.Bundle;\nimport io.flutter.app.FlutterActivity;\nimport io.flutter.plugins.GeneratedPluginRegistrant;\n\npublic class MainActivity extends FlutterActivity {\n  @Override\n  protected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    GeneratedPluginRegistrant.registerWith(this);\n  }\n}\n"
  },
  {
    "path": "example/android/app/src/main/res/drawable/launch_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!-- Modify this file to customize your launch splash screen -->\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <item android:drawable=\"@android:color/white\" />\n\n    <!-- You can insert your own image assets here -->\n    <!-- <item>\n        <bitmap\n            android:gravity=\"center\"\n            android:src=\"@mipmap/launch_image\" />\n    </item> -->\n</layer-list>\n"
  },
  {
    "path": "example/android/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <style name=\"LaunchTheme\" parent=\"@android:style/Theme.Black.NoTitleBar\">\n        <!-- Show a splash screen on the activity. Automatically removed when\n             Flutter draws its first frame -->\n        <item name=\"android:windowBackground\">@drawable/launch_background</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "example/android/build.gradle",
    "content": "buildscript {\n    repositories {\n        google()\n        jcenter()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:3.4.1'\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        jcenter()\n    }\n}\n\nrootProject.buildDir = '../build'\nsubprojects {\n    project.buildDir = \"${rootProject.buildDir}/${project.name}\"\n}\nsubprojects {\n    project.evaluationDependsOn(':app')\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "example/android/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Jun 01 05:20:09 PDT 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-5.1.1-all.zip\n"
  },
  {
    "path": "example/android/gradle.properties",
    "content": "org.gradle.jvmargs=-Xmx1536M\n"
  },
  {
    "path": "example/android/settings.gradle",
    "content": "include ':app'\n\ndef flutterProjectRoot = rootProject.projectDir.parentFile.toPath()\n\ndef plugins = new Properties()\ndef pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')\nif (pluginsFile.exists()) {\n    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }\n}\n\nplugins.each { name, path ->\n    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()\n    include \":$name\"\n    project(\":$name\").projectDir = pluginDirectory\n}\n"
  },
  {
    "path": "example/ios/Flutter/.last_build_id",
    "content": "96b858413dd1e970b76641c6cef4bcad"
  },
  {
    "path": "example/ios/Flutter/AppFrameworkInfo.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n  <key>CFBundleDevelopmentRegion</key>\n  <string>en</string>\n  <key>CFBundleExecutable</key>\n  <string>App</string>\n  <key>CFBundleIdentifier</key>\n  <string>io.flutter.flutter.app</string>\n  <key>CFBundleInfoDictionaryVersion</key>\n  <string>6.0</string>\n  <key>CFBundleName</key>\n  <string>App</string>\n  <key>CFBundlePackageType</key>\n  <string>FMWK</string>\n  <key>CFBundleShortVersionString</key>\n  <string>1.0</string>\n  <key>CFBundleSignature</key>\n  <string>????</string>\n  <key>CFBundleVersion</key>\n  <string>1.0</string>\n  <key>MinimumOSVersion</key>\n  <string>9.0</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "example/ios/Flutter/Debug.xcconfig",
    "content": "#include \"Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig\"\n#include \"Generated.xcconfig\"\n"
  },
  {
    "path": "example/ios/Flutter/Flutter.podspec",
    "content": "#\n# NOTE: This podspec is NOT to be published. It is only used as a local source!\n#       This is a generated file; do not edit or check into version control.\n#\n\nPod::Spec.new do |s|\n  s.name             = 'Flutter'\n  s.version          = '1.0.0'\n  s.summary          = 'High-performance, high-fidelity mobile apps.'\n  s.homepage         = 'https://flutter.io'\n  s.license          = { :type => 'MIT' }\n  s.author           = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }\n  s.source           = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }\n  s.ios.deployment_target = '9.0'\n  # Framework linking is handled by Flutter tooling, not CocoaPods.\n  # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.\n  s.vendored_frameworks = 'path/to/nothing'\nend\n"
  },
  {
    "path": "example/ios/Flutter/Release.xcconfig",
    "content": "#include \"Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig\"\n#include \"Generated.xcconfig\"\n"
  },
  {
    "path": "example/ios/Podfile",
    "content": "# Uncomment this line to define a global platform for your project\n# platform :ios, '9.0'\n\n# CocoaPods analytics sends network stats synchronously affecting flutter build latency.\nENV['COCOAPODS_DISABLE_STATS'] = 'true'\n\nproject 'Runner', {\n  'Debug' => :debug,\n  'Profile' => :release,\n  'Release' => :release,\n}\n\ndef flutter_root\n  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)\n  unless File.exist?(generated_xcode_build_settings_path)\n    raise \"#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first\"\n  end\n\n  File.foreach(generated_xcode_build_settings_path) do |line|\n    matches = line.match(/FLUTTER_ROOT\\=(.*)/)\n    return matches[1].strip if matches\n  end\n  raise \"FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get\"\nend\n\nrequire File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)\n\nflutter_ios_podfile_setup\n\ntarget 'Runner' do\n  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))\nend\n\npost_install do |installer|\n  installer.pods_project.targets.each do |target|\n    flutter_additional_ios_build_settings(target)\n  end\nend\n"
  },
  {
    "path": "example/ios/Runner/AppDelegate.h",
    "content": "#import <Flutter/Flutter.h>\n#import <UIKit/UIKit.h>\n\n@interface AppDelegate : FlutterAppDelegate\n\n@end\n"
  },
  {
    "path": "example/ios/Runner/AppDelegate.m",
    "content": "#include \"AppDelegate.h\"\n#include \"GeneratedPluginRegistrant.h\"\n\n@implementation AppDelegate\n\n- (BOOL)application:(UIApplication *)application\n    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n  [GeneratedPluginRegistrant registerWithRegistry:self];\n  // Override point for customization after application launch.\n  return [super application:application didFinishLaunchingWithOptions:launchOptions];\n}\n\n@end\n"
  },
  {
    "path": "example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"size\" : \"20x20\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-20x20@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"20x20\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-20x20@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-29x29@1x.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-29x29@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-29x29@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-40x40@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-40x40@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"60x60\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-60x60@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"60x60\",\n      \"idiom\" : \"iphone\",\n      \"filename\" : \"Icon-App-60x60@3x.png\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"size\" : \"20x20\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-20x20@1x.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"20x20\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-20x20@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-29x29@1x.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"29x29\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-29x29@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-40x40@1x.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"40x40\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-40x40@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"76x76\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-76x76@1x.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"size\" : \"76x76\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-76x76@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"83.5x83.5\",\n      \"idiom\" : \"ipad\",\n      \"filename\" : \"Icon-App-83.5x83.5@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"size\" : \"1024x1024\",\n      \"idiom\" : \"ios-marketing\",\n      \"filename\" : \"Icon-App-1024x1024@1x.png\",\n      \"scale\" : \"1x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}\n"
  },
  {
    "path": "example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchImage.png\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchImage@2x.png\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"filename\" : \"LaunchImage@3x.png\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}\n"
  },
  {
    "path": "example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md",
    "content": "# Launch Screen Assets\n\nYou can customize the launch screen with your own desired assets by replacing the image files in this directory.\n\nYou can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images."
  },
  {
    "path": "example/ios/Runner/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"12121\" systemVersion=\"16G29\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"12089\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"Ydg-fD-yQy\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"xbc-2k-c8Z\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <subviews>\n                            <imageView opaque=\"NO\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"center\" image=\"LaunchImage\" translatesAutoresizingMaskIntoConstraints=\"NO\" id=\"YRO-k0-Ey4\">\n                            </imageView>\n                        </subviews>\n                        <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <constraints>\n                            <constraint firstItem=\"YRO-k0-Ey4\" firstAttribute=\"centerX\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"centerX\" id=\"1a2-6s-vTC\"/>\n                            <constraint firstItem=\"YRO-k0-Ey4\" firstAttribute=\"centerY\" secondItem=\"Ze5-6b-2t3\" secondAttribute=\"centerY\" id=\"4X2-HB-R7a\"/>\n                        </constraints>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n    <resources>\n        <image name=\"LaunchImage\" width=\"168\" height=\"185\"/>\n    </resources>\n</document>\n"
  },
  {
    "path": "example/ios/Runner/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"10117\" systemVersion=\"15F34\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" initialViewController=\"BYZ-38-t0r\">\n    <dependencies>\n        <deployment identifier=\"iOS\"/>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"10085\"/>\n    </dependencies>\n    <scenes>\n        <!--Flutter View Controller-->\n        <scene sceneID=\"tne-QT-ifu\">\n            <objects>\n                <viewController id=\"BYZ-38-t0r\" customClass=\"FlutterViewController\" sceneMemberID=\"viewController\">\n                    <layoutGuides>\n                        <viewControllerLayoutGuide type=\"top\" id=\"y3c-jy-aDJ\"/>\n                        <viewControllerLayoutGuide type=\"bottom\" id=\"wfy-db-euE\"/>\n                    </layoutGuides>\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"8bC-Xf-vdC\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"600\" height=\"600\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <color key=\"backgroundColor\" white=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"calibratedWhite\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"dkx-z0-nzr\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "example/ios/Runner/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>en</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>image_crop_example</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>$(FLUTTER_BUILD_NAME)</string>\n\t<key>CFBundleSignature</key>\n\t<string>????</string>\n\t<key>CFBundleVersion</key>\n\t<string>$(FLUTTER_BUILD_NUMBER)</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>NSPhotoLibraryUsageDescription</key>\n\t<string>$(PRODUCT_NAME) photo use</string>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiresFullScreen</key>\n\t<true/>\n\t<key>UIStatusBarHidden</key>\n\t<true/>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UIViewControllerBasedStatusBarAppearance</key>\n\t<false/>\n\t<key>CADisableMinimumFrameDurationOnPhone</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "example/ios/Runner/main.m",
    "content": "#import <Flutter/Flutter.h>\n#import <UIKit/UIKit.h>\n#import \"AppDelegate.h\"\n\nint main(int argc, char* argv[]) {\n  @autoreleasepool {\n    return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));\n  }\n}\n"
  },
  {
    "path": "example/ios/Runner.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 50;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };\n\t\t3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };\n\t\t45D7AD3E8B938D6F2DCCF45D /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC772E646CA03FC65146EE /* libPods-Runner.a */; };\n\t\t9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };\n\t\t978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };\n\t\t97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };\n\t\t97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };\n\t\t97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };\n\t\t97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXCopyFilesBuildPhase section */\n\t\t9705A1C41CF9048500538489 /* Embed Frameworks */ = {\n\t\t\tisa = PBXCopyFilesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tdstPath = \"\";\n\t\t\tdstSubfolderSpec = 10;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tname = \"Embed Frameworks\";\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXCopyFilesBuildPhase section */\n\n/* Begin PBXFileReference section */\n\t\t1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = \"<group>\"; };\n\t\t1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = \"<group>\"; };\n\t\t2596FE007A8D745C0B6E51FF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-Runner.release.xcconfig\"; path = \"Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = \"<group>\"; };\n\t\t7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = \"<group>\"; };\n\t\t7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = \"<group>\"; };\n\t\t7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = \"<group>\"; };\n\t\t855E57973FA76BEBC79E496E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = \"Pods-Runner.debug.xcconfig\"; path = \"Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig\"; sourceTree = \"<group>\"; };\n\t\t9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = \"<group>\"; };\n\t\t9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = \"<group>\"; };\n\t\t97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = \"<group>\"; };\n\t\t97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\tF3FC772E646CA03FC65146EE /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = \"libPods-Runner.a\"; sourceTree = BUILT_PRODUCTS_DIR; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t97C146EB1CF9000F007C117D /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t45D7AD3E8B938D6F2DCCF45D /* libPods-Runner.a in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t9740EEB11CF90186004384FC /* Flutter */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,\n\t\t\t\t9740EEB21CF90195004384FC /* Debug.xcconfig */,\n\t\t\t\t7AFA3C8E1D35360C0083082E /* Release.xcconfig */,\n\t\t\t\t9740EEB31CF90195004384FC /* Generated.xcconfig */,\n\t\t\t);\n\t\t\tname = Flutter;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t97C146E51CF9000F007C117D = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t9740EEB11CF90186004384FC /* Flutter */,\n\t\t\t\t97C146F01CF9000F007C117D /* Runner */,\n\t\t\t\t97C146EF1CF9000F007C117D /* Products */,\n\t\t\t\tC8F9B5686C9254534AD5F089 /* Pods */,\n\t\t\t\tF7872D91B426FBF6C372E7EF /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t97C146EF1CF9000F007C117D /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t97C146EE1CF9000F007C117D /* Runner.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t97C146F01CF9000F007C117D /* Runner */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,\n\t\t\t\t7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,\n\t\t\t\t97C146FA1CF9000F007C117D /* Main.storyboard */,\n\t\t\t\t97C146FD1CF9000F007C117D /* Assets.xcassets */,\n\t\t\t\t97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,\n\t\t\t\t97C147021CF9000F007C117D /* Info.plist */,\n\t\t\t\t97C146F11CF9000F007C117D /* Supporting Files */,\n\t\t\t\t1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,\n\t\t\t\t1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,\n\t\t\t);\n\t\t\tpath = Runner;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t97C146F11CF9000F007C117D /* Supporting Files */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t97C146F21CF9000F007C117D /* main.m */,\n\t\t\t);\n\t\t\tname = \"Supporting Files\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tC8F9B5686C9254534AD5F089 /* Pods */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t855E57973FA76BEBC79E496E /* Pods-Runner.debug.xcconfig */,\n\t\t\t\t2596FE007A8D745C0B6E51FF /* Pods-Runner.release.xcconfig */,\n\t\t\t);\n\t\t\tname = Pods;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tF7872D91B426FBF6C372E7EF /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tF3FC772E646CA03FC65146EE /* libPods-Runner.a */,\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t97C146ED1CF9000F007C117D /* Runner */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget \"Runner\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t263AC01179F27909E5C06BE9 /* [CP] Check Pods Manifest.lock */,\n\t\t\t\t9740EEB61CF901F6004384FC /* Run Script */,\n\t\t\t\t97C146EA1CF9000F007C117D /* Sources */,\n\t\t\t\t97C146EB1CF9000F007C117D /* Frameworks */,\n\t\t\t\t97C146EC1CF9000F007C117D /* Resources */,\n\t\t\t\t9705A1C41CF9048500538489 /* Embed Frameworks */,\n\t\t\t\t3B06AD1E1E4923F5004D2608 /* Thin Binary */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = Runner;\n\t\t\tproductName = Runner;\n\t\t\tproductReference = 97C146EE1CF9000F007C117D /* Runner.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t97C146E61CF9000F007C117D /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastUpgradeCheck = 1300;\n\t\t\t\tORGANIZATIONNAME = \"The Chromium Authors\";\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t97C146ED1CF9000F007C117D = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 7.3.1;\n\t\t\t\t\t\tDevelopmentTeam = KSK2PM67WL;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject \"Runner\" */;\n\t\t\tcompatibilityVersion = \"Xcode 3.2\";\n\t\t\tdevelopmentRegion = English;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 97C146E51CF9000F007C117D;\n\t\t\tproductRefGroup = 97C146EF1CF9000F007C117D /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t97C146ED1CF9000F007C117D /* Runner */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t97C146EC1CF9000F007C117D /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,\n\t\t\t\t9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,\n\t\t\t\t97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,\n\t\t\t\t97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\t263AC01179F27909E5C06BE9 /* [CP] Check Pods Manifest.lock */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t\t\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\",\n\t\t\t\t\"${PODS_ROOT}/Manifest.lock\",\n\t\t\t);\n\t\t\tname = \"[CP] Check Pods Manifest.lock\";\n\t\t\toutputPaths = (\n\t\t\t\t\"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt\",\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"diff \\\"${PODS_PODFILE_DIR_PATH}/Podfile.lock\\\" \\\"${PODS_ROOT}/Manifest.lock\\\" > /dev/null\\nif [ $? != 0 ] ; then\\n    # print error to STDERR\\n    echo \\\"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\\\" >&2\\n    exit 1\\nfi\\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\\necho \\\"SUCCESS\\\" > \\\"${SCRIPT_OUTPUT_FILE_0}\\\"\\n\";\n\t\t\tshowEnvVarsInLog = 0;\n\t\t};\n\t\t3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Thin Binary\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"/bin/sh \\\"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\\\" embed_and_thin\";\n\t\t};\n\t\t9740EEB61CF901F6004384FC /* Run Script */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Run Script\";\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"/bin/sh \\\"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\\\" build\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t97C146EA1CF9000F007C117D /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,\n\t\t\t\t97C146F31CF9000F007C117D /* main.m in Sources */,\n\t\t\t\t1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t97C146FA1CF9000F007C117D /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t97C146FB1CF9000F007C117D /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t97C147001CF9000F007C117D /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t97C147031CF9000F007C117D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t97C147041CF9000F007C117D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++0x\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu99;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 9.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t97C147061CF9000F007C117D /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCURRENT_PROJECT_VERSION = \"$(FLUTTER_BUILD_NUMBER)\";\n\t\t\t\tDEVELOPMENT_TEAM = KSK2PM67WL;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/Flutter\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = Runner/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/Flutter\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.lykhonis.imageCropExample;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t97C147071CF9000F007C117D /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCURRENT_PROJECT_VERSION = \"$(FLUTTER_BUILD_NUMBER)\";\n\t\t\t\tDEVELOPMENT_TEAM = KSK2PM67WL;\n\t\t\t\tENABLE_BITCODE = NO;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/Flutter\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = Runner/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = \"$(inherited) @executable_path/Frameworks\";\n\t\t\t\tLIBRARY_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(PROJECT_DIR)/Flutter\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.lykhonis.imageCropExample;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tVERSIONING_SYSTEM = \"apple-generic\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t97C146E91CF9000F007C117D /* Build configuration list for PBXProject \"Runner\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t97C147031CF9000F007C117D /* Debug */,\n\t\t\t\t97C147041CF9000F007C117D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget \"Runner\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t97C147061CF9000F007C117D /* Debug */,\n\t\t\t\t97C147071CF9000F007C117D /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 97C146E61CF9000F007C117D /* Project object */;\n}\n"
  },
  {
    "path": "example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:Runner.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"0910\"\n   version = \"1.3\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"97C146ED1CF9000F007C117D\"\n               BuildableName = \"Runner.app\"\n               BlueprintName = \"Runner\"\n               ReferencedContainer = \"container:Runner.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\">\n      <Testables>\n      </Testables>\n      <MacroExpansion>\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"97C146ED1CF9000F007C117D\"\n            BuildableName = \"Runner.app\"\n            BlueprintName = \"Runner\"\n            ReferencedContainer = \"container:Runner.xcodeproj\">\n         </BuildableReference>\n      </MacroExpansion>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      language = \"\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"97C146ED1CF9000F007C117D\"\n            BuildableName = \"Runner.app\"\n            BlueprintName = \"Runner\"\n            ReferencedContainer = \"container:Runner.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n      <AdditionalOptions>\n      </AdditionalOptions>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"97C146ED1CF9000F007C117D\"\n            BuildableName = \"Runner.app\"\n            BlueprintName = \"Runner\"\n            ReferencedContainer = \"container:Runner.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "example/ios/Runner.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:Runner.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:Pods/Pods.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "example/ios/Runner.xcworkspace/contents.xcworkspacedata.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:Runner.xcodeproj\">\n   </FileRef>\n   <FileRef\n      location = \"group:Pods/Pods.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildSystemType</key>\n\t<string>Original</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "example/lib/main.dart",
    "content": "import 'dart:io';\nimport 'dart:async';\n\nimport 'package:flutter/material.dart';\nimport 'package:flutter/services.dart';\nimport 'package:image_crop/image_crop.dart';\nimport 'package:image_picker/image_picker.dart';\n\nvoid main() {\n  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(\n    statusBarColor: Colors.transparent,\n    statusBarBrightness: Brightness.dark,\n    statusBarIconBrightness: Brightness.light,\n    systemNavigationBarIconBrightness: Brightness.light,\n  ));\n\n  runApp(new MyApp());\n}\n\nclass MyApp extends StatefulWidget {\n  @override\n  _MyAppState createState() => new _MyAppState();\n}\n\nclass _MyAppState extends State<MyApp> {\n  final cropKey = GlobalKey<CropState>();\n  File _file;\n  File _sample;\n  File _lastCropped;\n\n  @override\n  void dispose() {\n    super.dispose();\n    _file?.delete();\n    _sample?.delete();\n    _lastCropped?.delete();\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return MaterialApp(\n      debugShowCheckedModeBanner: false,\n      home: SafeArea(\n        child: Container(\n          color: Colors.black,\n          padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 20.0),\n          child: _sample == null ? _buildOpeningImage() : _buildCroppingImage(),\n        ),\n      ),\n    );\n  }\n\n  Widget _buildOpeningImage() {\n    return Center(child: _buildOpenImage());\n  }\n\n  Widget _buildCroppingImage() {\n    return Column(\n      children: <Widget>[\n        Expanded(\n          child: Crop.file(_sample, key: cropKey),\n        ),\n        Container(\n          padding: const EdgeInsets.only(top: 20.0),\n          alignment: AlignmentDirectional.center,\n          child: Row(\n            mainAxisAlignment: MainAxisAlignment.spaceAround,\n            children: <Widget>[\n              TextButton(\n                child: Text(\n                  'Crop Image',\n                  style: Theme.of(context)\n                      .textTheme\n                      .button\n                      .copyWith(color: Colors.white),\n                ),\n                onPressed: () => _cropImage(),\n              ),\n              _buildOpenImage(),\n            ],\n          ),\n        )\n      ],\n    );\n  }\n\n  Widget _buildOpenImage() {\n    return TextButton(\n      child: Text(\n        'Open Image',\n        style: Theme.of(context).textTheme.button.copyWith(color: Colors.white),\n      ),\n      onPressed: () => _openImage(),\n    );\n  }\n\n  Future<void> _openImage() async {\n    final pickedFile = await ImagePicker().getImage(source: ImageSource.gallery);\n    final file = File(pickedFile.path);\n    final sample = await ImageCrop.sampleImage(\n      file: file,\n      preferredSize: context.size.longestSide.ceil(),\n    );\n\n    _sample?.delete();\n    _file?.delete();\n\n    setState(() {\n      _sample = sample;\n      _file = file;\n    });\n  }\n\n  Future<void> _cropImage() async {\n    final scale = cropKey.currentState.scale;\n    final area = cropKey.currentState.area;\n    if (area == null) {\n      // cannot crop, widget is not setup\n      return;\n    }\n\n    // scale up to use maximum possible number of pixels\n    // this will sample image in higher resolution to make cropped image larger\n    final sample = await ImageCrop.sampleImage(\n      file: _file,\n      preferredSize: (2000 / scale).round(),\n    );\n\n    final file = await ImageCrop.cropImage(\n      file: sample,\n      area: area,\n    );\n\n    sample.delete();\n\n    _lastCropped?.delete();\n    _lastCropped = file;\n\n    debugPrint('$file');\n  }\n}\n"
  },
  {
    "path": "example/pubspec.yaml",
    "content": "name: image_crop_example\ndescription: Demonstrates how to use the image_crop plugin.\n\nversion: 1.0.0+1\n\nenvironment:\n  sdk: \">=2.0.0-dev.68.0 <3.0.0\"\n\ndependencies:\n  flutter:\n    sdk: flutter\n\n  cupertino_icons: ^0.1.3\n  image_picker: ^0.7.4\n\ndev_dependencies:\n  flutter_test:\n    sdk: flutter\n\n  image_crop:\n    path: ../\n\nflutter:\n  uses-material-design: true\n"
  },
  {
    "path": "ios/.gitignore",
    "content": ".idea/\n.vagrant/\n.sconsign.dblite\n.svn/\n\n.DS_Store\n*.swp\nprofile\n\nDerivedData/\nbuild/\nGeneratedPluginRegistrant.h\nGeneratedPluginRegistrant.m\n\n.generated/\n\n*.pbxuser\n*.mode1v3\n*.mode2v3\n*.perspectivev3\n\n!default.pbxuser\n!default.mode1v3\n!default.mode2v3\n!default.perspectivev3\n\nxcuserdata\n\n*.moved-aside\n\n*.pyc\n*sync/\nIcon?\n.tags*\n\n/Flutter/Generated.xcconfig\n"
  },
  {
    "path": "ios/Assets/.gitkeep",
    "content": ""
  },
  {
    "path": "ios/Classes/ImageCropPlugin.h",
    "content": "#import <Flutter/Flutter.h>\n\n@interface ImageCropPlugin : NSObject<FlutterPlugin>\n@end\n"
  },
  {
    "path": "ios/Classes/ImageCropPlugin.m",
    "content": "#import \"ImageCropPlugin.h\"\n\n#import <Photos/Photos.h>\n#import <MobileCoreServices/MobileCoreServices.h>\n\n@implementation ImageCropPlugin\n\n+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {\n  FlutterMethodChannel* channel = [FlutterMethodChannel\n                                   methodChannelWithName:@\"plugins.lykhonis.com/image_crop\"\n                                   binaryMessenger:[registrar messenger]];\n  ImageCropPlugin* instance = [ImageCropPlugin new];\n  [registrar addMethodCallDelegate:instance channel:channel];\n}\n\n- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {\n    if ([@\"cropImage\" isEqualToString:call.method]) {\n        NSString* path = (NSString*)call.arguments[@\"path\"];\n        NSNumber* left = (NSNumber*)call.arguments[@\"left\"];\n        NSNumber* top = (NSNumber*)call.arguments[@\"top\"];\n        NSNumber* right = (NSNumber*)call.arguments[@\"right\"];\n        NSNumber* bottom = (NSNumber*)call.arguments[@\"bottom\"];\n        NSNumber* scale = (NSNumber*)call.arguments[@\"scale\"];\n        CGRect area = CGRectMake(left.floatValue, top.floatValue,\n                                 right.floatValue - left.floatValue,\n                                 bottom.floatValue - top.floatValue);\n        [self cropImage:path area:area scale:scale result:result];\n    } else if ([@\"sampleImage\" isEqualToString:call.method]) {\n        NSString* path = (NSString*)call.arguments[@\"path\"];\n        NSNumber* maximumWidth = (NSNumber*)call.arguments[@\"maximumWidth\"];\n        NSNumber* maximumHeight = (NSNumber*)call.arguments[@\"maximumHeight\"];\n        [self sampleImage:path\n             maximumWidth:maximumWidth\n            maximumHeight:maximumHeight\n                   result:result];\n    } else if ([@\"getImageOptions\" isEqualToString:call.method]) {\n        NSString* path = (NSString*)call.arguments[@\"path\"];\n        [self getImageOptions:path result:result];\n    } else if ([@\"requestPermissions\" isEqualToString:call.method]){\n        [self requestPermissionsWithResult:result];\n    } else {\n        result(FlutterMethodNotImplemented);\n    }\n}\n\n- (void)cropImage:(NSString*)path\n             area:(CGRect)area\n            scale:(NSNumber*)scale\n           result:(FlutterResult)result {\n    [self execute:^{\n        NSURL* url = [NSURL fileURLWithPath:path];\n        CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef) url, NULL);\n        \n        if (imageSource == NULL) {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image source cannot be opened\"\n                                       details:nil]);\n            return;\n        }\n\n        CFDictionaryRef options = (__bridge CFDictionaryRef) @{\n                                                               (id) kCGImageSourceCreateThumbnailWithTransform: @YES,\n                                                               (id) kCGImageSourceCreateThumbnailFromImageAlways: @YES\n                                                               };\n\n        CGImageRef image = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options);\n        \n\n        if (image == NULL) {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image cannot be opened\"\n                                       details:nil]);\n            CFRelease(imageSource);\n            return;\n        }\n        \n        size_t width = CGImageGetWidth(image);\n        size_t height = CGImageGetHeight(image);\n        size_t scaledWidth = (size_t) (width * area.size.width * scale.floatValue);\n        size_t scaledHeight = (size_t) (height * area.size.height * scale.floatValue);\n        size_t bitsPerComponent = CGImageGetBitsPerComponent(image);\n        size_t bytesPerRow = CGImageGetBytesPerRow(image) / width * scaledWidth;\n        CGImageAlphaInfo bitmapInfo = CGImageGetAlphaInfo(image);\n        CGColorSpaceRef colorspace = CGImageGetColorSpace(image);\n        \n        CGImageRef croppedImage = CGImageCreateWithImageInRect(image,\n                                                               CGRectMake(width * area.origin.x,\n                                                                          height * area.origin.y,\n                                                                          width * area.size.width,\n                                                                          height * area.size.height));\n        \n        CFRelease(image);\n        CFRelease(imageSource);\n        \n        if (scale.floatValue != 1.0) {\n            CGContextRef context = CGBitmapContextCreate(NULL,\n                                                         scaledWidth,\n                                                         scaledHeight,\n                                                         bitsPerComponent,\n                                                         bytesPerRow,\n                                                         colorspace,\n                                                         bitmapInfo);\n            \n            if (context == NULL) {\n                result([FlutterError errorWithCode:@\"INVALID\"\n                                           message:@\"Image cannot be scaled\"\n                                           details:nil]);\n                CFRelease(croppedImage);\n                return;\n            }\n            \n            CGRect rect = CGContextGetClipBoundingBox(context);\n            CGContextDrawImage(context, rect, croppedImage);\n            \n            CGImageRef scaledImage = CGBitmapContextCreateImage(context);\n            \n            CGContextRelease(context);\n            CFRelease(croppedImage);\n            \n            croppedImage = scaledImage;\n        }\n        \n        NSURL* croppedUrl = [self createTemporaryImageUrl];\n        bool saved = [self saveImage:croppedImage url:croppedUrl];\n        CFRelease(croppedImage);\n        \n        if (saved) {\n            result(croppedUrl.path);\n        } else {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Cropped image cannot be saved\"\n                                       details:nil]);\n        }\n    }];\n}\n\n- (void)sampleImage:(NSString*)path\n       maximumWidth:(NSNumber*)maximumWidth\n      maximumHeight:(NSNumber*)maximumHeight\n             result:(FlutterResult)result {\n    [self execute:^{\n        NSURL* url = [NSURL fileURLWithPath:path];\n        CGImageSourceRef image = CGImageSourceCreateWithURL((CFURLRef) url, NULL);\n        \n        if (image == NULL) {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image source cannot be opened\"\n                                       details:nil]);\n            return;\n        }\n\n        CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(image, 0, nil);\n\n        if (properties == NULL) {\n            CFRelease(image);\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image source properties cannot be copied\"\n                                       details:nil]);\n            return;\n        }\n\n        NSNumber* width = (NSNumber*) CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth);\n        NSNumber* height = (NSNumber*) CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight);\n        CFRelease(properties);\n\n        double widthRatio = MIN(1.0, maximumWidth.doubleValue / width.doubleValue);\n        double heightRatio = MIN(1.0, maximumHeight.doubleValue / height.doubleValue);\n        double ratio = MAX(widthRatio, heightRatio);\n        NSNumber* maximumSize = @(MAX(width.doubleValue * ratio, height.doubleValue * ratio));\n\n        CFDictionaryRef options = (__bridge CFDictionaryRef) @{\n                                                               (id) kCGImageSourceCreateThumbnailWithTransform: @YES,\n                                                               (id) kCGImageSourceCreateThumbnailFromImageAlways : @YES,\n                                                               (id) kCGImageSourceThumbnailMaxPixelSize : maximumSize\n                                                               };\n        CGImageRef sampleImage = CGImageSourceCreateThumbnailAtIndex(image, 0, options);\n        CFRelease(image);\n\n        if (sampleImage == NULL) {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image sample cannot be created\"\n                                       details:nil]);\n            return;\n        }\n\n        NSURL* sampleUrl = [self createTemporaryImageUrl];\n        bool saved = [self saveImage:sampleImage url:sampleUrl];\n        CFRelease(sampleImage);\n        \n        if (saved) {\n            result(sampleUrl.path);\n        } else {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image sample cannot be saved\"\n                                       details:nil]);\n        }\n    }];\n}\n\n- (void)getImageOptions:(NSString*)path result:(FlutterResult)result {\n    [self execute:^{\n        NSURL* url = [NSURL fileURLWithPath:path];\n        CGImageSourceRef image = CGImageSourceCreateWithURL((CFURLRef) url, NULL);\n        \n        if (image == NULL) {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image source cannot be opened\"\n                                       details:nil]);\n            return;\n        }\n\n        CFDictionaryRef properties = CGImageSourceCopyPropertiesAtIndex(image, 0, nil);\n        CFRelease(image);\n        \n        if (properties == NULL) {\n            result([FlutterError errorWithCode:@\"INVALID\"\n                                       message:@\"Image source properties cannot be copied\"\n                                       details:nil]);\n            return;\n        }\n\n        NSNumber* width = (NSNumber*) CFDictionaryGetValue(properties, kCGImagePropertyPixelWidth);\n        NSNumber* height = (NSNumber*) CFDictionaryGetValue(properties, kCGImagePropertyPixelHeight);\n        CFRelease(properties);\n\n        result(@{ @\"width\": width,  @\"height\": height });\n    }];\n}\n\n- (void)requestPermissionsWithResult:(FlutterResult)result {\n    [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {\n        if (status == PHAuthorizationStatusAuthorized) {\n            result(@YES);\n        } else {\n            result(@NO);\n        }\n    }];\n}\n\n- (bool)saveImage:(CGImageRef)image url:(NSURL*)url {\n    CGImageDestinationRef destination = CGImageDestinationCreateWithURL((CFURLRef) url, kUTTypeJPEG, 1, NULL);\n    CGImageDestinationAddImage(destination, image, NULL);\n    \n    bool finilized = CGImageDestinationFinalize(destination);\n    CFRelease(destination);\n    \n    return finilized;\n}\n\n- (NSURL*)createTemporaryImageUrl {\n    NSString* temproraryDirectory = NSTemporaryDirectory();\n    NSString* guid = [[NSProcessInfo processInfo] globallyUniqueString];\n    NSString* sampleName = [[@\"image_crop_\" stringByAppendingString:guid] stringByAppendingString:@\".jpg\"];\n    NSString* samplePath = [temproraryDirectory stringByAppendingPathComponent:sampleName];\n    return [NSURL fileURLWithPath:samplePath];\n}\n\n- (void)execute:(void (^)(void))block {\n    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);\n}\n\n@end\n"
  },
  {
    "path": "ios/image_crop.podspec",
    "content": "#\n# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html\n#\nPod::Spec.new do |s|\n  s.name             = 'image_crop'\n  s.version          = '0.0.1'\n  s.summary          = 'A flutter plugin to crop image on iOS and Android.'\n  s.description      = <<-DESC\nA flutter plugin to crop image on iOS and Android.\n                       DESC\n  s.homepage         = 'http://example.com'\n  s.license          = { :file => '../LICENSE' }\n  s.author           = { 'Your Company' => 'email@example.com' }\n  s.source           = { :path => '.' }\n  s.source_files = 'Classes/**/*'\n  s.public_header_files = 'Classes/**/*.h'\n  s.dependency 'Flutter'\n  \n  s.ios.deployment_target = '8.0'\nend\n\n"
  },
  {
    "path": "lib/image_crop.dart",
    "content": "library image_crop;\n\nimport 'dart:async';\nimport 'dart:io';\nimport 'dart:math';\nimport 'dart:ui' as ui;\n\nimport 'package:flutter/gestures.dart';\nimport 'package:flutter/widgets.dart';\nimport 'package:flutter/services.dart';\n\npart 'src/image_crop.dart';\npart 'src/crop.dart';\n"
  },
  {
    "path": "lib/src/crop.dart",
    "content": "part of image_crop;\n\nconst _kCropGridColumnCount = 3;\nconst _kCropGridRowCount = 3;\nconst _kCropGridColor = Color.fromRGBO(0xd0, 0xd0, 0xd0, 0.9);\nconst _kCropOverlayActiveOpacity = 0.3;\nconst _kCropOverlayInactiveOpacity = 0.7;\nconst _kCropHandleColor = Color.fromRGBO(0xd0, 0xd0, 0xd0, 1.0);\nconst _kCropHandleSize = 10.0;\nconst _kCropHandleHitSize = 48.0;\nconst _kCropMinFraction = 0.1;\n\nenum _CropAction { none, moving, cropping, scaling }\n\nenum _CropHandleSide { none, topLeft, topRight, bottomLeft, bottomRight }\n\nclass Crop extends StatefulWidget {\n  final ImageProvider image;\n  final double? aspectRatio;\n  final double maximumScale;\n  final bool alwaysShowGrid;\n  final ImageErrorListener? onImageError;\n\n  const Crop({\n    Key? key,\n    required this.image,\n    this.aspectRatio,\n    this.maximumScale = 2.0,\n    this.alwaysShowGrid = false,\n    this.onImageError,\n  }) : super(key: key);\n\n  Crop.file(\n    File file, {\n    Key? key,\n    double scale = 1.0,\n    this.aspectRatio,\n    this.maximumScale = 2.0,\n    this.alwaysShowGrid = false,\n    this.onImageError,\n  })  : image = FileImage(file, scale: scale),\n        super(key: key);\n\n  Crop.asset(\n    String assetName, {\n    Key? key,\n    AssetBundle? bundle,\n    String? package,\n    this.aspectRatio,\n    this.maximumScale = 2.0,\n    this.alwaysShowGrid = false,\n    this.onImageError,\n  })  : image = AssetImage(assetName, bundle: bundle, package: package),\n        super(key: key);\n\n  @override\n  State<StatefulWidget> createState() => CropState();\n\n  static CropState? of(BuildContext context) =>\n      context.findAncestorStateOfType<CropState>();\n}\n\nclass CropState extends State<Crop> with TickerProviderStateMixin, Drag {\n  final _surfaceKey = GlobalKey();\n\n  late final AnimationController _activeController;\n  late final AnimationController _settleController;\n\n  double _scale = 1.0;\n  double _ratio = 1.0;\n  Rect _view = Rect.zero;\n  Rect _area = Rect.zero;\n  Offset _lastFocalPoint = Offset.zero;\n  _CropAction _action = _CropAction.none;\n  _CropHandleSide _handle = _CropHandleSide.none;\n\n  late double _startScale;\n  late Rect _startView;\n  late Tween<Rect?> _viewTween;\n  late Tween<double> _scaleTween;\n\n  ImageStream? _imageStream;\n  ui.Image? _image;\n  ImageStreamListener? _imageListener;\n\n  double get scale => _area.shortestSide / _scale;\n\n  Rect? get area => _view.isEmpty\n      ? null\n      : Rect.fromLTWH(\n          max(_area.left * _view.width / _scale - _view.left, 0),\n          max(_area.top * _view.height / _scale - _view.top, 0),\n          _area.width * _view.width / _scale,\n          _area.height * _view.height / _scale,\n        );\n\n  bool get _isEnabled => _view.isEmpty == false && _image != null;\n\n  // Saving the length for the widest area for different aspectRatio's\n  final Map<double, double> _maxAreaWidthMap = {};\n\n  // Counting pointers(number of user fingers on screen)\n  int pointers = 0;\n\n  @override\n  void initState() {\n    super.initState();\n\n    _activeController = AnimationController(\n      vsync: this,\n      value: widget.alwaysShowGrid ? 1.0 : 0.0,\n    )..addListener(() => setState(() {}));\n    _settleController = AnimationController(vsync: this)\n      ..addListener(_settleAnimationChanged);\n  }\n\n  @override\n  void dispose() {\n    final listener = _imageListener;\n    if (listener != null) {\n      _imageStream?.removeListener(listener);\n    }\n    _activeController.dispose();\n    _settleController.dispose();\n\n    super.dispose();\n  }\n\n  @override\n  void didChangeDependencies() {\n    super.didChangeDependencies();\n\n    _getImage();\n  }\n\n  @override\n  void didUpdateWidget(Crop oldWidget) {\n    super.didUpdateWidget(oldWidget);\n\n    if (widget.image != oldWidget.image) {\n      _getImage();\n    } else if (widget.aspectRatio != oldWidget.aspectRatio) {\n      _area = _calculateDefaultArea(\n        viewWidth: _view.width,\n        viewHeight: _view.height,\n        imageWidth: _image?.width,\n        imageHeight: _image?.height,\n      );\n    }\n    if (widget.alwaysShowGrid != oldWidget.alwaysShowGrid) {\n      if (widget.alwaysShowGrid) {\n        _activate();\n      } else {\n        _deactivate();\n      }\n    }\n  }\n\n  void _getImage({bool force = false}) {\n    final oldImageStream = _imageStream;\n    final newImageStream =\n        widget.image.resolve(createLocalImageConfiguration(context));\n    _imageStream = newImageStream;\n    if (newImageStream.key != oldImageStream?.key || force) {\n      final oldImageListener = _imageListener;\n      if (oldImageListener != null) {\n        oldImageStream?.removeListener(oldImageListener);\n      }\n      final newImageListener =\n          ImageStreamListener(_updateImage, onError: widget.onImageError);\n      _imageListener = newImageListener;\n      newImageStream.addListener(newImageListener);\n    }\n  }\n\n  @override\n  Widget build(BuildContext context) => ConstrainedBox(\n        constraints: const BoxConstraints.expand(),\n        child: Listener(\n          onPointerDown: (event) => pointers++,\n          onPointerUp: (event) => pointers = 0,\n          child: GestureDetector(\n            key: _surfaceKey,\n            behavior: HitTestBehavior.opaque,\n            onScaleStart: _isEnabled ? _handleScaleStart : null,\n            onScaleUpdate: _isEnabled ? _handleScaleUpdate : null,\n            onScaleEnd: _isEnabled ? _handleScaleEnd : null,\n            child: CustomPaint(\n              painter: _CropPainter(\n                image: _image,\n                ratio: _ratio,\n                view: _view,\n                area: _area,\n                scale: _scale,\n                active: _activeController.value,\n              ),\n            ),\n          ),\n        ),\n      );\n\n  void _activate() {\n    _activeController.animateTo(\n      1.0,\n      curve: Curves.fastOutSlowIn,\n      duration: const Duration(milliseconds: 250),\n    );\n  }\n\n  void _deactivate() {\n    if (widget.alwaysShowGrid == false) {\n      _activeController.animateTo(\n        0.0,\n        curve: Curves.fastOutSlowIn,\n        duration: const Duration(milliseconds: 250),\n      );\n    }\n  }\n\n  Size? get _boundaries {\n    final context = _surfaceKey.currentContext;\n    if (context == null) {\n      return null;\n    }\n\n    final size = context.size;\n    if (size == null) {\n      return null;\n    }\n\n    return size - const Offset(_kCropHandleSize, _kCropHandleSize) as Size;\n  }\n\n  Offset? _getLocalPoint(Offset point) {\n    final context = _surfaceKey.currentContext;\n    if (context == null) {\n      return null;\n    }\n\n    final box = context.findRenderObject() as RenderBox;\n\n    return box.globalToLocal(point);\n  }\n\n  void _settleAnimationChanged() {\n    setState(() {\n      _scale = _scaleTween.transform(_settleController.value);\n      final nextView = _viewTween.transform(_settleController.value);\n      if (nextView != null) {\n        _view = nextView;\n      }\n    });\n  }\n\n  Rect _calculateDefaultArea({\n    required int? imageWidth,\n    required int? imageHeight,\n    required double viewWidth,\n    required double viewHeight,\n  }) {\n    if (imageWidth == null || imageHeight == null) {\n      return Rect.zero;\n    }\n\n    double height;\n    double width;\n    if ((widget.aspectRatio ?? 1.0) < 1) {\n      height = 1.0;\n      width =\n          ((widget.aspectRatio ?? 1.0) * imageHeight * viewHeight * height) /\n              imageWidth /\n              viewWidth;\n      if (width > 1.0) {\n        width = 1.0;\n        height = (imageWidth * viewWidth * width) /\n            (imageHeight * viewHeight * (widget.aspectRatio ?? 1.0));\n      }\n    } else {\n      width = 1.0;\n      height = (imageWidth * viewWidth * width) /\n          (imageHeight * viewHeight * (widget.aspectRatio ?? 1.0));\n      if (height > 1.0) {\n        height = 1.0;\n        width =\n            ((widget.aspectRatio ?? 1.0) * imageHeight * viewHeight * height) /\n                imageWidth /\n                viewWidth;\n      }\n    }\n    final aspectRatio = _maxAreaWidthMap[widget.aspectRatio];\n    if (aspectRatio != null) {\n      _maxAreaWidthMap[aspectRatio] = width;\n    }\n\n    return Rect.fromLTWH((1.0 - width) / 2, (1.0 - height) / 2, width, height);\n  }\n\n  void _updateImage(ImageInfo imageInfo, bool synchronousCall) {\n    final boundaries = _boundaries;\n    if (boundaries == null) {\n      return;\n    }\n\n    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {\n      final image = imageInfo.image;\n\n      setState(() {\n        _image = image;\n        _scale = imageInfo.scale;\n        _ratio = max(\n          boundaries.width / image.width,\n          boundaries.height / image.height,\n        );\n\n        final viewWidth = boundaries.width / (image.width * _scale * _ratio);\n        final viewHeight = boundaries.height / (image.height * _scale * _ratio);\n        _area = _calculateDefaultArea(\n          viewWidth: viewWidth,\n          viewHeight: viewHeight,\n          imageWidth: image.width,\n          imageHeight: image.height,\n        );\n        _view = Rect.fromLTWH(\n          (viewWidth - 1.0) / 2,\n          (viewHeight - 1.0) / 2,\n          viewWidth,\n          viewHeight,\n        );\n      });\n    });\n\n    WidgetsBinding.instance.ensureVisualUpdate();\n  }\n\n  _CropHandleSide _hitCropHandle(Offset? localPoint) {\n    final boundaries = _boundaries;\n    if (localPoint == null || boundaries == null) {\n      return _CropHandleSide.none;\n    }\n\n    final viewRect = Rect.fromLTWH(\n      boundaries.width * _area.left,\n      boundaries.height * _area.top,\n      boundaries.width * _area.width,\n      boundaries.height * _area.height,\n    ).deflate(_kCropHandleSize / 2);\n\n    if (Rect.fromLTWH(\n      viewRect.left - _kCropHandleHitSize / 2,\n      viewRect.top - _kCropHandleHitSize / 2,\n      _kCropHandleHitSize,\n      _kCropHandleHitSize,\n    ).contains(localPoint)) {\n      return _CropHandleSide.topLeft;\n    }\n\n    if (Rect.fromLTWH(\n      viewRect.right - _kCropHandleHitSize / 2,\n      viewRect.top - _kCropHandleHitSize / 2,\n      _kCropHandleHitSize,\n      _kCropHandleHitSize,\n    ).contains(localPoint)) {\n      return _CropHandleSide.topRight;\n    }\n\n    if (Rect.fromLTWH(\n      viewRect.left - _kCropHandleHitSize / 2,\n      viewRect.bottom - _kCropHandleHitSize / 2,\n      _kCropHandleHitSize,\n      _kCropHandleHitSize,\n    ).contains(localPoint)) {\n      return _CropHandleSide.bottomLeft;\n    }\n\n    if (Rect.fromLTWH(\n      viewRect.right - _kCropHandleHitSize / 2,\n      viewRect.bottom - _kCropHandleHitSize / 2,\n      _kCropHandleHitSize,\n      _kCropHandleHitSize,\n    ).contains(localPoint)) {\n      return _CropHandleSide.bottomRight;\n    }\n\n    return _CropHandleSide.none;\n  }\n\n  void _handleScaleStart(ScaleStartDetails details) {\n    _activate();\n    _settleController.stop(canceled: false);\n    _lastFocalPoint = details.focalPoint;\n    _action = _CropAction.none;\n    _handle = _hitCropHandle(_getLocalPoint(details.focalPoint));\n    _startScale = _scale;\n    _startView = _view;\n  }\n\n  Rect _getViewInBoundaries(double scale) =>\n      Offset(\n        max(\n          min(\n            _view.left,\n            _area.left * _view.width / scale,\n          ),\n          _area.right * _view.width / scale - 1.0,\n        ),\n        max(\n          min(\n            _view.top,\n            _area.top * _view.height / scale,\n          ),\n          _area.bottom * _view.height / scale - 1.0,\n        ),\n      ) &\n      _view.size;\n\n  double get _maximumScale => widget.maximumScale;\n\n  double? get _minimumScale {\n    final boundaries = _boundaries;\n    final image = _image;\n    if (boundaries == null || image == null) {\n      return null;\n    }\n\n    final scaleX = boundaries.width * _area.width / (image.width * _ratio);\n    final scaleY = boundaries.height * _area.height / (image.height * _ratio);\n    return min(_maximumScale, max(scaleX, scaleY));\n  }\n\n  void _handleScaleEnd(ScaleEndDetails details) {\n    _deactivate();\n    final minimumScale = _minimumScale;\n    if (minimumScale == null) {\n      return;\n    }\n\n    final targetScale = _scale.clamp(minimumScale, _maximumScale);\n    _scaleTween = Tween<double>(\n      begin: _scale,\n      end: targetScale,\n    );\n\n    _startView = _view;\n    _viewTween = RectTween(\n      begin: _view,\n      end: _getViewInBoundaries(targetScale),\n    );\n\n    _settleController.value = 0.0;\n    _settleController.animateTo(\n      1.0,\n      curve: Curves.fastOutSlowIn,\n      duration: const Duration(milliseconds: 350),\n    );\n  }\n\n  void _updateArea({\n    required _CropHandleSide cropHandleSide,\n    double? left,\n    double? top,\n    double? right,\n    double? bottom,\n  }) {\n    final image = _image;\n    if (image == null) {\n      return;\n    }\n\n    var areaLeft = _area.left + (left ?? 0.0);\n    var areaBottom = _area.bottom + (bottom ?? 0.0);\n    var areaTop = _area.top + (top ?? 0.0);\n    var areaRight = _area.right + (right ?? 0.0);\n    double width = areaRight - areaLeft;\n    double height = (image.width * _view.width * width) /\n        (image.height * _view.height * (widget.aspectRatio ?? 1.0));\n    final maxAreaWidth = _maxAreaWidthMap[widget.aspectRatio];\n    if ((height >= 1.0 || width >= 1.0) && maxAreaWidth != null) {\n      height = 1.0;\n\n      if (cropHandleSide == _CropHandleSide.bottomLeft ||\n          cropHandleSide == _CropHandleSide.topLeft) {\n        areaLeft = areaRight - maxAreaWidth;\n      } else {\n        areaRight = areaLeft + maxAreaWidth;\n      }\n    }\n\n    // ensure minimum rectangle\n    if (areaRight - areaLeft < _kCropMinFraction) {\n      if (left != null) {\n        areaLeft = areaRight - _kCropMinFraction;\n      } else {\n        areaRight = areaLeft + _kCropMinFraction;\n      }\n    }\n\n    if (areaBottom - areaTop < _kCropMinFraction) {\n      if (top != null) {\n        areaTop = areaBottom - _kCropMinFraction;\n      } else {\n        areaBottom = areaTop + _kCropMinFraction;\n      }\n    }\n\n    // adjust to aspect ratio if needed\n    final aspectRatio = widget.aspectRatio;\n    if (aspectRatio != null && aspectRatio > 0.0) {\n      if (top != null) {\n        areaTop = areaBottom - height;\n        if (areaTop < 0.0) {\n          areaTop = 0.0;\n          areaBottom = height;\n        }\n      } else {\n        areaBottom = areaTop + height;\n        if (areaBottom > 1.0) {\n          areaTop = 1.0 - height;\n          areaBottom = 1.0;\n        }\n      }\n    }\n\n    // ensure to remain within bounds of the view\n    if (areaLeft < 0.0) {\n      areaLeft = 0.0;\n      areaRight = _area.width;\n    } else if (areaRight > 1.0) {\n      areaLeft = 1.0 - _area.width;\n      areaRight = 1.0;\n    }\n\n    if (areaTop < 0.0) {\n      areaTop = 0.0;\n      areaBottom = _area.height;\n    } else if (areaBottom > 1.0) {\n      areaTop = 1.0 - _area.height;\n      areaBottom = 1.0;\n    }\n\n    setState(() {\n      _area = Rect.fromLTRB(areaLeft, areaTop, areaRight, areaBottom);\n    });\n  }\n\n  void _handleScaleUpdate(ScaleUpdateDetails details) {\n    if (_action == _CropAction.none) {\n      if (_handle == _CropHandleSide.none) {\n        _action = pointers == 2 ? _CropAction.scaling : _CropAction.moving;\n      } else {\n        _action = _CropAction.cropping;\n      }\n    }\n\n    if (_action == _CropAction.cropping) {\n      final boundaries = _boundaries;\n      if (boundaries == null) {\n        return;\n      }\n\n      final delta = details.focalPoint - _lastFocalPoint;\n      _lastFocalPoint = details.focalPoint;\n\n      final dx = delta.dx / boundaries.width;\n      final dy = delta.dy / boundaries.height;\n\n      if (_handle == _CropHandleSide.topLeft) {\n        _updateArea(left: dx, top: dy, cropHandleSide: _CropHandleSide.topLeft);\n      } else if (_handle == _CropHandleSide.topRight) {\n        _updateArea(\n            top: dy, right: dx, cropHandleSide: _CropHandleSide.topRight);\n      } else if (_handle == _CropHandleSide.bottomLeft) {\n        _updateArea(\n            left: dx, bottom: dy, cropHandleSide: _CropHandleSide.bottomLeft);\n      } else if (_handle == _CropHandleSide.bottomRight) {\n        _updateArea(\n            right: dx, bottom: dy, cropHandleSide: _CropHandleSide.bottomRight);\n      }\n    } else if (_action == _CropAction.moving) {\n      final image = _image;\n      if (image == null) {\n        return;\n      }\n\n      final delta = details.focalPoint - _lastFocalPoint;\n      _lastFocalPoint = details.focalPoint;\n\n      setState(() {\n        _view = _view.translate(\n          delta.dx / (image.width * _scale * _ratio),\n          delta.dy / (image.height * _scale * _ratio),\n        );\n      });\n    } else if (_action == _CropAction.scaling) {\n      final image = _image;\n      final boundaries = _boundaries;\n      if (image == null || boundaries == null) {\n        return;\n      }\n\n      setState(() {\n        _scale = _startScale * details.scale;\n\n        final dx = boundaries.width *\n            (1.0 - details.scale) /\n            (image.width * _scale * _ratio);\n        final dy = boundaries.height *\n            (1.0 - details.scale) /\n            (image.height * _scale * _ratio);\n\n        _view = Rect.fromLTWH(\n          _startView.left + dx / 2,\n          _startView.top + dy / 2,\n          _startView.width,\n          _startView.height,\n        );\n      });\n    }\n  }\n}\n\nclass _CropPainter extends CustomPainter {\n  final ui.Image? image;\n  final Rect view;\n  final double ratio;\n  final Rect area;\n  final double scale;\n  final double active;\n\n  _CropPainter({\n    required this.image,\n    required this.view,\n    required this.ratio,\n    required this.area,\n    required this.scale,\n    required this.active,\n  });\n\n  @override\n  bool shouldRepaint(_CropPainter oldDelegate) {\n    return oldDelegate.image != image ||\n        oldDelegate.view != view ||\n        oldDelegate.ratio != ratio ||\n        oldDelegate.area != area ||\n        oldDelegate.active != active ||\n        oldDelegate.scale != scale;\n  }\n\n  @override\n  void paint(Canvas canvas, Size size) {\n    final rect = Rect.fromLTWH(\n      _kCropHandleSize / 2,\n      _kCropHandleSize / 2,\n      size.width - _kCropHandleSize,\n      size.height - _kCropHandleSize,\n    );\n\n    canvas.save();\n    canvas.translate(rect.left, rect.top);\n\n    final paint = Paint()..isAntiAlias = false;\n\n    final image = this.image;\n    if (image != null) {\n      final src = Rect.fromLTWH(\n        0.0,\n        0.0,\n        image.width.toDouble(),\n        image.height.toDouble(),\n      );\n      final dst = Rect.fromLTWH(\n        view.left * image.width * scale * ratio,\n        view.top * image.height * scale * ratio,\n        image.width * scale * ratio,\n        image.height * scale * ratio,\n      );\n\n      canvas.save();\n      canvas.clipRect(Rect.fromLTWH(0.0, 0.0, rect.width, rect.height));\n      canvas.drawImageRect(image, src, dst, paint);\n      canvas.restore();\n    }\n\n    paint.color = Color.fromRGBO(\n        0x0,\n        0x0,\n        0x0,\n        _kCropOverlayActiveOpacity * active +\n            _kCropOverlayInactiveOpacity * (1.0 - active));\n    final boundaries = Rect.fromLTWH(\n      rect.width * area.left,\n      rect.height * area.top,\n      rect.width * area.width,\n      rect.height * area.height,\n    );\n    canvas.drawRect(Rect.fromLTRB(0.0, 0.0, rect.width, boundaries.top), paint);\n    canvas.drawRect(\n        Rect.fromLTRB(0.0, boundaries.bottom, rect.width, rect.height), paint);\n    canvas.drawRect(\n        Rect.fromLTRB(0.0, boundaries.top, boundaries.left, boundaries.bottom),\n        paint);\n    canvas.drawRect(\n        Rect.fromLTRB(\n            boundaries.right, boundaries.top, rect.width, boundaries.bottom),\n        paint);\n\n    if (boundaries.isEmpty == false) {\n      _drawGrid(canvas, boundaries);\n      _drawHandles(canvas, boundaries);\n    }\n\n    canvas.restore();\n  }\n\n  void _drawHandles(Canvas canvas, Rect boundaries) {\n    final paint = Paint()\n      ..isAntiAlias = true\n      ..color = _kCropHandleColor;\n\n    canvas.drawOval(\n      Rect.fromLTWH(\n        boundaries.left - _kCropHandleSize / 2,\n        boundaries.top - _kCropHandleSize / 2,\n        _kCropHandleSize,\n        _kCropHandleSize,\n      ),\n      paint,\n    );\n\n    canvas.drawOval(\n      Rect.fromLTWH(\n        boundaries.right - _kCropHandleSize / 2,\n        boundaries.top - _kCropHandleSize / 2,\n        _kCropHandleSize,\n        _kCropHandleSize,\n      ),\n      paint,\n    );\n\n    canvas.drawOval(\n      Rect.fromLTWH(\n        boundaries.right - _kCropHandleSize / 2,\n        boundaries.bottom - _kCropHandleSize / 2,\n        _kCropHandleSize,\n        _kCropHandleSize,\n      ),\n      paint,\n    );\n\n    canvas.drawOval(\n      Rect.fromLTWH(\n        boundaries.left - _kCropHandleSize / 2,\n        boundaries.bottom - _kCropHandleSize / 2,\n        _kCropHandleSize,\n        _kCropHandleSize,\n      ),\n      paint,\n    );\n  }\n\n  void _drawGrid(Canvas canvas, Rect boundaries) {\n    if (active == 0.0) return;\n\n    final paint = Paint()\n      ..isAntiAlias = false\n      ..color = _kCropGridColor.withOpacity(_kCropGridColor.opacity * active)\n      ..style = PaintingStyle.stroke\n      ..strokeWidth = 1.0;\n\n    final path = Path()\n      ..moveTo(boundaries.left, boundaries.top)\n      ..lineTo(boundaries.right, boundaries.top)\n      ..lineTo(boundaries.right, boundaries.bottom)\n      ..lineTo(boundaries.left, boundaries.bottom)\n      ..lineTo(boundaries.left, boundaries.top);\n\n    for (var column = 1; column < _kCropGridColumnCount; column++) {\n      path\n        ..moveTo(\n            boundaries.left + column * boundaries.width / _kCropGridColumnCount,\n            boundaries.top)\n        ..lineTo(\n            boundaries.left + column * boundaries.width / _kCropGridColumnCount,\n            boundaries.bottom);\n    }\n\n    for (var row = 1; row < _kCropGridRowCount; row++) {\n      path\n        ..moveTo(boundaries.left,\n            boundaries.top + row * boundaries.height / _kCropGridRowCount)\n        ..lineTo(boundaries.right,\n            boundaries.top + row * boundaries.height / _kCropGridRowCount);\n    }\n\n    canvas.drawPath(path, paint);\n  }\n}\n"
  },
  {
    "path": "lib/src/image_crop.dart",
    "content": "part of image_crop;\n\nclass ImageOptions {\n  final int width;\n  final int height;\n\n  ImageOptions({\n    required this.width,\n    required this.height,\n  });\n\n  @override\n  int get hashCode => hashValues(width, height);\n\n  @override\n  bool operator ==(other) =>\n      other is ImageOptions && other.width == width && other.height == height;\n\n  @override\n  String toString() => '$runtimeType(width: $width, height: $height)';\n}\n\nclass ImageCrop {\n  static const _channel =\n      const MethodChannel('plugins.lykhonis.com/image_crop');\n\n  static Future<bool> requestPermissions() => _channel\n      .invokeMethod('requestPermissions')\n      .then<bool>((result) => result);\n\n  static Future<ImageOptions> getImageOptions({\n    required File file,\n  }) async {\n    final result =\n        await _channel.invokeMethod('getImageOptions', {'path': file.path});\n\n    return ImageOptions(\n      width: result['width'],\n      height: result['height'],\n    );\n  }\n\n  static Future<File> cropImage({\n    required File file,\n    required Rect area,\n    double? scale,\n  }) =>\n      _channel.invokeMethod('cropImage', {\n        'path': file.path,\n        'left': area.left,\n        'top': area.top,\n        'right': area.right,\n        'bottom': area.bottom,\n        'scale': scale ?? 1.0,\n      }).then<File>((result) => File(result));\n\n  static Future<File> sampleImage({\n    required File file,\n    int? preferredSize,\n    int? preferredWidth,\n    int? preferredHeight,\n  }) async {\n    assert(() {\n      if (preferredSize == null &&\n          (preferredWidth == null || preferredHeight == null)) {\n        throw ArgumentError(\n            'Preferred size or both width and height of a resampled image must be specified.');\n      }\n      return true;\n    }());\n\n    final String path = await _channel.invokeMethod('sampleImage', {\n      'path': file.path,\n      'maximumWidth': preferredSize ?? preferredWidth,\n      'maximumHeight': preferredSize ?? preferredHeight,\n    });\n\n    return File(path);\n  }\n}\n"
  },
  {
    "path": "pubspec.yaml",
    "content": "name: image_crop\ndescription: A flutter plugin to crop image on iOS and Android. It processes image files off main thread natively. The plugin provides a Crop widget to display image cropping to a user.\nversion: 0.4.1\nhomepage: https://github.com/VolodymyrLykhonis/image_crop\n\nenvironment:\n  sdk: \">=2.17.0 <3.0.0\"\n  flutter: \">=2.5.0\"\n\ndependencies:\n  flutter:\n    sdk: flutter\n\ndev_dependencies:\n  flutter_test:\n    sdk: flutter\n\nflutter:\n  plugin:\n    platforms:\n      android:\n        package: com.lykhonis.imagecrop\n        pluginClass: ImageCropPlugin\n      ios:\n        pluginClass: ImageCropPlugin\n"
  }
]