├── example
├── ios
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── 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
│ ├── Runner.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
├── android
│ ├── gradle.properties
│ ├── 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
│ │ │ │ │ └── com
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── build.gradle
├── assets
│ ├── image
│ │ ├── banner.png
│ │ ├── verify.png
│ │ ├── play_stop.png
│ │ ├── save_button.png
│ │ ├── verify_error.png
│ │ └── test
│ │ │ └── mine_header_image.png
│ └── uml
│ │ └── Generate.puml
├── lib
│ ├── path_test.dart
│ └── main.dart
├── .metadata
├── README.md
├── .gitignore
└── pubspec.yaml
├── CHANGELOG.md
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── lib
├── image_path_set.dart
├── builder.dart
└── image_path_generator.dart
├── .metadata
├── local.properties
├── .gitignore
├── pubspec.yaml
├── gradlew.bat
├── gradlew
├── LICENSE
└── README.md
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 |
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.0.1] - TODO: Add release date.
2 |
3 | * TODO: Describe initial release.
4 |
--------------------------------------------------------------------------------
/example/assets/image/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/example/assets/image/banner.png
--------------------------------------------------------------------------------
/example/assets/image/verify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/example/assets/image/verify.png
--------------------------------------------------------------------------------
/example/assets/image/play_stop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/example/assets/image/play_stop.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/example/assets/image/save_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/example/assets/image/save_button.png
--------------------------------------------------------------------------------
/example/assets/image/verify_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/example/assets/image/verify_error.png
--------------------------------------------------------------------------------
/example/lib/path_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:image_path_helper/image_path_set.dart';
2 |
3 | @ImagePathSet('assets/', 'ImagePathTest')
4 | class PathTest{}
--------------------------------------------------------------------------------
/example/assets/image/test/mine_header_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/HEAD/example/assets/image/test/mine_header_image.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/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/Reign9201/image_path_helper/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/lib/image_path_set.dart:
--------------------------------------------------------------------------------
1 | library image_path_helper;
2 |
3 | class ImagePathSet{
4 | final String pathName;
5 | final String newClassName;
6 |
7 | const ImagePathSet(this.pathName, this.newClassName);
8 | }
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Reign9201/image_path_helper/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/Reign9201/image_path_helper/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/lib/builder.dart:
--------------------------------------------------------------------------------
1 | import 'package:image_path_helper/image_path_generator.dart';
2 | import 'package:source_gen/source_gen.dart';
3 | import 'package:build/build.dart';
4 |
5 | Builder imagePathBuilder(BuilderOptions options) =>
6 | LibraryBuilder(ImagePathGenerator());
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Sep 29 10:46:23 CST 2019
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.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/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-4.10.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/assets/uml/Generate.puml:
--------------------------------------------------------------------------------
1 | @startuml
2 | scale 1.2
3 |
4 | Generator --|> GeneratorForAnnotation
5 |
6 | abstract class Generator {
7 | FutureOr generate(library,buildStep)
8 | }
9 |
10 | abstract class GeneratorForAnnotation{
11 | dynamic generateForAnnotatedElement(element,annotation,buildStep)
12 | }
13 |
14 | @enduml
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file must *NOT* be checked into Version Control Systems,
2 | # as it contains information specific to your local configuration.
3 | #
4 | # Location of the SDK. This is only used by Gradle.
5 | # For customization when using a Version Control System, please read the
6 | # header note.
7 | #Tue Sep 24 14:46:46 CST 2019
8 | sdk.dir=D\:\\Android\\Sdk
9 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://www.dartlang.org/guides/libraries/private-files
2 |
3 | # Files and directories created by pub
4 | .dart_tool/
5 | .packages
6 | .gradle
7 | .pub/
8 | build/
9 | # If you're building an application, you may want to check-in your pubspec.lock
10 | pubspec.lock
11 | .idea
12 | *.iml
13 |
14 |
15 | # Directory created by dartdoc
16 | # If you don't generate documentation locally you can remove this line.
17 | doc/api/
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import android.os.Bundle
4 |
5 | import io.flutter.app.FlutterActivity
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun onCreate(savedInstanceState: Bundle?) {
10 | super.onCreate(savedInstanceState)
11 | GeneratedPluginRegistrant.registerWith(this)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/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/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 | A new Flutter project.
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/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.2.71'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.2.1'
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/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 |
--------------------------------------------------------------------------------
/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/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 |
45 |
46 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .packages
28 | .pub-cache/
29 | .pub/
30 | /build/
31 |
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Generated.xcconfig
62 | **/ios/Flutter/app.flx
63 | **/ios/Flutter/app.zip
64 | **/ios/Flutter/flutter_assets/
65 | **/ios/Flutter/flutter_export_environment.sh
66 | **/ios/ServiceDefinitions.json
67 | **/ios/Runner/GeneratedPluginRegistrant.*
68 |
69 | # Exceptions to above rules.
70 | !**/ios/**/default.mode1v3
71 | !**/ios/**/default.mode2v3
72 | !**/ios/**/default.pbxuser
73 | !**/ios/**/default.perspectivev3
74 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
75 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
9 |
13 |
20 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: image_path_helper
2 | description: A new Flutter package project.
3 | version: 0.0.2
4 | author:
5 | homepage:
6 |
7 | environment:
8 | sdk: ">=2.1.0 <3.0.0"
9 |
10 | dependencies:
11 | flutter:
12 | sdk: flutter
13 | source_gen: ^0.9.4+4
14 | build_runner: ^1.7.1
15 | # analyzer非必须依赖,不依赖这个版本可能导致的结果是build中无法指定auto_apply为root_package,这是一个坑
16 | # analyzer: 0.38.2
17 |
18 | dev_dependencies:
19 | flutter_test:
20 | sdk: flutter
21 |
22 | # For information on the generic Dart part of this file, see the
23 | # following page: https://dart.dev/tools/pub/pubspec
24 |
25 | # The following section is specific to Flutter.
26 | flutter:
27 |
28 | # To add assets to your package, add an assets section, like this:
29 | # assets:
30 | # - images/a_dot_burr.jpeg
31 | # - images/a_dot_ham.jpeg
32 | #
33 | # For details regarding assets in packages, see
34 | # https://flutter.dev/assets-and-images/#from-packages
35 | #
36 | # An image asset can refer to one or more resolution-specific "variants", see
37 | # https://flutter.dev/assets-and-images/#resolution-aware.
38 |
39 | # To add custom fonts to your package, add a fonts section here,
40 | # in this "flutter" section. Each entry in this list should have a
41 | # "family" key with the font family name, and a "fonts" key with a
42 | # list giving the asset and other descriptors for the font. For
43 | # example:
44 | # fonts:
45 | # - family: Schyler
46 | # fonts:
47 | # - asset: fonts/Schyler-Regular.ttf
48 | # - asset: fonts/Schyler-Italic.ttf
49 | # style: italic
50 | # - family: Trajan Pro
51 | # fonts:
52 | # - asset: fonts/TrajanPro.ttf
53 | # - asset: fonts/TrajanPro_Bold.ttf
54 | # weight: 700
55 | #
56 | # For details regarding fonts in packages, see
57 | # https://flutter.dev/custom-fonts/#from-packages
58 |
--------------------------------------------------------------------------------
/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 "com.example.example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "android.support.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 'com.android.support.test:runner:1.0.2'
66 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
67 | }
68 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A new Flutter project.
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.0+1
15 |
16 | environment:
17 | sdk: ">=2.1.0 <3.0.0"
18 |
19 | dependencies:
20 | flutter:
21 | sdk: flutter
22 | image_path_helper:
23 | path: ../
24 |
25 | # The following adds the Cupertino Icons font to your application.
26 | # Use with the CupertinoIcons class for iOS style icons.
27 | cupertino_icons: ^0.1.2
28 |
29 | dev_dependencies:
30 | build_runner: ^1.7.1
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 |
49 | # An image asset can refer to one or more resolution-specific "variants", see
50 | # https://flutter.dev/assets-and-images/#resolution-aware.
51 |
52 | # For details regarding adding assets from package dependencies, see
53 | # https://flutter.dev/assets-and-images/#from-packages
54 |
55 | # To add custom fonts to your application, add a fonts section here,
56 | # in this "flutter" section. Each entry in this list should have a
57 | # "family" key with the font family name, and a "fonts" key with a
58 | # list giving the asset and other descriptors for the font. For
59 | # example:
60 | # fonts:
61 | # - family: Schyler
62 | # fonts:
63 | # - asset: fonts/Schyler-Regular.ttf
64 | # - asset: fonts/Schyler-Italic.ttf
65 | # style: italic
66 | # - family: Trajan Pro
67 | # fonts:
68 | # - asset: fonts/TrajanPro.ttf
69 | # - asset: fonts/TrajanPro_Bold.ttf
70 | # weight: 700
71 | #
72 | # For details regarding fonts from package dependencies,
73 | # see https://flutter.dev/custom-fonts/#from-packages
74 |
75 | assets:
76 | - assets/image/banner.png
77 | - assets/image/play_stop.png
78 | - assets/image/save_button.png
79 | - assets/image/test/mine_header_image.png
80 | - assets/image/verify.png
81 | - assets/image/verify_error.png
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/lib/image_path_generator.dart:
--------------------------------------------------------------------------------
1 | import 'dart:io';
2 |
3 | import 'package:analyzer/dart/element/element.dart';
4 |
5 | import 'package:image_path_helper/image_path_set.dart';
6 | import 'package:source_gen/source_gen.dart';
7 | import 'package:build/build.dart';
8 |
9 |
10 | class ImagePathGenerator extends GeneratorForAnnotation {
11 | String _codeContent = '';
12 | String _pubspecContent = '';
13 |
14 | @override
15 | generateForAnnotatedElement(Element element, ConstantReader annotation, BuildStep buildStep) {
16 | final explanation = '// **************************************************************************\n'
17 | '// 如果存在新文件需要更新,建议先执行清除命令:\n'
18 | '// flutter packages pub run build_runner clean \n'
19 | '// \n'
20 | '// 然后执行下列命令重新生成相应文件:\n'
21 | '// flutter packages pub run build_runner build --delete-conflicting-outputs \n'
22 | '// **************************************************************************';
23 |
24 | var pubspecFile = File('pubspec.yaml');
25 |
26 | for (String imageName in pubspecFile.readAsLinesSync()) {
27 | if (imageName.trim() == 'assets:') continue;
28 | if (imageName.trim().toUpperCase().endsWith('.PNG')) continue;
29 | if (imageName.trim().toUpperCase().endsWith('.JPEG')) continue;
30 | if (imageName.trim().toUpperCase().endsWith('.SVG')) continue;
31 | if (imageName.trim().toUpperCase().endsWith('.JPG')) continue;
32 | _pubspecContent = "$_pubspecContent\n$imageName";
33 | }
34 | _pubspecContent = '${_pubspecContent.trim()}\n\n assets:';
35 |
36 | /// 图片文件路径
37 | var imagePath = annotation.peek('pathName').stringValue;
38 | if (!imagePath.endsWith('/')) {
39 | imagePath = '$imagePath/';
40 | }
41 |
42 | /// 生成新的Dart文件名称
43 | var newClassName = annotation.peek('newClassName').stringValue;
44 |
45 | /// 遍历处理图片资源路径
46 | handleFile(imagePath);
47 |
48 | /// 添加图片路径到pubspec.yaml文件中
49 | pubspecFile.writeAsString(_pubspecContent);
50 |
51 | /// 返回生成的代码文件
52 | return '$explanation\n\n'
53 | 'class $newClassName{\n'
54 | ' $newClassName._();\n'
55 | ' $_codeContent\n'
56 | '}';
57 | }
58 |
59 | void handleFile(String path) {
60 | var directory = Directory(path);
61 | if (directory == null) {
62 | throw '$path is not a directory.';
63 | }
64 |
65 | for (var file in directory.listSync()) {
66 | var type = file.statSync().type;
67 | if (type == FileSystemEntityType.directory) {
68 | handleFile('${file.path}/');
69 | } else if (type == FileSystemEntityType.file) {
70 | var filePath = file.path;
71 | var keyName = filePath.trim().toUpperCase();
72 |
73 | if (!keyName.endsWith('.PNG') &&
74 | !keyName.endsWith('.JPEG') &&
75 | !keyName.endsWith('.SVG') &&
76 | !keyName.endsWith('.JPG')) continue;
77 | var key = keyName
78 | .replaceAll(RegExp(path.toUpperCase()), '')
79 | .replaceAll(RegExp('.PNG'), '')
80 | .replaceAll(RegExp('.JPEG'), '')
81 | .replaceAll(RegExp('.SVG'), '')
82 | .replaceAll(RegExp('.JPG'), '');
83 |
84 | _codeContent = '$_codeContent\n\t\t\t\tstatic const $key = \'$filePath\';';
85 |
86 | /// 此处用 \t 符号代替空格在读取的时候会报错,不知道什么情况。。。
87 | _pubspecContent = '$_pubspecContent\n - $filePath';
88 | }
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/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/lib/main.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:flutter/material.dart';
3 | import 'package:image_path_helper/image_path_set.dart';
4 |
5 | void main() => runApp(MyApp());
6 |
7 | class MyApp extends StatelessWidget {
8 | // This widget is the root of your application.
9 | @override
10 | Widget build(BuildContext context) {
11 | return MaterialApp(
12 | title: 'Flutter Demo',
13 | theme: ThemeData(
14 | // This is the theme of your application.
15 | //
16 | // Try running your application with "flutter run". You'll see the
17 | // application has a blue toolbar. Then, without quitting the app, try
18 | // changing the primarySwatch below to Colors.green and then invoke
19 | // "hot reload" (press "r" in the console where you ran "flutter run",
20 | // or simply save your changes to "hot reload" in a Flutter IDE).
21 | // Notice that the counter didn't reset back to zero; the application
22 | // is not restarted.
23 | primarySwatch: Colors.blue,
24 | ),
25 | home: MyHomePage(title: 'Flutter Demo Home Page'),
26 | );
27 | }
28 | }
29 |
30 | class MyHomePage extends StatefulWidget {
31 | MyHomePage({Key key, this.title}) : super(key: key);
32 |
33 | // This widget is the home page of your application. It is stateful, meaning
34 | // that it has a State object (defined below) that contains fields that affect
35 | // how it looks.
36 |
37 | // This class is the configuration for the state. It holds the values (in this
38 | // case the title) provided by the parent (in this case the App widget) and
39 | // used by the build method of the State. Fields in a Widget subclass are
40 | // always marked "final".
41 |
42 | final String title;
43 |
44 | @override
45 | _MyHomePageState createState() => _MyHomePageState();
46 | }
47 |
48 | class _MyHomePageState extends State {
49 | int _counter = 0;
50 |
51 | void _incrementCounter() {
52 | setState(() {
53 | // This call to setState tells the Flutter framework that something has
54 | // changed in this State, which causes it to rerun the build method below
55 | // so that the display can reflect the updated values. If we changed
56 | // _counter without calling setState(), then the build method would not be
57 | // called again, and so nothing would appear to happen.
58 | _counter++;
59 | });
60 | }
61 |
62 | @override
63 | Widget build(BuildContext context) {
64 | // This method is rerun every time setState is called, for instance as done
65 | // by the _incrementCounter method above.
66 | //
67 | // The Flutter framework has been optimized to make rerunning build methods
68 | // fast, so that you can just rebuild anything that needs updating rather
69 | // than having to individually change instances of widgets.
70 | return Scaffold(
71 | appBar: AppBar(
72 | // Here we take the value from the MyHomePage object that was created by
73 | // the App.build method, and use it to set our appbar title.
74 | title: Text(widget.title),
75 | ),
76 | body: Center(
77 | // Center is a layout widget. It takes a single child and positions it
78 | // in the middle of the parent.
79 | child: Column(
80 | // Column is also a layout widget. It takes a list of children and
81 | // arranges them vertically. By default, it sizes itself to fit its
82 | // children horizontally, and tries to be as tall as its parent.
83 | //
84 | // Invoke "debug painting" (press "p" in the console, choose the
85 | // "Toggle Debug Paint" action from the Flutter Inspector in Android
86 | // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
87 | // to see the wireframe for each widget.
88 | //
89 | // Column has various properties to control how it sizes itself and
90 | // how it positions its children. Here we use mainAxisAlignment to
91 | // center the children vertically; the main axis here is the vertical
92 | // axis because Columns are vertical (the cross axis would be
93 | // horizontal).
94 | mainAxisAlignment: MainAxisAlignment.center,
95 | children: [
96 | Text(
97 | 'You have pushed the button this many times:',
98 | ),
99 | Text(
100 | '$_counter',
101 | style: Theme.of(context).textTheme.display1,
102 | ),
103 | ],
104 | ),
105 | ),
106 | floatingActionButton: FloatingActionButton(
107 | onPressed: _incrementCounter,
108 | tooltip: 'Increment',
109 | child: Icon(Icons.add),
110 | ), // This trailing comma makes auto-formatting nicer for build methods.
111 | );
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ### 背景
2 | 在使用Flutter开发的时候,有时候会存在很多资源图片问题,按照规定,使用的图片资源需要在 `pubspec.yaml` 文件中配置路径才可以正常使用,如果存在很多50个以上或者更多图片资源,难道需要一个一个配置?显然是不可能的!
3 |
4 | 其实,Flutter是支持直接在 `pubspec.yaml` 中配置图片资源文件夹路径即可,没必要每个图片资源路径都详细配置的,但是不管怎么样,在实际调用的时候,还是得老老实实写完整的图片路径,显然是很不方便的,那该如何解决?
5 |
6 | 不同的开发有不同的思路,这里我采取的是使用Dart注解的方式,只需要执行一行注解即可完成资源文件配置。
7 |
8 | 先看效果:
9 | 比如我们有以下资源文件:
10 | 
11 |
12 | 我们只需要配置一行注释:
13 | ```Dart
14 | @ImagePathSet('assets/', 'ImagePathTest')
15 | void main() => runApp(MyApp());
16 | ```
17 | 然后运行一行命令:
18 | ```
19 | flutter packages pub run build_runner build
20 | ```
21 | 执行完毕即可生成一个 `.dart` 文件内容如下:
22 | ```Dart
23 | class ImagePathTest {
24 | ImagePathTest._();
25 |
26 | static const BANNER = 'assets/image/banner.png';
27 | static const PLAY_STOP = 'assets/image/play_stop.png';
28 | static const SAVE_BUTTON = 'assets/image/save_button.png';
29 | static const MINE_HEADER_IMAGE = 'assets/image/test/mine_header_image.png';
30 | static const VERIFY = 'assets/image/verify.png';
31 | static const VERIFY_ERROR = 'assets/image/verify_error.png';
32 | }
33 | ```
34 |
35 | 同时在 `pubspec.yaml` 文件夹下自动配置好我们的资源文件:
36 | ```yaml
37 | assets:
38 | - assets/image/banner.png
39 | - assets/image/play_stop.png
40 | - assets/image/save_button.png
41 | - assets/image/test/mine_header_image.png
42 | - assets/image/verify.png
43 | - assets/image/verify_error.png
44 | ```
45 | 使用时即可直接以代码形式直接引用图片资源:
46 | ```Dart
47 | Image.asset(ImagePathTest.xxx)
48 | ```
49 | 即可以防止手误出差,又可以提高效率~
50 | 下面重点介绍我们的开发思路。
51 |
52 | ---
53 |
54 | ### 实战利用一行注解生成资源配置文件
55 | 关于Dart注解使用,可以参考这篇文章,写的比较细:[Flutter 注解处理及代码生成](https://juejin.im/post/5d1ac884f265da1bad571f3a),也可以参考官方说明:[source_gen](https://github.com/dart-lang/source_gen)
56 |
57 | 这里简单说明,在 `source_gen`官方文档说明里有这么一句话:
58 | > source_gen is based on the [build](https://pub.dev/packages/build) package and exposes options for using your Generator in a Builder.
59 | 省略部分文档内容 ......
60 | In order to get the Builder used with build_runner it must be configured in a build.yaml file.
61 |
62 | 翻译成中文即:
63 | > `source_gen` 是基于 `build` 包的,同时提供暴露了一些选项以方便在一个 `Builder` 中使用你自己的生成器 `Generator`。
...
为了能够使 `Builder` 和 `build_runner` 一块使用,必须要配置一个 `build.yaml` 文件。
64 |
65 | 因此想要使用Dart注解,我们需要做这几件事:
66 | - 依赖注解库 `source_gen`
67 | - 依赖构建运行库 `build_runner`
68 | - 创建注解代码生成器 `Generator`
69 | - 创建 `Build`
70 | - 创建 `build.yaml` 文件
71 | - 在需要使用的地方引入相关注解
72 | - 运行编译命令进行构建
73 |
74 | 下面一个一个说。
75 |
76 | #### 依赖注解库 `source_gen`
77 | 这个没什么好说的,只要你是要Dart注解就必须依赖该库:
78 | ```yaml
79 | dependencies:
80 | source_gen: ^0.9.4+5
81 | ```
82 | 具体版本可到这里查看[source_gen](https://pub.dev/packages/source_gen#-installing-tab-)
83 |
84 | #### 依赖构建运行库 `build_runner`
85 | 同上,直接依赖就是,一般依赖在 `dev_dependencies` 节点下:
86 | ```yaml
87 | dev_dependencies:
88 | build_runner: ^1.7.1
89 | ```
90 | 具体版本可到这查看[build_runner](https://pub.dev/packages/build_runner#-installing-tab-)
91 |
92 | 该库中内置了编译运行的命令:`pub run build_runner `,主要为下面四种编译类型:
93 | - `build`
94 | - `watch`
95 | - `serve`
96 | - `test`
97 |
98 | 其中在flutter中一般只需要第一种构建方式,同上以上四个命令都可以附加一些命令,例如:`--delete-conflicting-outputs`。详细说明可参考这里:[build_runner相关说明](https://pub.dev/packages/build_runner#-readme-tab-)
99 |
100 | #### 创建注解代码生成器 `Generator`
101 | 从字面意思理解为 `生成器`,官方说明为:
102 | > A tool to generate Dart code based on a Dart library source.
103 |
104 | 一种基于Dart库源代码生成Dart代码的工具。类图如下:
105 | 
106 |
107 | 两个类都是抽象类,通常创建一个类继承自 `GeneratorForAnnoration` 并实现抽象方法,在该抽象方法中完整我们需要的逻辑功能开发;这里我们需要搞一个图片资源文件配置功能,该功能具有以下两个要点:
108 | - 需要使用者指定资源文件夹路径
109 | - 需要使用者指定生成的资源配置类名称
110 |
111 | 因此我们先创建一个实例类包含这两个信息:
112 | ```Dart
113 | class ImagePathSet{
114 | /// 资源文件夹路径
115 | final String pathName;
116 |
117 | /// 需要生成的资源配置类名
118 | final String newClassName;
119 |
120 | const ImagePathSet(this.pathName, this.newClassName);
121 | }
122 | ```
123 | 最终我们在使用的第一引用就需要这样引用:
124 | ```Dart
125 | @ImagePathSet('assets/', 'ImagePathTest')
126 | ```
127 | 此处需要注意的是,这个类的构造方法必须是 `const` 的。创建好了最终需要使用的注解类之后,我们创建生成器:
128 | ```Dart
129 | class ImagePathGenerator extends GeneratorForAnnotation {
130 | @override
131 | generateForAnnotatedElement(Element element, ConstantReader annotation, BuildStep buildStep) {
132 |
133 | return null;
134 | }
135 | }
136 | ```
137 |
138 | 在 `generateForAnnotatedElement()` 方法中,我们即可完成我们的逻辑部分开发了,这里涉及到三个参数:
139 | - element:这个是被注解的类/方法等的详细信息,比如被修饰的部分代码这样:
140 | ```Dart
141 | /// path_test.dart
142 |
143 | @ImagePathSet('assets/', 'ImagePathTest')
144 | class PathTest{}
145 | ```
146 | 则一些相关的element信息如下:
147 | ```
148 | element.name /// PathTest
149 | element.displayName /// PathTest
150 | element.toString() /// class PathTest
151 | element.enclosingElement /// /example/lib/path_test.dart
152 | element.kind /// CLASS
153 | element.metadata /// [@ImagePathSet ImagePathSet(String pathName, String newClassName)]
154 | ```
155 | - annotation:注解的详细信息
其中最常用的两个方法分别是:
156 | - `read(String field)`
157 | - `peek(String field)`
158 |
159 | 两个都是读取给定的注解参数信息,前者如果没读取到或抛出 `FormatException` 异常,后者则会返回 `null`。
160 |
需要注意的是,这两个方法返回的结果是 `ConstantReader` 类型,如果需要获取到具体注解元素的值,需要调用对应的 `xxxValue`方法,`xxx`表示具体类型,比如上面的注解,我们需要获取 `pathName`信息,可以写成这样:
161 | ```Dart
162 | String pathName= annotation.peek('pathName').stringValue
163 | ```
164 | 当然,我们假如我们不知道注解参数的类型,可以根据 `isXxx` 来判断是否是对应的类型,比如:
165 | ```Dart
166 | annotation.peek('pathName').isString ///true
167 | annotation.peek('pathName').isInt ///false
168 | ```
169 | - buildStep:构建的输入输出信息
170 |
本想着修改这个类来修改生成文件名称信息,无奈Dart不支持反射,未找到相关的修改方法,这里最主要的一个信息为:
171 | - inputId:包含了构建时候输入的相关信息
172 |
173 | 完整的根据根据生成资源文件的生成器代码如下:
174 | ```
175 | import 'dart:io';
176 |
177 | import 'package:analyzer/dart/element/element.dart';
178 |
179 | import 'package:image_path_helper/image_path_set.dart';
180 | import 'package:source_gen/source_gen.dart';
181 | import 'package:build/build.dart';
182 |
183 |
184 | class ImagePathGenerator extends GeneratorForAnnotation {
185 | String _codeContent = '';
186 | String _pubspecContent = '';
187 |
188 | @override
189 | generateForAnnotatedElement(Element element, ConstantReader annotation, BuildStep buildStep) {
190 | final explanation = '// **************************************************************************\n'
191 | '// 如果存在新文件需要更新,建议先执行清除命令:\n'
192 | '// flutter packages pub run build_runner clean \n'
193 | '// \n'
194 | '// 然后执行下列命令重新生成相应文件:\n'
195 | '// flutter packages pub run build_runner build --delete-conflicting-outputs \n'
196 | '// **************************************************************************';
197 |
198 | var pubspecFile = File('pubspec.yaml');
199 |
200 | for (String imageName in pubspecFile.readAsLinesSync()) {
201 | if (imageName.trim() == 'assets:') continue;
202 | if (imageName.trim().toUpperCase().endsWith('.PNG')) continue;
203 | if (imageName.trim().toUpperCase().endsWith('.JPEG')) continue;
204 | if (imageName.trim().toUpperCase().endsWith('.SVG')) continue;
205 | if (imageName.trim().toUpperCase().endsWith('.JPG')) continue;
206 | _pubspecContent = "$_pubspecContent\n$imageName";
207 | }
208 | _pubspecContent = '${_pubspecContent.trim()}\n\n assets:';
209 |
210 | /// 图片文件路径
211 | var imagePath = annotation.peek('pathName').stringValue;
212 | if (!imagePath.endsWith('/')) {
213 | imagePath = '$imagePath/';
214 | }
215 |
216 | /// 生成新的Dart文件名称
217 | var newClassName = annotation.peek('newClassName').stringValue;
218 |
219 | /// 遍历处理图片资源路径
220 | handleFile(imagePath);
221 |
222 | /// 添加图片路径到pubspec.yaml文件中
223 | pubspecFile.writeAsString(_pubspecContent);
224 |
225 | /// 返回生成的代码文件
226 | return '$explanation\n\n'
227 | 'class $newClassName{\n'
228 | ' $newClassName._();\n'
229 | ' $_codeContent\n'
230 | '}';
231 | }
232 |
233 | void handleFile(String path) {
234 | var directory = Directory(path);
235 | if (directory == null) {
236 | throw '$path is not a directory.';
237 | }
238 |
239 | for (var file in directory.listSync()) {
240 | var type = file.statSync().type;
241 | if (type == FileSystemEntityType.directory) {
242 | handleFile('${file.path}/');
243 | } else if (type == FileSystemEntityType.file) {
244 | var filePath = file.path;
245 | var keyName = filePath.trim().toUpperCase();
246 |
247 | if (!keyName.endsWith('.PNG') &&
248 | !keyName.endsWith('.JPEG') &&
249 | !keyName.endsWith('.SVG') &&
250 | !keyName.endsWith('.JPG')) continue;
251 | var key = keyName
252 | .replaceAll(RegExp(path.toUpperCase()), '')
253 | .replaceAll(RegExp('.PNG'), '')
254 | .replaceAll(RegExp('.JPEG'), '')
255 | .replaceAll(RegExp('.SVG'), '')
256 | .replaceAll(RegExp('.JPG'), '');
257 |
258 | _codeContent = '$_codeContent\n\t\t\t\tstatic const $key = \'$filePath\';';
259 |
260 | /// 此处用 \t 符号代替空格在读取的时候会报错,不知道什么情况。。。
261 | _pubspecContent = '$_pubspecContent\n - $filePath';
262 | }
263 | }
264 | }
265 | }
266 |
267 | ```
268 |
269 | #### 创建Build
270 | `Build` 的作用主要是让生成器执行起来,我们这里创建的 `Build` 如下:
271 | ```Dart
272 | Builder imagePathBuilder(BuilderOptions options) =>
273 | LibraryBuilder(ImagePathGenerator());
274 | ```
275 | 主要引用的包为:
276 | ```Dart
277 | import 'package:build/build.dart';
278 | ```
279 |
280 | #### 创建 build.yaml 文件
281 | 在这里我们的 `build.yaml` 文件配置如下:
282 | ```yaml
283 | builders:
284 | image_builder:
285 | import: 'package:image_path_helper/builder.dart'
286 | builder_factories: ['imagePathBuilder']
287 | build_extensions: { '.dart': ['.g.dart'] }
288 | auto_apply: root_package
289 | build_to: source
290 | ```
291 | `build.yaml` 配置的信息,最终都会被 `build_config.dart` 中的 `BuildConfig` 类读取到。
292 | 关于参数说明,这里推荐官方说明[build_config](https://pub.dev/packages/build_config)。
293 |
294 | 一个完整的 `build.yaml` 结构图如下:
295 | 
296 | 一个 `build.yaml` 文件最终被一个 `BuildConfig` 对象所描述,也就是说 `build.yaml` 文件最终被 `BuildConfig` 所解析。而 `BuildConfig` 包含了四个关键的信息:
297 |
298 | key | value |default
299 | ---| --- | ---
300 | `targets` | `Map` | 单个的target应该所对应的package名一致
301 | `builders` | `Map` | /
302 | `post_process_builders` | `Map` | /
303 | `global_options` | `Map` | /
304 |
305 | 四个关键信息正是对应了 `build.yaml` 文件中的四个根节点,其中又以 `builders` 节点最为常用。
306 |
307 | ##### builders说明
308 |
309 | builders配置的是你的包中的所有 `Builder` 的配置信息,每个信息格式是 `Map` 的,比如我们存在一个这样的 `Builder`:
310 | ```Dart
311 | /// builder.dart
312 | Builder imagePathBuilder(BuilderOptions options) =>
313 | LibraryBuilder(ImagePathGenerator());
314 | ```
315 | 我们就可以在 `build.yaml` 文件中配置成这样:
316 | ```yaml
317 | builders:
318 | image_builder:
319 | import: 'package:image_path_helper/builder.dart'
320 | builder_factories: ['imagePathBuilder']
321 | build_extensions: { '.dart': ['.g.dart'] }
322 | auto_apply: root_package
323 | build_to: source
324 | ```
325 |
326 | `image_builder` 对应的就是 `Map` 中的 `String` 部分,`:` 后面的即 `BuilderDefinition` 信息,对应上面的结构图。下面我们细说 `BuilderDefinition` 中的每个参数的信息:
327 |
328 | 参数 | 参数类型 | 说明
329 | --- | --- | ---
330 | `builder_factories` | `List` | 必填参数,返回的 `Builder` 的方法名称的列表,例如上面的 `Builder` 方法名为 `imagePathBuilder`,则写成 `['imagePathBuilder']`
331 | `import` | `String` | 必填参数,导入`Builder`所在的包路径,格式为 `package:uri` 的字符串
332 | `build_extensions` | `Map>` | 必填参数,从输入扩展名到输出扩展名的映射。举个例子:比如注解使用的位置的文件对应的格式为 `.dart`,指定输出的文件格式可由 `.dart` 转换成 `.g.dart` 或 `.zip` 等等其他格式
333 | `auto_apply` | `String` | 可选参数,默认值为 `none`,对应源码中的 `AutoApply` 枚举类,有四种可选配置:`none`:除非手动配置了此生成器,否则请不要应用它`dependents`:将此Builder应用于包,直接依赖于暴露构建器的包`all_packages`:将此构建器应用于传递依赖关系图中的所有包`root_package`:仅将此生成器应用于顶级软件包
是不是感觉一脸懵逼?没关系,后面单独解释~~~
334 | `required_inputs` | `List` | 可选参数,用于调整构建顺序的,指定一个或一系列文件扩展名,表示在任何可能产生该类型输出的Builder之后运行
335 | `runs_before` | `List` | 可选参数,用于调整构建循序的,更上面的刚好相反,表示在指定的Builder之前运行 `BuilderKey`:表示一个 `target` 的身份标志,主要由对应 `Builder` 的包名和方法名构成,例如这样 `image_path_helper|imagePathBuilder`
336 | `applies_builders` | `List` | 可选参数,`Builder` 键列表,也就是身份标志,跟 `builder_factories` 参数配置应该是一一对应的
337 | `is_optional` | `bool` | 可选参数,默认值 `false`,指定是否可以延迟运行 `Builder` ,通常不需要配置
338 | `build_to` | `String` | 可选参数,默认值为 `cache`,主要为 `BuildTo` 枚举类的两个参数:`cache`:输出将进入隐藏的构建缓存,并且不会发布`source`:输出进入其主要输入旁边的源树
直白点就是如果你需要编译后生成相应的可在自己编写的源码中看到见的文件,就将这个参数设置成 `source`,如果指定的生成器返回的是 `null` 不需要生成文件,则可以设置为 `cache`
339 | `defaults` | `TargetBuilderConfigDefaults` | 可选参数:用户未在其`builders`【此处指的是 `targets` 节点下的`builders`,别搞混淆了!】部分中指定相应键时应用的默认值
340 |
341 |
342 | 关于 `auto_apply` 参数的详细说明:
343 | 
344 |
如上图所示,一个应用Package依赖了三个子包,此时我们有一个 `注解package` 包含了一些注解功能:
345 | - 当我们将`auto_apply`设置成 `dependents`时:
346 | - 如果 `注解package` 是直接依赖在 `sub_package02` 上的,那么只能在 `sub_package02` 上正常使用注解,虽然 `Package` 包依赖了 `sub_package02`,但是依然无法正常使用该注解
347 | - 当我们将`auto_apply`设置成 `all_packages`时:
348 | - 如果 `注解package` 是直接依赖在 `sub_package02` 上的,那么在 `sub_package02` 和 `Package`上都能正常使用注解
349 | - 当我们将`auto_apply`设置成 `root_package` 时:
350 | - 如果 `注解package` 是直接依赖在 `sub_package02` 上的,那么只能在 `Package` 上正常使用注解,虽然是 `sub_package02` 上做的依赖,但是就是不给用
351 | - 因此,假如 `注解package` 是直接依赖在 `Package` 上的时候,不管 `auto_apply` 设置的是 `dependents`、`all_packages` 或者是 `root_package` 时,其实都是能正常使用的!
352 |
353 |
354 | 至于 `build.yaml` 其他的三个节点参数,说实话,因为目前用到的不多,只了解一部分,有很多细节尚未理清,只能在这里略过了。
355 |
356 | #### 在需要使用的地方引入相关注解 & 运行编译命令进行构建
357 | 上面的工作完成之后,我们就需要引用注解了,比如我们在 `main()` 方法上引用:
358 | ```Dart
359 | @ImagePathSet('assets/', 'ImagePathTest')
360 | void main() => runApp(MyApp());
361 | ```
362 | 引用完注解之后,然后我们在Terminal命令行中执行下面这个命令完成编译:
363 | ```
364 | flutter packages pub run build_runner build
365 | ```
366 | 编译完成之后会生成对应的文件,比如我们上面配置的是在 `main.dart` 文件中的 `main` 方法上配置的,最终生成的文件为 `main.g.dart` ,关于文件是如何生成的,你可以参考 `run_builder.dart` 下的 `runBuilder` 方法和 `expected_outputs.dart` 下的 `expectedOutputs` 方法。
367 |
368 | 注意:如果需要重新构建建议先进行清除操作:
369 | ```
370 | flutter packages pub run build_runner clean
371 | ```
372 |
373 | 除此之外,建议在构建的时候执行下面的这个命令进行构建:
374 | ```
375 | flutter packages pub run build_runner build --delete-conflicting-outputs
376 | ```
377 |
378 | 至此,一个完整的利用注解一行代码+一行命令完成图片文件配置的功能就做完啦~~~
379 |
380 | ---
381 | ### 总结时刻
382 | 在Flutter中想要注解,只需要遵循一定的步骤加上自己的逻辑即可轻松完成相关功能开发,主要的流程步骤总结如下:
383 | - 依赖 `source_gen` 和 `build_runner` 库
384 | - 注解类创建以及创建生成器 `Generator`
385 | - 创建 `Builder`
386 | - 创建并配置 `build.yaml` 文件
387 | - 引用创建好的注解并运行相关命令完成相关操作
388 |
389 | **Tips**:本文源码位置:[image_path_helper](https://github.com/Reign9201/image_path_helper)
390 |
391 |
392 |
--------------------------------------------------------------------------------
/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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
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 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
44 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
46 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
47 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
48 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; };
49 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
51 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
52 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
53 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
54 | /* End PBXFileReference section */
55 |
56 | /* Begin PBXFrameworksBuildPhase section */
57 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
58 | isa = PBXFrameworksBuildPhase;
59 | buildActionMask = 2147483647;
60 | files = (
61 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
62 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXFrameworksBuildPhase section */
67 |
68 | /* Begin PBXGroup section */
69 | 9740EEB11CF90186004384FC /* Flutter */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 3B80C3931E831B6300D905FE /* App.framework */,
73 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
74 | 9740EEBA1CF902C7004384FC /* Flutter.framework */,
75 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
76 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
77 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
78 | );
79 | name = Flutter;
80 | sourceTree = "";
81 | };
82 | 97C146E51CF9000F007C117D = {
83 | isa = PBXGroup;
84 | children = (
85 | 9740EEB11CF90186004384FC /* Flutter */,
86 | 97C146F01CF9000F007C117D /* Runner */,
87 | 97C146EF1CF9000F007C117D /* Products */,
88 | );
89 | sourceTree = "";
90 | };
91 | 97C146EF1CF9000F007C117D /* Products */ = {
92 | isa = PBXGroup;
93 | children = (
94 | 97C146EE1CF9000F007C117D /* Runner.app */,
95 | );
96 | name = Products;
97 | sourceTree = "";
98 | };
99 | 97C146F01CF9000F007C117D /* Runner */ = {
100 | isa = PBXGroup;
101 | children = (
102 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
103 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
104 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
105 | 97C147021CF9000F007C117D /* Info.plist */,
106 | 97C146F11CF9000F007C117D /* Supporting Files */,
107 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
108 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
109 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
110 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
111 | );
112 | path = Runner;
113 | sourceTree = "";
114 | };
115 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
116 | isa = PBXGroup;
117 | children = (
118 | );
119 | name = "Supporting Files";
120 | sourceTree = "";
121 | };
122 | /* End PBXGroup section */
123 |
124 | /* Begin PBXNativeTarget section */
125 | 97C146ED1CF9000F007C117D /* Runner */ = {
126 | isa = PBXNativeTarget;
127 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
128 | buildPhases = (
129 | 9740EEB61CF901F6004384FC /* Run Script */,
130 | 97C146EA1CF9000F007C117D /* Sources */,
131 | 97C146EB1CF9000F007C117D /* Frameworks */,
132 | 97C146EC1CF9000F007C117D /* Resources */,
133 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
134 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
135 | );
136 | buildRules = (
137 | );
138 | dependencies = (
139 | );
140 | name = Runner;
141 | productName = Runner;
142 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
143 | productType = "com.apple.product-type.application";
144 | };
145 | /* End PBXNativeTarget section */
146 |
147 | /* Begin PBXProject section */
148 | 97C146E61CF9000F007C117D /* Project object */ = {
149 | isa = PBXProject;
150 | attributes = {
151 | LastUpgradeCheck = 1020;
152 | ORGANIZATIONNAME = "The Chromium Authors";
153 | TargetAttributes = {
154 | 97C146ED1CF9000F007C117D = {
155 | CreatedOnToolsVersion = 7.3.1;
156 | LastSwiftMigration = 0910;
157 | };
158 | };
159 | };
160 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
161 | compatibilityVersion = "Xcode 3.2";
162 | developmentRegion = en;
163 | hasScannedForEncodings = 0;
164 | knownRegions = (
165 | en,
166 | Base,
167 | );
168 | mainGroup = 97C146E51CF9000F007C117D;
169 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
170 | projectDirPath = "";
171 | projectRoot = "";
172 | targets = (
173 | 97C146ED1CF9000F007C117D /* Runner */,
174 | );
175 | };
176 | /* End PBXProject section */
177 |
178 | /* Begin PBXResourcesBuildPhase section */
179 | 97C146EC1CF9000F007C117D /* Resources */ = {
180 | isa = PBXResourcesBuildPhase;
181 | buildActionMask = 2147483647;
182 | files = (
183 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
184 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
185 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
186 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
187 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
188 | );
189 | runOnlyForDeploymentPostprocessing = 0;
190 | };
191 | /* End PBXResourcesBuildPhase section */
192 |
193 | /* Begin PBXShellScriptBuildPhase section */
194 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "Thin Binary";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
207 | };
208 | 9740EEB61CF901F6004384FC /* Run Script */ = {
209 | isa = PBXShellScriptBuildPhase;
210 | buildActionMask = 2147483647;
211 | files = (
212 | );
213 | inputPaths = (
214 | );
215 | name = "Run Script";
216 | outputPaths = (
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | shellPath = /bin/sh;
220 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
221 | };
222 | /* End PBXShellScriptBuildPhase section */
223 |
224 | /* Begin PBXSourcesBuildPhase section */
225 | 97C146EA1CF9000F007C117D /* Sources */ = {
226 | isa = PBXSourcesBuildPhase;
227 | buildActionMask = 2147483647;
228 | files = (
229 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
230 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
231 | );
232 | runOnlyForDeploymentPostprocessing = 0;
233 | };
234 | /* End PBXSourcesBuildPhase section */
235 |
236 | /* Begin PBXVariantGroup section */
237 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
238 | isa = PBXVariantGroup;
239 | children = (
240 | 97C146FB1CF9000F007C117D /* Base */,
241 | );
242 | name = Main.storyboard;
243 | sourceTree = "";
244 | };
245 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
246 | isa = PBXVariantGroup;
247 | children = (
248 | 97C147001CF9000F007C117D /* Base */,
249 | );
250 | name = LaunchScreen.storyboard;
251 | sourceTree = "";
252 | };
253 | /* End PBXVariantGroup section */
254 |
255 | /* Begin XCBuildConfiguration section */
256 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
257 | isa = XCBuildConfiguration;
258 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
259 | buildSettings = {
260 | ALWAYS_SEARCH_USER_PATHS = NO;
261 | CLANG_ANALYZER_NONNULL = YES;
262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
263 | CLANG_CXX_LIBRARY = "libc++";
264 | CLANG_ENABLE_MODULES = YES;
265 | CLANG_ENABLE_OBJC_ARC = YES;
266 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
267 | CLANG_WARN_BOOL_CONVERSION = YES;
268 | CLANG_WARN_COMMA = YES;
269 | CLANG_WARN_CONSTANT_CONVERSION = YES;
270 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
271 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
272 | CLANG_WARN_EMPTY_BODY = YES;
273 | CLANG_WARN_ENUM_CONVERSION = YES;
274 | CLANG_WARN_INFINITE_RECURSION = YES;
275 | CLANG_WARN_INT_CONVERSION = YES;
276 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
277 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
278 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
280 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
281 | CLANG_WARN_STRICT_PROTOTYPES = YES;
282 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
283 | CLANG_WARN_UNREACHABLE_CODE = YES;
284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
286 | COPY_PHASE_STRIP = NO;
287 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
288 | ENABLE_NS_ASSERTIONS = NO;
289 | ENABLE_STRICT_OBJC_MSGSEND = YES;
290 | GCC_C_LANGUAGE_STANDARD = gnu99;
291 | GCC_NO_COMMON_BLOCKS = YES;
292 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
293 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
294 | GCC_WARN_UNDECLARED_SELECTOR = YES;
295 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
296 | GCC_WARN_UNUSED_FUNCTION = YES;
297 | GCC_WARN_UNUSED_VARIABLE = YES;
298 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
299 | MTL_ENABLE_DEBUG_INFO = NO;
300 | SDKROOT = iphoneos;
301 | TARGETED_DEVICE_FAMILY = "1,2";
302 | VALIDATE_PRODUCT = YES;
303 | };
304 | name = Profile;
305 | };
306 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
307 | isa = XCBuildConfiguration;
308 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
309 | buildSettings = {
310 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
311 | CLANG_ENABLE_MODULES = YES;
312 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
313 | ENABLE_BITCODE = NO;
314 | FRAMEWORK_SEARCH_PATHS = (
315 | "$(inherited)",
316 | "$(PROJECT_DIR)/Flutter",
317 | );
318 | INFOPLIST_FILE = Runner/Info.plist;
319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
320 | LIBRARY_SEARCH_PATHS = (
321 | "$(inherited)",
322 | "$(PROJECT_DIR)/Flutter",
323 | );
324 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
325 | PRODUCT_NAME = "$(TARGET_NAME)";
326 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
327 | SWIFT_VERSION = 4.0;
328 | VERSIONING_SYSTEM = "apple-generic";
329 | };
330 | name = Profile;
331 | };
332 | 97C147031CF9000F007C117D /* Debug */ = {
333 | isa = XCBuildConfiguration;
334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
335 | buildSettings = {
336 | ALWAYS_SEARCH_USER_PATHS = NO;
337 | CLANG_ANALYZER_NONNULL = YES;
338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
339 | CLANG_CXX_LIBRARY = "libc++";
340 | CLANG_ENABLE_MODULES = YES;
341 | CLANG_ENABLE_OBJC_ARC = YES;
342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
343 | CLANG_WARN_BOOL_CONVERSION = YES;
344 | CLANG_WARN_COMMA = YES;
345 | CLANG_WARN_CONSTANT_CONVERSION = YES;
346 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
348 | CLANG_WARN_EMPTY_BODY = YES;
349 | CLANG_WARN_ENUM_CONVERSION = YES;
350 | CLANG_WARN_INFINITE_RECURSION = YES;
351 | CLANG_WARN_INT_CONVERSION = YES;
352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
353 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
354 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
355 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
356 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
357 | CLANG_WARN_STRICT_PROTOTYPES = YES;
358 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
359 | CLANG_WARN_UNREACHABLE_CODE = YES;
360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
361 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
362 | COPY_PHASE_STRIP = NO;
363 | DEBUG_INFORMATION_FORMAT = dwarf;
364 | ENABLE_STRICT_OBJC_MSGSEND = YES;
365 | ENABLE_TESTABILITY = YES;
366 | GCC_C_LANGUAGE_STANDARD = gnu99;
367 | GCC_DYNAMIC_NO_PIC = NO;
368 | GCC_NO_COMMON_BLOCKS = YES;
369 | GCC_OPTIMIZATION_LEVEL = 0;
370 | GCC_PREPROCESSOR_DEFINITIONS = (
371 | "DEBUG=1",
372 | "$(inherited)",
373 | );
374 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
375 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
376 | GCC_WARN_UNDECLARED_SELECTOR = YES;
377 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
378 | GCC_WARN_UNUSED_FUNCTION = YES;
379 | GCC_WARN_UNUSED_VARIABLE = YES;
380 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
381 | MTL_ENABLE_DEBUG_INFO = YES;
382 | ONLY_ACTIVE_ARCH = YES;
383 | SDKROOT = iphoneos;
384 | TARGETED_DEVICE_FAMILY = "1,2";
385 | };
386 | name = Debug;
387 | };
388 | 97C147041CF9000F007C117D /* Release */ = {
389 | isa = XCBuildConfiguration;
390 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
391 | buildSettings = {
392 | ALWAYS_SEARCH_USER_PATHS = NO;
393 | CLANG_ANALYZER_NONNULL = YES;
394 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
395 | CLANG_CXX_LIBRARY = "libc++";
396 | CLANG_ENABLE_MODULES = YES;
397 | CLANG_ENABLE_OBJC_ARC = YES;
398 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_COMMA = YES;
401 | CLANG_WARN_CONSTANT_CONVERSION = YES;
402 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
403 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
404 | CLANG_WARN_EMPTY_BODY = YES;
405 | CLANG_WARN_ENUM_CONVERSION = YES;
406 | CLANG_WARN_INFINITE_RECURSION = YES;
407 | CLANG_WARN_INT_CONVERSION = YES;
408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
413 | CLANG_WARN_STRICT_PROTOTYPES = YES;
414 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
415 | CLANG_WARN_UNREACHABLE_CODE = YES;
416 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
417 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
418 | COPY_PHASE_STRIP = NO;
419 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
420 | ENABLE_NS_ASSERTIONS = NO;
421 | ENABLE_STRICT_OBJC_MSGSEND = YES;
422 | GCC_C_LANGUAGE_STANDARD = gnu99;
423 | GCC_NO_COMMON_BLOCKS = YES;
424 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
425 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
426 | GCC_WARN_UNDECLARED_SELECTOR = YES;
427 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
428 | GCC_WARN_UNUSED_FUNCTION = YES;
429 | GCC_WARN_UNUSED_VARIABLE = YES;
430 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
431 | MTL_ENABLE_DEBUG_INFO = NO;
432 | SDKROOT = iphoneos;
433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
434 | TARGETED_DEVICE_FAMILY = "1,2";
435 | VALIDATE_PRODUCT = YES;
436 | };
437 | name = Release;
438 | };
439 | 97C147061CF9000F007C117D /* Debug */ = {
440 | isa = XCBuildConfiguration;
441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
442 | buildSettings = {
443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
444 | CLANG_ENABLE_MODULES = YES;
445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
446 | ENABLE_BITCODE = NO;
447 | FRAMEWORK_SEARCH_PATHS = (
448 | "$(inherited)",
449 | "$(PROJECT_DIR)/Flutter",
450 | );
451 | INFOPLIST_FILE = Runner/Info.plist;
452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
453 | LIBRARY_SEARCH_PATHS = (
454 | "$(inherited)",
455 | "$(PROJECT_DIR)/Flutter",
456 | );
457 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
458 | PRODUCT_NAME = "$(TARGET_NAME)";
459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
461 | SWIFT_VERSION = 4.0;
462 | VERSIONING_SYSTEM = "apple-generic";
463 | };
464 | name = Debug;
465 | };
466 | 97C147071CF9000F007C117D /* Release */ = {
467 | isa = XCBuildConfiguration;
468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
469 | buildSettings = {
470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
471 | CLANG_ENABLE_MODULES = YES;
472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
473 | ENABLE_BITCODE = NO;
474 | FRAMEWORK_SEARCH_PATHS = (
475 | "$(inherited)",
476 | "$(PROJECT_DIR)/Flutter",
477 | );
478 | INFOPLIST_FILE = Runner/Info.plist;
479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
480 | LIBRARY_SEARCH_PATHS = (
481 | "$(inherited)",
482 | "$(PROJECT_DIR)/Flutter",
483 | );
484 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
485 | PRODUCT_NAME = "$(TARGET_NAME)";
486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
487 | SWIFT_VERSION = 4.0;
488 | VERSIONING_SYSTEM = "apple-generic";
489 | };
490 | name = Release;
491 | };
492 | /* End XCBuildConfiguration section */
493 |
494 | /* Begin XCConfigurationList section */
495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
496 | isa = XCConfigurationList;
497 | buildConfigurations = (
498 | 97C147031CF9000F007C117D /* Debug */,
499 | 97C147041CF9000F007C117D /* Release */,
500 | 249021D3217E4FDB00AE95B9 /* Profile */,
501 | );
502 | defaultConfigurationIsVisible = 0;
503 | defaultConfigurationName = Release;
504 | };
505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
506 | isa = XCConfigurationList;
507 | buildConfigurations = (
508 | 97C147061CF9000F007C117D /* Debug */,
509 | 97C147071CF9000F007C117D /* Release */,
510 | 249021D4217E4FDB00AE95B9 /* Profile */,
511 | );
512 | defaultConfigurationIsVisible = 0;
513 | defaultConfigurationName = Release;
514 | };
515 | /* End XCConfigurationList section */
516 |
517 | };
518 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
519 | }
520 |
--------------------------------------------------------------------------------