├── example
├── ios
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── .gitignore
│ ├── Podfile.lock
│ └── Podfile
├── assets
│ ├── bridge.jpg
│ └── sunset.jpeg
├── preview
│ └── preview1.png
├── android
│ ├── gradle.properties
│ ├── .gitignore
│ ├── app
│ │ ├── src
│ │ │ └── main
│ │ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ └── styles.xml
│ │ │ │ └── drawable
│ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── kotlin
│ │ │ │ └── example
│ │ │ │ │ └── example
│ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── build.gradle
├── README.md
├── lib
│ ├── image_preview_page.dart
│ ├── main.dart
│ ├── helper_page.dart
│ └── widget_page.dart
├── .gitignore
└── pubspec.yaml
├── .gitattributes
├── lib
├── merge_images.dart
└── src
│ ├── merge_painter.dart
│ ├── images_merge.dart
│ └── images_merge_helper.dart
├── CHANGELOG.md
├── .gitignore
├── LICENSE
├── pubspec.yaml
├── README(CH).md
└── README.md
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/example/assets/bridge.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/assets/bridge.jpg
--------------------------------------------------------------------------------
/example/assets/sunset.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/assets/sunset.jpeg
--------------------------------------------------------------------------------
/example/preview/preview1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/preview/preview1.png
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/lib/merge_images.dart:
--------------------------------------------------------------------------------
1 | library merge_images;
2 |
3 | export 'package:merge_images/src/images_merge_helper.dart';
4 | export 'package:merge_images/src/images_merge.dart';
5 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xiaozhizhong/merge_images/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1]
2 |
3 | * initial release
4 |
5 | ## [1.0.0]
6 |
7 | * resolve dependency, format code
8 |
9 | ## [1.0.1]
10 |
11 | * remove unused files
12 |
13 | ## [1.0.2]
14 |
15 | * update ImagesMergeHelper
16 |
17 | ## [1.0.3]
18 |
19 | * fix bugs of ImagesMergeHelper
20 |
21 | ## [2.0.0-nullsafety]
22 | * migrate to null-safety
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You 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.
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package example.example
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | merge images example application.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/lib/image_preview_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:flutter/material.dart';
4 |
5 | ///
6 | ///@author xiaozhizhong
7 | ///@date 2020/4/4
8 | ///@description images preview page
9 | ///
10 | class Preview extends StatelessWidget {
11 | Preview(this.image);
12 |
13 | final Uint8List image;
14 |
15 | @override
16 | Widget build(BuildContext context) {
17 | return Scaffold(
18 | appBar: AppBar(
19 | title: Text("preview"),
20 | ),
21 | body: Container(
22 | alignment: Alignment.center,
23 | padding: EdgeInsets.symmetric(vertical: 50, horizontal: 30),
24 | child: Image.memory(image),
25 | ),
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://www.dartlang.org/guides/libraries/private-files
2 | .idea
3 | .DS_Store
4 | .flutter-plugins/
5 | .flutter-plugins-dependencies/
6 | .metadata
7 | *.iml
8 |
9 | # Files and directories created by pub
10 | .dart_tool/
11 | .packages
12 | .pub/
13 | build/
14 | # If you're building an application, you may want to check-in your pubspec.lock
15 | pubspec.lock
16 |
17 | # Directory created by dartdoc
18 | # If you don't generate documentation locally you can remove this line.
19 | doc/api/
20 |
21 | # Avoid committing generated Javascript files:
22 | *.dart.js
23 | *.info.json # Produced by the --dump-info flag.
24 | *.js # When generated by dart2js. Don't specify *.js if your
25 | # project includes source files written in JavaScript.
26 | *.js_
27 | *.js.deps
28 | *.js.map
29 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - path_provider (0.0.1):
4 | - Flutter
5 | - path_provider_macos (0.0.1):
6 | - Flutter
7 |
8 | DEPENDENCIES:
9 | - Flutter (from `Flutter`)
10 | - path_provider (from `.symlinks/plugins/path_provider/ios`)
11 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
12 |
13 | EXTERNAL SOURCES:
14 | Flutter:
15 | :path: Flutter
16 | path_provider:
17 | :path: ".symlinks/plugins/path_provider/ios"
18 | path_provider_macos:
19 | :path: ".symlinks/plugins/path_provider_macos/ios"
20 |
21 | SPEC CHECKSUMS:
22 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
23 | path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
24 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
25 |
26 | PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83
27 |
28 | COCOAPODS: 1.9.1
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://www.dartlang.org/guides/libraries/private-files
2 | .idea
3 | .DS_Store
4 | .flutter-plugins/
5 | .flutter-plugins-dependencies/
6 | .flutter-plugins
7 | .flutter-plugins-dependencies
8 | .metadata
9 | *.iml
10 | .gradle/
11 |
12 | # Files and directories created by pub
13 | .dart_tool/
14 | .packages
15 | .pub/
16 | build/
17 | # If you're building an application, you may want to check-in your pubspec.lock
18 | pubspec.lock
19 |
20 | # Directory created by dartdoc
21 | # If you don't generate documentation locally you can remove this line.
22 | doc/api/
23 |
24 | # Avoid committing generated Javascript files:
25 | *.dart.js
26 | *.info.json # Produced by the --dump-info flag.
27 | *.js # When generated by dart2js. Don't specify *.js if your
28 | # project includes source files written in JavaScript.
29 | *.js_
30 | *.js.deps
31 | *.js.map
32 |
33 | .fvm/
34 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 xiaozhizhong
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
13 |
20 |
21 |
22 |
23 |
24 |
25 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 | NSAppTransportSecurity
45 |
46 | NSAllowsArbitraryLoads
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: merge_images
2 | description: A package that can merge images into one, support vertical and horizontal direction.
3 | version: 2.0.0-nullsafety
4 | homepage: https://github.com/xiaozhizhong/merge_images
5 |
6 | environment:
7 | sdk: '>=2.12.0 <3.0.0'
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 | path_provider: ^2.0.1
13 |
14 | dev_dependencies:
15 | flutter_test:
16 | sdk: flutter
17 |
18 | # For information on the generic Dart part of this file, see the
19 | # following page: https://dart.dev/tools/pub/pubspec
20 |
21 | # The following section is specific to Flutter.
22 | flutter:
23 |
24 | # To add assets to your package, add an assets section, like this:
25 | # assets:
26 | # - images/a_dot_burr.jpeg
27 | # - images/a_dot_ham.jpeg
28 | #
29 | # For details regarding assets in packages, see
30 | # https://flutter.dev/assets-and-images/#from-packages
31 | #
32 | # An image asset can refer to one or more resolution-specific "variants", see
33 | # https://flutter.dev/assets-and-images/#resolution-aware.
34 |
35 | # To add custom fonts to your package, add a fonts section here,
36 | # in this "flutter" section. Each entry in this list should have a
37 | # "family" key with the font family name, and a "fonts" key with a
38 | # list giving the asset and other descriptors for the font. For
39 | # example:
40 | # fonts:
41 | # - family: Schyler
42 | # fonts:
43 | # - asset: fonts/Schyler-Regular.ttf
44 | # - asset: fonts/Schyler-Italic.ttf
45 | # style: italic
46 | # - family: Trajan Pro
47 | # fonts:
48 | # - asset: fonts/TrajanPro.ttf
49 | # - asset: fonts/TrajanPro_Bold.ttf
50 | # weight: 700
51 | #
52 | # For details regarding fonts in packages, see
53 | # https://flutter.dev/custom-fonts/#from-packages
54 |
--------------------------------------------------------------------------------
/README(CH).md:
--------------------------------------------------------------------------------
1 | # merge_images in flutter
2 |
3 |
4 |
5 | ## 简介
6 | 合并图片(垂直或水平方向)
7 |
8 | 
9 |
10 | ## 特性
11 | * 支持水平和垂直方向
12 | * 提供helper可在代码中合并多张图片并得到合并后的图片,也提供widget直接合并并显示图片。
13 | * 可自动缩放图片以保持一致(垂直时对齐宽度,水平时对齐高度)
14 |
15 | ## 用法
16 | #### ImagesMergeHelper
17 | 使用这个helper在代码中合并图片
18 |
19 | ``` dart
20 | ui.Image image = await ImagesMergeHelper.margeImages(
21 | [assetImage1,assetImage2,providerImage],///必传,图片list
22 | fit: true,///是否缩放图片以保持一致
23 | direction: Axis.vertical,///合并的方向
24 | backgroundColor: Colors.black26);///背景颜色
25 | ```
26 | 此外,它也提供了几个方法做图片类型的转换:
27 | ``` dart
28 | ///ui.Image to Uint8List
29 | Uint8List bytes = await ImagesMergeHelper.imageToUint8List(image);
30 | ///ui.Image to File
31 | File file = await ImagesMergeHelper.imageToFile(image);
32 | ///Uint8List to ui.Image
33 | ui.Image image = await ImagesMergeHelper.uint8ListToImage(imageBytes);
34 | ///file to ui.Image
35 | ui.Image image = await ImagesMergeHelper.loadImageFromFile(file);
36 | ///asset to ui.Image
37 | ui.Image image = await ImagesMergeHelper.loadImageFromAsset(assetPath);
38 | ///ImageProvider to ui.Image
39 | ui.Image image = await ImagesMergeHelper.loadImageFromProvider(imageProvider);
40 |
41 | ```
42 | #### ImageMerge
43 | 使用这个widget直接显示图片
44 | ``` dart
45 | ImagesMerge(
46 | imageList,///必传,图片list
47 | direction: Axis.vertical,///合并方向
48 | backgroundColor: Colors.black26,///背景颜色
49 | fit: false,///是否缩放图片以保持一致
50 | controller: captureController,///用以获取截图的controller
51 | ),
52 | ```
53 | 另外,这个widget已经包裹了一层RepaintBoundary,所以你可以通过传入一个CaptureController的实例,并调用capture()方法获取截图。
54 | ``` dart
55 | ///获取截图
56 | getCapture() async{
57 | Uint8List bytes = await captureController.capture();
58 | }
59 | ```
60 | ## LICENSE
61 | MIT License
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | import 'helper_page.dart';
4 | import 'widget_page.dart';
5 |
6 | const networkImagePath = "https://pic.dbw.cn/003/013/364/00301336495_44db9bad.jpg";
7 |
8 | void main() => runApp(MyApp());
9 |
10 | class MyApp extends StatelessWidget {
11 | @override
12 | Widget build(BuildContext context) {
13 | return MaterialApp(
14 | title: 'Flutter Demo',
15 | theme: ThemeData(
16 | primarySwatch: Colors.blue,
17 | ),
18 | home: MyHomePage(title: 'Example Home Page'),
19 | );
20 | }
21 | }
22 |
23 | class MyHomePage extends StatefulWidget {
24 | MyHomePage({Key? key, this.title}) : super(key: key);
25 |
26 | final String? title;
27 |
28 | @override
29 | _MyHomePageState createState() => _MyHomePageState();
30 | }
31 |
32 | class _MyHomePageState extends State {
33 | @override
34 | Widget build(BuildContext context) {
35 | return Scaffold(
36 | appBar: AppBar(
37 | title: Text(widget.title!),
38 | ),
39 | body: Center(
40 | child: Column(
41 | mainAxisAlignment: MainAxisAlignment.center,
42 | children: [
43 | ElevatedButton(
44 | onPressed: _toWidget,
45 | child: Text(
46 | "ImagesMerge Widget",
47 | style: Theme.of(context).textTheme.headline6,
48 | )),
49 | SizedBox(
50 | height: 30,
51 | ),
52 | ElevatedButton(
53 | onPressed: _toHelper,
54 | child: Text(
55 | "ImagesMerge Helper",
56 | style: Theme.of(context).textTheme.headline6,
57 | )),
58 | ],
59 | ),
60 | ),
61 | );
62 | }
63 |
64 | _toWidget() {
65 | Navigator.push(context,
66 | MaterialPageRoute(builder: (context) => ImagesMergeWidgetPage()));
67 | }
68 |
69 | _toHelper() {
70 | Navigator.push(context,
71 | MaterialPageRoute(builder: (context) => ImagesMergeHelperPage()));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "example.example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'androidx.test:runner:1.1.1'
66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
67 | }
68 |
--------------------------------------------------------------------------------
/lib/src/merge_painter.dart:
--------------------------------------------------------------------------------
1 | part of "images_merge.dart";
2 |
3 | ///
4 | ///@author xiaozhizhong
5 | ///@date 2020/4/1
6 | ///@description painter
7 | ///
8 | class _MergePainter extends CustomPainter {
9 | _MergePainter(this.imageList, this.direction, this.fit, this.scale);
10 |
11 | final List imageList;
12 | final Axis direction;
13 | final bool fit;
14 | final double scale;
15 |
16 | @override
17 | void paint(Canvas canvas, Size size) {
18 | double dx = 0;
19 | double dy = 0;
20 | double totalWidth = size.width;
21 | double totalHeight = size.height;
22 | Paint paint = Paint();
23 | imageList.forEach((image) {
24 | //scale the image to same width/height
25 | late double imageHeight;
26 | late double imageWidth;
27 | double dxScale = dx;
28 | double dyScale = dy;
29 | if (direction == Axis.vertical) {
30 | if (image.width < totalWidth && !fit) {
31 | canvas.drawImage(image, Offset(dx, dy), paint);
32 | } else {
33 | canvas.save();
34 | if (!fit) {
35 | imageHeight = image.height * scale;
36 | canvas.scale(imageHeight / image.height);
37 | } else {
38 | canvas.scale(totalWidth / image.width);
39 | imageHeight = image.height * totalWidth / image.width;
40 | }
41 |
42 | dyScale *= image.height / imageHeight;
43 | canvas.drawImage(image, Offset(dxScale, dyScale), paint);
44 | canvas.restore();
45 | }
46 | } else {
47 | if (image.height < totalHeight && !fit) {
48 | canvas.drawImage(image, Offset(dx, dy), paint);
49 | } else {
50 | canvas.save();
51 | if (!fit) {
52 | imageWidth = image.width * scale;
53 | canvas.scale(imageWidth / image.width);
54 | } else {
55 | canvas.scale(totalHeight / image.height);
56 | imageWidth = image.width * totalHeight / image.height;
57 | }
58 | dxScale *= image.width / imageWidth;
59 | canvas.drawImage(image, Offset(dxScale, dyScale), paint);
60 | canvas.restore();
61 | }
62 | }
63 | if (direction == Axis.vertical) {
64 | dy += imageHeight;
65 | } else {
66 | dx += imageWidth;
67 | }
68 | });
69 | }
70 |
71 | @override
72 | bool shouldRepaint(CustomPainter oldDelegate) {
73 | return oldDelegate != this;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # merge_images in flutter
2 |
3 |
4 |
5 | [中文文档](README(CH).md)
6 |
7 | ## Intro
8 | Merge images (Image stitching) in vertical or horizontal direction.
9 | 
10 |
11 | ## Features
12 | * Support vertical and horizontal direction.
13 | * Provide a helper to merge images in code and get a result image, and a widget to automatically merge and show images.
14 | * Automatically scale the image to fit other images (fit width in vertical, and height in horizontal).
15 |
16 | ## Usage
17 | #### ImagesMergeHelper
18 | Use this helper to merge images in code.
19 |
20 | ``` dart
21 | ui.Image image = await ImagesMergeHelper.margeImages(
22 | [assetImage1,assetImage2,providerImage],///required,images list
23 | fit: true,///scale image to fit others
24 | direction: Axis.vertical,///direction of images
25 | backgroundColor: Colors.black26);///background color
26 | ```
27 | Besides, it provider some functions to do image format conversion:
28 | ``` dart
29 | ///ui.Image to Uint8List
30 | Uint8List bytes = await ImagesMergeHelper.imageToUint8List(image);
31 | ///ui.Image to File
32 | File file = await ImagesMergeHelper.imageToFile(image);
33 | ///Uint8List to ui.Image
34 | ui.Image image = await ImagesMergeHelper.uint8ListToImage(imageBytes);
35 | ///file to ui.Image
36 | ui.Image image = await ImagesMergeHelper.loadImageFromFile(file);
37 | ///asset to ui.Image
38 | ui.Image image = await ImagesMergeHelper.loadImageFromAsset(assetPath);
39 | ///ImageProvider to ui.Image
40 | ui.Image image = await ImagesMergeHelper.loadImageFromProvider(imageProvider);
41 |
42 | ```
43 | #### ImageMerge
44 | Use this widget to automatically merge and show images.
45 | ``` dart
46 | ImagesMerge(
47 | imageList,///required,images list
48 | direction: Axis.vertical,///direction
49 | backgroundColor: Colors.black26,///background color
50 | fit: false,///scale image to fit others
51 | controller: captureController,///controller to get screen shot
52 | ),
53 | ```
54 | Besides, the widget was wrapped with RepaintBoundary, you can simply passing an instance of CaptureController and get the screen shot by calling capture().
55 | ``` dart
56 | ///get capture of widget by RepaintBoundary
57 | getCapture() async{
58 | Uint8List bytes = await captureController.capture();
59 | }
60 | ```
61 | ## LICENSE
62 | MIT License
63 |
64 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: merge images example application.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 1.0.2
15 |
16 | environment:
17 | sdk: '>=2.12.0 <3.0.0'
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 | merge_images:
23 | path: ../
24 |
25 |
26 | # The following adds the Cupertino Icons font to your application.
27 | # Use with the CupertinoIcons class for iOS style icons.
28 | cupertino_icons: ^0.1.2
29 |
30 | dev_dependencies:
31 | flutter_test:
32 | sdk: flutter
33 |
34 |
35 | # For information on the generic Dart part of this file, see the
36 | # following page: https://dart.dev/tools/pub/pubspec
37 |
38 | # The following section is specific to Flutter.
39 | flutter:
40 |
41 | # The following line ensures that the Material Icons font is
42 | # included with your application, so that you can use the icons in
43 | # the material Icons class.
44 | uses-material-design: true
45 |
46 | # To add assets to your application, add an assets section, like this:
47 | assets:
48 | - sunset.jpeg
49 | - bridge.jpg
50 | # - images/a_dot_ham.jpeg
51 |
52 | # An image asset can refer to one or more resolution-specific "variants", see
53 | # https://flutter.dev/assets-and-images/#resolution-aware.
54 |
55 | # For details regarding adding assets from package dependencies, see
56 | # https://flutter.dev/assets-and-images/#from-packages
57 |
58 | # To add custom fonts to your application, add a fonts section here,
59 | # in this "flutter" section. Each entry in this list should have a
60 | # "family" key with the font family name, and a "fonts" key with a
61 | # list giving the asset and other descriptors for the font. For
62 | # example:
63 | # fonts:
64 | # - family: Schyler
65 | # fonts:
66 | # - asset: fonts/Schyler-Regular.ttf
67 | # - asset: fonts/Schyler-Italic.ttf
68 | # style: italic
69 | # - family: Trajan Pro
70 | # fonts:
71 | # - asset: fonts/TrajanPro.ttf
72 | # - asset: fonts/TrajanPro_Bold.ttf
73 | # weight: 700
74 | #
75 | # For details regarding fonts from package dependencies,
76 | # see https://flutter.dev/custom-fonts/#from-packages
77 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def parse_KV_file(file, separator='=')
14 | file_abs_path = File.expand_path(file)
15 | if !File.exists? file_abs_path
16 | return [];
17 | end
18 | generated_key_values = {}
19 | skip_line_start_symbols = ["#", "/"]
20 | File.foreach(file_abs_path) do |line|
21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22 | plugin = line.split(pattern=separator)
23 | if plugin.length == 2
24 | podname = plugin[0].strip()
25 | path = plugin[1].strip()
26 | podpath = File.expand_path("#{path}", file_abs_path)
27 | generated_key_values[podname] = podpath
28 | else
29 | puts "Invalid plugin specification: #{line}"
30 | end
31 | end
32 | generated_key_values
33 | end
34 |
35 | target 'Runner' do
36 | use_frameworks!
37 | use_modular_headers!
38 |
39 | # Flutter Pod
40 |
41 | copied_flutter_dir = File.join(__dir__, 'Flutter')
42 | copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43 | copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44 | unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45 | # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46 | # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47 | # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
48 |
49 | generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50 | unless File.exist?(generated_xcode_build_settings_path)
51 | raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
52 | end
53 | generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54 | cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55 |
56 | unless File.exist?(copied_framework_path)
57 | FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58 | end
59 | unless File.exist?(copied_podspec_path)
60 | FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61 | end
62 | end
63 |
64 | # Keep pod path relative so it can be checked into Podfile.lock.
65 | pod 'Flutter', :path => 'Flutter'
66 |
67 | # Plugin Pods
68 |
69 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70 | # referring to absolute paths on developers' machines.
71 | system('rm -rf .symlinks')
72 | system('mkdir -p .symlinks/plugins')
73 | plugin_pods = parse_KV_file('../.flutter-plugins')
74 | plugin_pods.each do |name, path|
75 | symlink = File.join('.symlinks', 'plugins', name)
76 | File.symlink(path, symlink)
77 | pod name, :path => File.join(symlink, 'ios')
78 | end
79 | end
80 |
81 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
82 | install! 'cocoapods', :disable_input_output_paths => true
83 |
84 | post_install do |installer|
85 | installer.pods_project.targets.each do |target|
86 | target.build_configurations.each do |config|
87 | config.build_settings['ENABLE_BITCODE'] = 'NO'
88 | end
89 | end
90 | end
91 |
--------------------------------------------------------------------------------
/example/lib/helper_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'dart:ui' as ui;
5 |
6 | import 'package:merge_images/merge_images.dart';
7 |
8 | import 'image_preview_page.dart';
9 | import 'main.dart';
10 |
11 | ///
12 | ///@author xiaozhizhong
13 | ///@date 2020/4/2
14 | ///@description images merge helper example page
15 | ///
16 | class ImagesMergeHelperPage extends StatefulWidget {
17 | @override
18 | _ImagesMergeHelperPageState createState() => _ImagesMergeHelperPageState();
19 | }
20 |
21 | class _ImagesMergeHelperPageState extends State {
22 | ui.Image? assetImage1;
23 | ui.Image? assetImage2;
24 | ui.Image? providerImage;
25 |
26 |
27 | @override
28 | void initState() {
29 | super.initState();
30 | loadImage();
31 | }
32 |
33 | loadImage() async {
34 | assetImage1 = await ImagesMergeHelper.loadImageFromAsset("assets/sunset.jpeg");
35 | assetImage2 = await ImagesMergeHelper.loadImageFromAsset("assets/bridge.jpg");
36 | providerImage = await ImagesMergeHelper.loadImageFromProvider(NetworkImage(networkImagePath));
37 | }
38 |
39 | @override
40 | Widget build(BuildContext context) {
41 | return Scaffold(
42 | appBar: AppBar(
43 | title: Text("Helper Page"),
44 | ),
45 | body: Container(
46 | width: double.infinity,
47 | height: double.infinity,
48 | padding: EdgeInsets.all(30),
49 | child: SingleChildScrollView(
50 | child: Column(
51 | crossAxisAlignment: CrossAxisAlignment.start,
52 | children: [
53 | Image.asset(
54 | "assets/sunset.jpeg",
55 | scale: 10,
56 | fit: BoxFit.scaleDown,
57 | ),
58 | SizedBox(
59 | height: 10,
60 | ),
61 | Image.asset(
62 | "assets/bridge.jpg",
63 | scale: 10,
64 | fit: BoxFit.scaleDown,
65 | ),
66 | SizedBox(
67 | height: 10,
68 | ),
69 | Image.network(
70 | networkImagePath,
71 | scale: 10,
72 | fit: BoxFit.scaleDown,
73 | ),
74 | SizedBox(
75 | height: 30,
76 | ),
77 | ElevatedButton(
78 | onPressed: () => _merge(fit: true, direction: Axis.vertical),
79 | child: Text(
80 | "vertical & fit",
81 | style: Theme.of(context).textTheme.headline6,
82 | )),
83 | ElevatedButton(
84 | onPressed: () => _merge(fit: false, direction: Axis.vertical),
85 | child: Text(
86 | "vertical",
87 | style: Theme.of(context).textTheme.headline6,
88 | )),
89 | ElevatedButton(
90 | onPressed: () => _merge(fit: true, direction: Axis.horizontal),
91 | child: Text(
92 | "horizontal & fit",
93 | style: Theme.of(context).textTheme.headline6,
94 | )),
95 | ElevatedButton(
96 | onPressed: () => _merge(fit: false, direction: Axis.horizontal),
97 | child: Text(
98 | "horizontal",
99 | style: Theme.of(context).textTheme.headline6,
100 | )),
101 | ],
102 | ),
103 | ),
104 | ),
105 | );
106 | }
107 |
108 | ///merge images using ImagesMergeHelper and preview
109 | _merge({required bool fit, required Axis direction}) async {
110 | ui.Image image = await ImagesMergeHelper.margeImages([assetImage1!, assetImage2!, providerImage!],
111 | fit: fit, direction: direction, backgroundColor: Colors.black26);
112 | Uint8List? bytes = await ImagesMergeHelper.imageToUint8List(image);
113 | if (bytes == null) return;
114 | Navigator.push(context, MaterialPageRoute(builder: (context) => Preview(bytes)));
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/lib/src/images_merge.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 | import 'package:flutter/material.dart';
3 | import 'dart:ui' as ui;
4 | import 'package:flutter/rendering.dart';
5 |
6 | part "merge_painter.dart";
7 |
8 | ///
9 | ///@author xiaozhizhong
10 | ///@date 2020/4/1
11 | ///@description images merge widget
12 | ///
13 | // ignore: must_be_immutable
14 | class ImagesMerge extends StatelessWidget {
15 | ImagesMerge(this.imageList,
16 | {this.direction = Axis.vertical,
17 | this.controller,
18 | this.fit = true,
19 | this.backgroundColor});
20 |
21 | ///List of images list, content must be ui.Image.
22 | ///If you have another format of image, you can transfer it to ui.Image
23 | ///by [ImagesMergeHelper].
24 | final List imageList;
25 |
26 | ///Merge direction, default to vertical.
27 | final Axis direction;
28 |
29 | ///Whether to Scale the pictures to same width/height when pictures has
30 | ///different width/height,
31 | ///Fit width when direction is vertical, and fit height when horizontal.
32 | ///Default to true.
33 | final bool fit;
34 |
35 | ///background color
36 | final Color? backgroundColor;
37 |
38 | ///Controller to capture screen.
39 | final CaptureController? controller;
40 |
41 | int totalWidth = 0;
42 | int totalHeight = 0;
43 |
44 | double scale = 1;
45 |
46 | @override
47 | Widget build(BuildContext context) {
48 | return LayoutBuilder(
49 | builder: (context, constraint) {
50 | _calculate(constraint);
51 | return RepaintBoundary(
52 | key: controller?.key ?? ValueKey(0),
53 | child: ClipRRect(
54 | child: Container(
55 | color: backgroundColor,
56 | child: CustomPaint(
57 | painter: _MergePainter(imageList, direction, fit, scale),
58 | size: Size(totalWidth.toDouble(), totalHeight.toDouble()),
59 | ),
60 | ),
61 | ),
62 | );
63 | },
64 | );
65 | }
66 |
67 | ///calculating width and height of canvas
68 | _calculate(BoxConstraints constraint) {
69 | //calculate the max width/height of images
70 | imageList.forEach((image) {
71 | if (direction == Axis.vertical) {
72 | if (totalWidth < image.width) totalWidth = image.width;
73 | } else {
74 | if (totalHeight < image.height) totalHeight = image.height;
75 | }
76 | });
77 | //calculate the constraint of parent
78 | if (direction == Axis.vertical &&
79 | constraint.hasBoundedWidth &&
80 | totalWidth > constraint.maxWidth) {
81 | scale = constraint.maxWidth / totalWidth;
82 | totalWidth = constraint.maxWidth.floor();
83 | } else if (direction == Axis.horizontal &&
84 | constraint.hasBoundedHeight &&
85 | totalHeight > constraint.maxHeight) {
86 | scale = constraint.maxHeight / totalHeight;
87 | totalHeight = constraint.maxHeight.floor();
88 | }
89 | //calculate the opposite
90 | imageList.forEach((image) {
91 | if (direction == Axis.vertical) {
92 | if (image.width < totalWidth && !fit) {
93 | totalHeight += image.height;
94 | } else {
95 | if (!fit)
96 | totalHeight += (image.height * scale).floor();
97 | else
98 | totalHeight += (image.height * totalWidth / image.width).floor();
99 | }
100 | } else {
101 | if (image.height < totalHeight && !fit) {
102 | totalWidth += image.width;
103 | } else {
104 | if (!fit)
105 | totalWidth += (image.width * scale).floor();
106 | else
107 | totalWidth += (image.width * totalHeight / image.height).floor();
108 | }
109 | }
110 | });
111 | }
112 | }
113 |
114 | /// Screen shot capture controller
115 | class CaptureController {
116 | CaptureController();
117 |
118 | final GlobalKey key = GlobalKey();
119 |
120 | ///capture the screen shot by RepaintBoundary
121 | Future capture() async {
122 | try {
123 | RenderRepaintBoundary boundary =
124 | key.currentContext!.findRenderObject() as RenderRepaintBoundary;
125 | double dpr = ui.window.devicePixelRatio;
126 | ui.Image image = await boundary.toImage(pixelRatio: dpr);
127 | ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
128 | Uint8List? pngBytes = byteData?.buffer.asUint8List();
129 | return pngBytes;
130 | } catch (e) {
131 | print(e);
132 | }
133 | return null;
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/example/lib/widget_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:merge_images/merge_images.dart';
5 | import 'dart:ui' as ui;
6 |
7 | import 'image_preview_page.dart';
8 | import 'main.dart';
9 |
10 | ///
11 | ///@author xiaozhizhong
12 | ///@date 2020/4/2
13 | ///@description images merge widget example page
14 | ///
15 | class ImagesMergeWidgetPage extends StatefulWidget {
16 | @override
17 | _ImagesMergeWidgetPageState createState() => _ImagesMergeWidgetPageState();
18 | }
19 |
20 | class _ImagesMergeWidgetPageState extends State {
21 | var imageList = [];
22 | late ui.Image assetImage1;
23 | late ui.Image assetImage2;
24 | late ui.Image providerImage;
25 |
26 | final captureController = CaptureController();
27 |
28 | @override
29 | void initState() {
30 | super.initState();
31 | loadImage();
32 | }
33 |
34 | loadImage() async {
35 | assetImage1 = await ImagesMergeHelper.loadImageFromAsset("assets/sunset.jpeg");
36 | assetImage2 = await ImagesMergeHelper.loadImageFromAsset("assets/bridge.jpg");
37 | providerImage = await ImagesMergeHelper.loadImageFromProvider(NetworkImage(networkImagePath));
38 | setState(() {
39 | imageList.add(assetImage1);
40 | imageList.add(assetImage2);
41 | imageList.add(providerImage);
42 | });
43 | }
44 |
45 | @override
46 | Widget build(BuildContext context) {
47 | return Scaffold(
48 | appBar: AppBar(
49 | title: Text("Widget Page"),
50 | ),
51 | body: Container(
52 | width: double.infinity,
53 | height: double.infinity,
54 | padding: EdgeInsets.all(30),
55 | child: SingleChildScrollView(
56 | child: Column(
57 | crossAxisAlignment: CrossAxisAlignment.start,
58 | children: [
59 | Image.asset(
60 | "assets/sunset.jpeg",
61 | scale: 10,
62 | fit: BoxFit.scaleDown,
63 | ),
64 | SizedBox(
65 | height: 10,
66 | ),
67 | Image.asset(
68 | "assets/bridge.jpg",
69 | scale: 10,
70 | fit: BoxFit.scaleDown,
71 | ),
72 | SizedBox(
73 | height: 10,
74 | ),
75 | Image.network(
76 | networkImagePath,
77 | scale: 10,
78 | fit: BoxFit.scaleDown,
79 | ),
80 | Padding(
81 | padding: const EdgeInsets.only(top: 20),
82 | child: Text("merge(vertical&fit)"),
83 | ),
84 | Offstage(
85 | offstage: imageList.isEmpty,
86 | child: Container(
87 | width: 100,
88 | child: ImagesMerge(
89 | imageList,
90 | direction: Axis.vertical,
91 | fit: true,
92 | ),
93 | ),
94 | ),
95 | Padding(
96 | padding: const EdgeInsets.only(top: 20),
97 | child: Text("merge(vertical)"),
98 | ),
99 | Offstage(
100 | offstage: imageList.isEmpty,
101 | child: Container(
102 | width: 100,
103 | child: ImagesMerge(
104 | imageList,
105 | direction: Axis.vertical,
106 | backgroundColor: Colors.black26,
107 | fit: false,
108 | ),
109 | ),
110 | ),
111 | Padding(
112 | padding: const EdgeInsets.only(top: 20),
113 | child: Text("merge(horizontal&fit)"),
114 | ),
115 | Offstage(
116 | offstage: imageList.isEmpty,
117 | child: Container(
118 | height: 70,
119 | child: ImagesMerge(
120 | imageList,
121 | direction: Axis.horizontal,
122 | fit: true,
123 | ),
124 | ),
125 | ),
126 | Padding(
127 | padding: const EdgeInsets.only(top: 20),
128 | child: Text("merge(horizontal)"),
129 | ),
130 | Offstage(
131 | offstage: imageList.isEmpty,
132 | child: Container(
133 | height: 70,
134 | child: ImagesMerge(
135 | imageList,
136 | direction: Axis.horizontal,
137 | fit: false,
138 | backgroundColor: Colors.black26,
139 | controller: captureController,
140 | ),
141 | ),
142 | ),
143 | ElevatedButton(
144 | onPressed: () => getCapture(context), child: Text("Capture", style: Theme.of(context).textTheme.headline6))
145 | ],
146 | ),
147 | ),
148 | ),
149 | );
150 | }
151 |
152 | ///get capture of widget by RepaintBoundary
153 | getCapture(context) async {
154 | Uint8List? bytes = await captureController.capture();
155 | if (bytes == null) return;
156 | Navigator.push(context, MaterialPageRoute(builder: (context) => Preview(bytes)));
157 | }
158 | }
159 |
--------------------------------------------------------------------------------
/lib/src/images_merge_helper.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 | import 'dart:io';
3 | import 'dart:typed_data';
4 |
5 | import 'package:flutter/material.dart';
6 | import 'dart:ui' as ui;
7 |
8 | import 'package:flutter/services.dart';
9 | import 'package:path_provider/path_provider.dart';
10 |
11 | ///
12 | ///@author xiaozhizhong
13 | ///@date 2020/4/1
14 | ///@description images merge helper
15 | ///
16 |
17 | class ImagesMergeHelper {
18 | ///Merge images from a list of ui.Image
19 | ///[imageList] list of ui.Image
20 | ///[direction] merge direction, default to vertical
21 | ///[fit] Whether to Scale the pictures to same width/height when pictures has
22 | ///different width/height,
23 | /// Fit width when direction is vertical, and fit height when horizontal.
24 | /// Default to true.
25 | ///[backgroundColor] background color of picture
26 | static Future margeImages(List imageList,
27 | {Axis direction = Axis.vertical, bool fit = true, Color? backgroundColor}) {
28 | int maxWidth = 0;
29 | int maxHeight = 0;
30 | //calculate max width/height of image
31 | imageList.forEach((image) {
32 | if (direction == Axis.vertical) {
33 | if (maxWidth < image.width) maxWidth = image.width;
34 | } else {
35 | if (maxHeight < image.height) maxHeight = image.height;
36 | }
37 | });
38 | int totalHeight = maxHeight;
39 | int totalWidth = maxWidth;
40 | ui.PictureRecorder recorder = ui.PictureRecorder();
41 | final paint = Paint();
42 | Canvas canvas = Canvas(recorder);
43 | double dx = 0;
44 | double dy = 0;
45 | //set background color
46 | if (backgroundColor != null) canvas.drawColor(backgroundColor, BlendMode.srcOver);
47 | //draw images into canvas
48 | imageList.forEach((image) {
49 | double scaleDx = dx;
50 | double scaleDy = dy;
51 | double imageHeight = image.height.toDouble();
52 | double imageWidth = image.width.toDouble();
53 | if (fit) {
54 | //scale the image to same width/height
55 | canvas.save();
56 | if (direction == Axis.vertical && image.width != maxWidth) {
57 | canvas.scale(maxWidth / image.width);
58 | scaleDy *= imageWidth / maxWidth;
59 | imageHeight *= maxWidth / imageWidth;
60 | } else if (direction == Axis.horizontal && image.height != maxHeight) {
61 | canvas.scale(maxHeight / image.height);
62 | scaleDx *= imageHeight / maxHeight;
63 | imageWidth *= maxHeight / imageHeight;
64 | }
65 | canvas.drawImage(image, Offset(scaleDx, scaleDy), paint);
66 | canvas.restore();
67 | } else {
68 | //draw directly
69 | canvas.drawImage(image, Offset(dx, dy), paint);
70 | }
71 | //accumulate dx/dy
72 | if (direction == Axis.vertical) {
73 | dy += imageHeight;
74 | totalHeight += imageHeight.floor();
75 | } else {
76 | dx += imageWidth;
77 | totalWidth += imageWidth.floor();
78 | }
79 | });
80 | //output image
81 | return recorder.endRecording().toImage(totalWidth, totalHeight);
82 | }
83 |
84 | ///transfer ui.Image to Unit8List
85 | ///[image]
86 | ///[format] default to png
87 | static Future imageToUint8List(ui.Image image, {ui.ImageByteFormat format = ui.ImageByteFormat.png}) async {
88 | ByteData? byteData = await image.toByteData(format: format);
89 | return byteData?.buffer.asUint8List();
90 | }
91 |
92 | ///transfer ui.Image to File
93 | ///[image]
94 | ///[path] path to store temporary file, will use [ getTemporaryDirectory ]
95 | ///by path_provider if null
96 | static Future imageToFile(ui.Image image, {String? path}) async {
97 | Uint8List? byte = await imageToUint8List(image);
98 | if(byte==null) return null;
99 | final directory = path ?? (await getTemporaryDirectory()).path;
100 | String fileName = DateTime.now().toIso8601String();
101 | String fullPath = '$directory/$fileName.png';
102 | File imgFile = new File(fullPath);
103 | return await imgFile.writeAsBytes(byte);
104 | }
105 |
106 | ///transfer Unit8List to ui.Image
107 | ///[bytes] Uint8List bytes
108 | static Future uint8ListToImage(Uint8List bytes) async {
109 | ImageProvider provider = MemoryImage(bytes);
110 | return await loadImageFromProvider(provider);
111 | }
112 |
113 | ///load ui.Image from File
114 | ///[file] Image file
115 | static Future loadImageFromFile(File file) async {
116 | Uint8List bytes = file.readAsBytesSync();
117 | return await uint8ListToImage(bytes);
118 | }
119 |
120 | ///load ui.Image from asset
121 | ///[asset] asset path
122 | static Future loadImageFromAsset(String asset) async {
123 | ByteData data = await rootBundle.load(asset);
124 | var codec = await ui.instantiateImageCodec(data.buffer.asUint8List());
125 | ui.FrameInfo fi = await codec.getNextFrame();
126 | return fi.image;
127 | }
128 |
129 | ///load ui.Image from ImageProvider
130 | ///[provider] ImageProvider
131 | static Future loadImageFromProvider(
132 | ImageProvider provider, {
133 | ImageConfiguration config = ImageConfiguration.empty,
134 | }) async {
135 | Completer completer = Completer();
136 | late ImageStreamListener listener;
137 | ImageStream stream = provider.resolve(config);
138 | listener = ImageStreamListener((ImageInfo frame, bool sync) {
139 | final ui.Image image = frame.image;
140 | completer.complete(image);
141 | stream.removeListener(listener);
142 | });
143 | stream.addListener(listener);
144 | return completer.future;
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
14 | 54A7135A57EF05201CB9B9A7 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C894D7CD35B70FC2A620B32 /* Pods_Runner.framework */; };
15 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
16 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
17 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
18 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
19 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
20 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXCopyFilesBuildPhase section */
24 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
25 | isa = PBXCopyFilesBuildPhase;
26 | buildActionMask = 2147483647;
27 | dstPath = "";
28 | dstSubfolderSpec = 10;
29 | files = (
30 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
31 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
32 | );
33 | name = "Embed Frameworks";
34 | runOnlyForDeploymentPostprocessing = 0;
35 | };
36 | /* End PBXCopyFilesBuildPhase section */
37 |
38 | /* Begin PBXFileReference section */
39 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
40 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
41 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
42 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; };
43 | 565915434A489229E52236E7 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
44 | 57116893FC0E9A093D6C2A8F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
45 | 5C894D7CD35B70FC2A620B32 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
46 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
47 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
48 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
49 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
50 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
51 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
52 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
54 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
55 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
56 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
57 | DFBF7F14423D39B4B036E341 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
66 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
67 | 54A7135A57EF05201CB9B9A7 /* Pods_Runner.framework in Frameworks */,
68 | );
69 | runOnlyForDeploymentPostprocessing = 0;
70 | };
71 | /* End PBXFrameworksBuildPhase section */
72 |
73 | /* Begin PBXGroup section */
74 | 8B62204A98A87E2569EF7FAC /* Frameworks */ = {
75 | isa = PBXGroup;
76 | children = (
77 | 5C894D7CD35B70FC2A620B32 /* Pods_Runner.framework */,
78 | );
79 | name = Frameworks;
80 | sourceTree = "";
81 | };
82 | 964E594D1A20B969B7C7AFB1 /* Pods */ = {
83 | isa = PBXGroup;
84 | children = (
85 | DFBF7F14423D39B4B036E341 /* Pods-Runner.debug.xcconfig */,
86 | 57116893FC0E9A093D6C2A8F /* Pods-Runner.release.xcconfig */,
87 | 565915434A489229E52236E7 /* Pods-Runner.profile.xcconfig */,
88 | );
89 | name = Pods;
90 | path = Pods;
91 | sourceTree = "";
92 | };
93 | 9740EEB11CF90186004384FC /* Flutter */ = {
94 | isa = PBXGroup;
95 | children = (
96 | 3B80C3931E831B6300D905FE /* App.framework */,
97 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
98 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
99 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
100 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
101 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
102 | );
103 | name = Flutter;
104 | sourceTree = "";
105 | };
106 | 97C146E51CF9000F007C117D = {
107 | isa = PBXGroup;
108 | children = (
109 | 9740EEB11CF90186004384FC /* Flutter */,
110 | 97C146F01CF9000F007C117D /* Runner */,
111 | 97C146EF1CF9000F007C117D /* Products */,
112 | 964E594D1A20B969B7C7AFB1 /* Pods */,
113 | 8B62204A98A87E2569EF7FAC /* Frameworks */,
114 | );
115 | sourceTree = "";
116 | };
117 | 97C146EF1CF9000F007C117D /* Products */ = {
118 | isa = PBXGroup;
119 | children = (
120 | 97C146EE1CF9000F007C117D /* Runner.app */,
121 | );
122 | name = Products;
123 | sourceTree = "";
124 | };
125 | 97C146F01CF9000F007C117D /* Runner */ = {
126 | isa = PBXGroup;
127 | children = (
128 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
129 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
130 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
131 | 97C147021CF9000F007C117D /* Info.plist */,
132 | 97C146F11CF9000F007C117D /* Supporting Files */,
133 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
134 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
135 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
136 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
137 | );
138 | path = Runner;
139 | sourceTree = "";
140 | };
141 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
142 | isa = PBXGroup;
143 | children = (
144 | );
145 | name = "Supporting Files";
146 | sourceTree = "";
147 | };
148 | /* End PBXGroup section */
149 |
150 | /* Begin PBXNativeTarget section */
151 | 97C146ED1CF9000F007C117D /* Runner */ = {
152 | isa = PBXNativeTarget;
153 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
154 | buildPhases = (
155 | 536B19F73873AF5039F0F2EA /* [CP] Check Pods Manifest.lock */,
156 | 9740EEB61CF901F6004384FC /* Run Script */,
157 | 97C146EA1CF9000F007C117D /* Sources */,
158 | 97C146EB1CF9000F007C117D /* Frameworks */,
159 | 97C146EC1CF9000F007C117D /* Resources */,
160 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
161 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
162 | 857A3D13BF5EC2FCB94C199E /* [CP] Embed Pods Frameworks */,
163 | );
164 | buildRules = (
165 | );
166 | dependencies = (
167 | );
168 | name = Runner;
169 | productName = Runner;
170 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
171 | productType = "com.apple.product-type.application";
172 | };
173 | /* End PBXNativeTarget section */
174 |
175 | /* Begin PBXProject section */
176 | 97C146E61CF9000F007C117D /* Project object */ = {
177 | isa = PBXProject;
178 | attributes = {
179 | LastUpgradeCheck = 1020;
180 | ORGANIZATIONNAME = "The Chromium Authors";
181 | TargetAttributes = {
182 | 97C146ED1CF9000F007C117D = {
183 | CreatedOnToolsVersion = 7.3.1;
184 | LastSwiftMigration = 1100;
185 | };
186 | };
187 | };
188 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
189 | compatibilityVersion = "Xcode 3.2";
190 | developmentRegion = en;
191 | hasScannedForEncodings = 0;
192 | knownRegions = (
193 | en,
194 | Base,
195 | );
196 | mainGroup = 97C146E51CF9000F007C117D;
197 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
198 | projectDirPath = "";
199 | projectRoot = "";
200 | targets = (
201 | 97C146ED1CF9000F007C117D /* Runner */,
202 | );
203 | };
204 | /* End PBXProject section */
205 |
206 | /* Begin PBXResourcesBuildPhase section */
207 | 97C146EC1CF9000F007C117D /* Resources */ = {
208 | isa = PBXResourcesBuildPhase;
209 | buildActionMask = 2147483647;
210 | files = (
211 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
212 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
213 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
214 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
215 | );
216 | runOnlyForDeploymentPostprocessing = 0;
217 | };
218 | /* End PBXResourcesBuildPhase section */
219 |
220 | /* Begin PBXShellScriptBuildPhase section */
221 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
222 | isa = PBXShellScriptBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | inputPaths = (
227 | );
228 | name = "Thin Binary";
229 | outputPaths = (
230 | );
231 | runOnlyForDeploymentPostprocessing = 0;
232 | shellPath = /bin/sh;
233 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
234 | };
235 | 536B19F73873AF5039F0F2EA /* [CP] Check Pods Manifest.lock */ = {
236 | isa = PBXShellScriptBuildPhase;
237 | buildActionMask = 2147483647;
238 | files = (
239 | );
240 | inputFileListPaths = (
241 | );
242 | inputPaths = (
243 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
244 | "${PODS_ROOT}/Manifest.lock",
245 | );
246 | name = "[CP] Check Pods Manifest.lock";
247 | outputFileListPaths = (
248 | );
249 | outputPaths = (
250 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | shellPath = /bin/sh;
254 | shellScript = "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";
255 | showEnvVarsInLog = 0;
256 | };
257 | 857A3D13BF5EC2FCB94C199E /* [CP] Embed Pods Frameworks */ = {
258 | isa = PBXShellScriptBuildPhase;
259 | buildActionMask = 2147483647;
260 | files = (
261 | );
262 | inputPaths = (
263 | );
264 | name = "[CP] Embed Pods Frameworks";
265 | outputPaths = (
266 | );
267 | runOnlyForDeploymentPostprocessing = 0;
268 | shellPath = /bin/sh;
269 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
270 | showEnvVarsInLog = 0;
271 | };
272 | 9740EEB61CF901F6004384FC /* Run Script */ = {
273 | isa = PBXShellScriptBuildPhase;
274 | buildActionMask = 2147483647;
275 | files = (
276 | );
277 | inputPaths = (
278 | );
279 | name = "Run Script";
280 | outputPaths = (
281 | );
282 | runOnlyForDeploymentPostprocessing = 0;
283 | shellPath = /bin/sh;
284 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
285 | };
286 | /* End PBXShellScriptBuildPhase section */
287 |
288 | /* Begin PBXSourcesBuildPhase section */
289 | 97C146EA1CF9000F007C117D /* Sources */ = {
290 | isa = PBXSourcesBuildPhase;
291 | buildActionMask = 2147483647;
292 | files = (
293 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
294 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
295 | );
296 | runOnlyForDeploymentPostprocessing = 0;
297 | };
298 | /* End PBXSourcesBuildPhase section */
299 |
300 | /* Begin PBXVariantGroup section */
301 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
302 | isa = PBXVariantGroup;
303 | children = (
304 | 97C146FB1CF9000F007C117D /* Base */,
305 | );
306 | name = Main.storyboard;
307 | sourceTree = "";
308 | };
309 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
310 | isa = PBXVariantGroup;
311 | children = (
312 | 97C147001CF9000F007C117D /* Base */,
313 | );
314 | name = LaunchScreen.storyboard;
315 | sourceTree = "";
316 | };
317 | /* End PBXVariantGroup section */
318 |
319 | /* Begin XCBuildConfiguration section */
320 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
321 | isa = XCBuildConfiguration;
322 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
323 | buildSettings = {
324 | ALWAYS_SEARCH_USER_PATHS = NO;
325 | CLANG_ANALYZER_NONNULL = YES;
326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
327 | CLANG_CXX_LIBRARY = "libc++";
328 | CLANG_ENABLE_MODULES = YES;
329 | CLANG_ENABLE_OBJC_ARC = YES;
330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
331 | CLANG_WARN_BOOL_CONVERSION = YES;
332 | CLANG_WARN_COMMA = YES;
333 | CLANG_WARN_CONSTANT_CONVERSION = YES;
334 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
335 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
336 | CLANG_WARN_EMPTY_BODY = YES;
337 | CLANG_WARN_ENUM_CONVERSION = YES;
338 | CLANG_WARN_INFINITE_RECURSION = YES;
339 | CLANG_WARN_INT_CONVERSION = YES;
340 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
341 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
342 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
343 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
344 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
345 | CLANG_WARN_STRICT_PROTOTYPES = YES;
346 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
347 | CLANG_WARN_UNREACHABLE_CODE = YES;
348 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
349 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
350 | COPY_PHASE_STRIP = NO;
351 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
352 | ENABLE_NS_ASSERTIONS = NO;
353 | ENABLE_STRICT_OBJC_MSGSEND = YES;
354 | GCC_C_LANGUAGE_STANDARD = gnu99;
355 | GCC_NO_COMMON_BLOCKS = YES;
356 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
357 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
358 | GCC_WARN_UNDECLARED_SELECTOR = YES;
359 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
360 | GCC_WARN_UNUSED_FUNCTION = YES;
361 | GCC_WARN_UNUSED_VARIABLE = YES;
362 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
363 | MTL_ENABLE_DEBUG_INFO = NO;
364 | SDKROOT = iphoneos;
365 | SUPPORTED_PLATFORMS = iphoneos;
366 | TARGETED_DEVICE_FAMILY = "1,2";
367 | VALIDATE_PRODUCT = YES;
368 | };
369 | name = Profile;
370 | };
371 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
372 | isa = XCBuildConfiguration;
373 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
374 | buildSettings = {
375 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
376 | CLANG_ENABLE_MODULES = YES;
377 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
378 | ENABLE_BITCODE = NO;
379 | FRAMEWORK_SEARCH_PATHS = (
380 | "$(inherited)",
381 | "$(PROJECT_DIR)/Flutter",
382 | );
383 | INFOPLIST_FILE = Runner/Info.plist;
384 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
385 | LIBRARY_SEARCH_PATHS = (
386 | "$(inherited)",
387 | "$(PROJECT_DIR)/Flutter",
388 | );
389 | PRODUCT_BUNDLE_IDENTIFIER = example.example;
390 | PRODUCT_NAME = "$(TARGET_NAME)";
391 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
392 | SWIFT_VERSION = 5.0;
393 | VERSIONING_SYSTEM = "apple-generic";
394 | };
395 | name = Profile;
396 | };
397 | 97C147031CF9000F007C117D /* Debug */ = {
398 | isa = XCBuildConfiguration;
399 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
400 | buildSettings = {
401 | ALWAYS_SEARCH_USER_PATHS = NO;
402 | CLANG_ANALYZER_NONNULL = YES;
403 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
404 | CLANG_CXX_LIBRARY = "libc++";
405 | CLANG_ENABLE_MODULES = YES;
406 | CLANG_ENABLE_OBJC_ARC = YES;
407 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
408 | CLANG_WARN_BOOL_CONVERSION = YES;
409 | CLANG_WARN_COMMA = YES;
410 | CLANG_WARN_CONSTANT_CONVERSION = YES;
411 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
412 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
413 | CLANG_WARN_EMPTY_BODY = YES;
414 | CLANG_WARN_ENUM_CONVERSION = YES;
415 | CLANG_WARN_INFINITE_RECURSION = YES;
416 | CLANG_WARN_INT_CONVERSION = YES;
417 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
418 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
419 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
421 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
422 | CLANG_WARN_STRICT_PROTOTYPES = YES;
423 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
424 | CLANG_WARN_UNREACHABLE_CODE = YES;
425 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
426 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
427 | COPY_PHASE_STRIP = NO;
428 | DEBUG_INFORMATION_FORMAT = dwarf;
429 | ENABLE_STRICT_OBJC_MSGSEND = YES;
430 | ENABLE_TESTABILITY = YES;
431 | GCC_C_LANGUAGE_STANDARD = gnu99;
432 | GCC_DYNAMIC_NO_PIC = NO;
433 | GCC_NO_COMMON_BLOCKS = YES;
434 | GCC_OPTIMIZATION_LEVEL = 0;
435 | GCC_PREPROCESSOR_DEFINITIONS = (
436 | "DEBUG=1",
437 | "$(inherited)",
438 | );
439 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
440 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
441 | GCC_WARN_UNDECLARED_SELECTOR = YES;
442 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
443 | GCC_WARN_UNUSED_FUNCTION = YES;
444 | GCC_WARN_UNUSED_VARIABLE = YES;
445 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
446 | MTL_ENABLE_DEBUG_INFO = YES;
447 | ONLY_ACTIVE_ARCH = YES;
448 | SDKROOT = iphoneos;
449 | TARGETED_DEVICE_FAMILY = "1,2";
450 | };
451 | name = Debug;
452 | };
453 | 97C147041CF9000F007C117D /* Release */ = {
454 | isa = XCBuildConfiguration;
455 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
456 | buildSettings = {
457 | ALWAYS_SEARCH_USER_PATHS = NO;
458 | CLANG_ANALYZER_NONNULL = YES;
459 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
460 | CLANG_CXX_LIBRARY = "libc++";
461 | CLANG_ENABLE_MODULES = YES;
462 | CLANG_ENABLE_OBJC_ARC = YES;
463 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
464 | CLANG_WARN_BOOL_CONVERSION = YES;
465 | CLANG_WARN_COMMA = YES;
466 | CLANG_WARN_CONSTANT_CONVERSION = YES;
467 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
468 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
469 | CLANG_WARN_EMPTY_BODY = YES;
470 | CLANG_WARN_ENUM_CONVERSION = YES;
471 | CLANG_WARN_INFINITE_RECURSION = YES;
472 | CLANG_WARN_INT_CONVERSION = YES;
473 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
474 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
475 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
476 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
477 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
478 | CLANG_WARN_STRICT_PROTOTYPES = YES;
479 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
480 | CLANG_WARN_UNREACHABLE_CODE = YES;
481 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
482 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
483 | COPY_PHASE_STRIP = NO;
484 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
485 | ENABLE_NS_ASSERTIONS = NO;
486 | ENABLE_STRICT_OBJC_MSGSEND = YES;
487 | GCC_C_LANGUAGE_STANDARD = gnu99;
488 | GCC_NO_COMMON_BLOCKS = YES;
489 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
490 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
491 | GCC_WARN_UNDECLARED_SELECTOR = YES;
492 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
493 | GCC_WARN_UNUSED_FUNCTION = YES;
494 | GCC_WARN_UNUSED_VARIABLE = YES;
495 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
496 | MTL_ENABLE_DEBUG_INFO = NO;
497 | SDKROOT = iphoneos;
498 | SUPPORTED_PLATFORMS = iphoneos;
499 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
500 | TARGETED_DEVICE_FAMILY = "1,2";
501 | VALIDATE_PRODUCT = YES;
502 | };
503 | name = Release;
504 | };
505 | 97C147061CF9000F007C117D /* Debug */ = {
506 | isa = XCBuildConfiguration;
507 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
508 | buildSettings = {
509 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
510 | CLANG_ENABLE_MODULES = YES;
511 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
512 | ENABLE_BITCODE = NO;
513 | FRAMEWORK_SEARCH_PATHS = (
514 | "$(inherited)",
515 | "$(PROJECT_DIR)/Flutter",
516 | );
517 | INFOPLIST_FILE = Runner/Info.plist;
518 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
519 | LIBRARY_SEARCH_PATHS = (
520 | "$(inherited)",
521 | "$(PROJECT_DIR)/Flutter",
522 | );
523 | PRODUCT_BUNDLE_IDENTIFIER = example.example;
524 | PRODUCT_NAME = "$(TARGET_NAME)";
525 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
526 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
527 | SWIFT_VERSION = 5.0;
528 | VERSIONING_SYSTEM = "apple-generic";
529 | };
530 | name = Debug;
531 | };
532 | 97C147071CF9000F007C117D /* Release */ = {
533 | isa = XCBuildConfiguration;
534 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
535 | buildSettings = {
536 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537 | CLANG_ENABLE_MODULES = YES;
538 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
539 | ENABLE_BITCODE = NO;
540 | FRAMEWORK_SEARCH_PATHS = (
541 | "$(inherited)",
542 | "$(PROJECT_DIR)/Flutter",
543 | );
544 | INFOPLIST_FILE = Runner/Info.plist;
545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
546 | LIBRARY_SEARCH_PATHS = (
547 | "$(inherited)",
548 | "$(PROJECT_DIR)/Flutter",
549 | );
550 | PRODUCT_BUNDLE_IDENTIFIER = example.example;
551 | PRODUCT_NAME = "$(TARGET_NAME)";
552 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
553 | SWIFT_VERSION = 5.0;
554 | VERSIONING_SYSTEM = "apple-generic";
555 | };
556 | name = Release;
557 | };
558 | /* End XCBuildConfiguration section */
559 |
560 | /* Begin XCConfigurationList section */
561 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
562 | isa = XCConfigurationList;
563 | buildConfigurations = (
564 | 97C147031CF9000F007C117D /* Debug */,
565 | 97C147041CF9000F007C117D /* Release */,
566 | 249021D3217E4FDB00AE95B9 /* Profile */,
567 | );
568 | defaultConfigurationIsVisible = 0;
569 | defaultConfigurationName = Release;
570 | };
571 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
572 | isa = XCConfigurationList;
573 | buildConfigurations = (
574 | 97C147061CF9000F007C117D /* Debug */,
575 | 97C147071CF9000F007C117D /* Release */,
576 | 249021D4217E4FDB00AE95B9 /* Profile */,
577 | );
578 | defaultConfigurationIsVisible = 0;
579 | defaultConfigurationName = Release;
580 | };
581 | /* End XCConfigurationList section */
582 | };
583 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
584 | }
585 |
--------------------------------------------------------------------------------