最終更新:2021-12-08 (水) 07:59:10 (869d)  

flutter create
Top / flutter create

help

  • Create a new Flutter project.
    
    If run on a project that already exists, this will repair the project, recreating any files that are missing.
    
    Global options:
    -h, --help                  Print this usage information.
    -v, --verbose               Noisy logging, including all shell commands executed.
                                If used with "--help", shows hidden options. If used with "flutter doctor", shows additional
                                diagnostic information. (Use "-vv" to force verbose logging in those cases.)
    -d, --device-id             Target device id or name (prefixes allowed).
        --version               Reports the version of this tool.
        --suppress-analytics    Suppress analytics reporting when this command runs.
    
    Usage: flutter create <output directory>
    -h, --help                   Print this usage information.
        --[no-]pub               Whether to run "flutter pub get" after the project has been created.
                                 (defaults to on)
        --[no-]offline           When "flutter pub get" is run by the create command, this indicates whether to run it in
                                 offline mode or not. In offline mode, it will need to have all dependencies already
                                 available in the pub cache to succeed.
        --[no-]overwrite         When performing operations, overwrite existing files.
        --description            The description to use for your new Flutter project. This string ends up in the
                                 pubspec.yaml file.
                                 (defaults to "A new Flutter project.")
        --org                    The organization responsible for your new Flutter project, in reverse domain name notation.
                                 This string is used in Java package names and as prefix in the iOS bundle identifier.
                                 (defaults to "com.example")
        --project-name           The project name for this new Flutter project. This must be a valid dart package name.
    -i, --ios-language           The language to use for iOS-specific code, either ObjectiveC (legacy) or Swift
                                 (recommended).
                                 [objc, swift (default)]
    -a, --android-language       The language to use for Android-specific code, either Java (legacy) or Kotlin
                                 (recommended).
                                 [java, kotlin (default)]
        --platforms              The platforms supported by this project. Platform folders (e.g. android/) will be generated
                                 in the target project. This argument only works when "--template" is set to app or plugin.
                                 When adding platforms to a plugin project, the pubspec.yaml will be updated with the
                                 requested platform. Adding desktop platforms requires the corresponding desktop config
                                 setting to be enabled.
                                 [ios (default), android (default), windows (default), linux (default), macos (default), web
                                 (default)]
    -t, --template=<type>        Specify the type of project to create.
    
              [app]              (default) Generate a Flutter application.
              [module]           Generate a project to add a Flutter module to an existing Android or iOS application.
              [package]          Generate a shareable Flutter project containing modular Dart code.
              [plugin]           Generate a shareable Flutter project containing an API in Dart code with a
                                 platform-specific implementation for Android, for iOS code, or for both.
              [skeleton]         Generate a List View / Detail View Flutter application that follows community best
                                 practices.
    
    -s, --sample=<id>            Specifies the Flutter code sample to use as the "main.dart" for an application. Implies
                                 "--template=app". The value should be the sample ID of the desired sample from the API
                                 documentation website (http://docs.flutter.dev/). An example can be found at:
                                 https://api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html
        --list-samples=<path>    Specifies a JSON output file for a listing of Flutter code samples that can be created with
                                 "--sample".
    
    Run "flutter help" to see global options.

  • flutter create example
    Creating project example...
      example/test/widget_test.dart (created)
      example/pubspec.yaml (created)
      example/README.md (created)
      example/lib/main.dart (created)
      example/ios/Runner.xcworkspace/contents.xcworkspacedata (created)
      example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (created)
      example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (created)
      example/ios/Runner/Info.plist (created)
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png (created)
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png (created)
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (created)
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (created)
      example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (created)
      example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (created)
      example/ios/Runner/Base.lproj/LaunchScreen.storyboard (created)
      example/ios/Runner/Base.lproj/Main.storyboard (created)
      example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (created)
      example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (created)
      example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings (created)
      example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (created)
      example/ios/Flutter/Debug.xcconfig (created)
      example/ios/Flutter/Release.xcconfig (created)
      example/ios/Flutter/AppFrameworkInfo.plist (created)
      example/ios/.gitignore (created)
      example/example.iml (created)
      example/.gitignore (created)
      example/web/favicon.png (created)
      example/web/index.html (created)
      example/web/manifest.json (created)
      example/web/icons/Icon-maskable-512.png (created)
      example/web/icons/Icon-192.png (created)
      example/web/icons/Icon-maskable-192.png (created)
      example/web/icons/Icon-512.png (created)
      example/.metadata (created)
      example/android/app/src/profile/AndroidManifest.xml (created)
      example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (created)
      example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (created)
      example/android/app/src/main/res/drawable/launch_background.xml (created)
      example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (created)
      example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (created)
      example/android/app/src/main/res/values-night/styles.xml (created)
      example/android/app/src/main/res/values/styles.xml (created)
      example/android/app/src/main/res/drawable-v21/launch_background.xml (created)
      example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (created)
      example/android/app/src/main/AndroidManifest.xml (created)
      example/android/app/src/debug/AndroidManifest.xml (created)
      example/android/gradle/wrapper/gradle-wrapper.properties (created)
      example/android/gradle.properties (created)
      example/android/.gitignore (created)
      example/android/settings.gradle (created)
      example/android/app/build.gradle (created)
      example/android/app/src/main/kotlin/com/example/example/MainActivity.kt (created)
      example/android/build.gradle (created)
      example/android/example_android.iml (created)
      example/ios/Runner/Runner-Bridging-Header.h (created)
      example/ios/Runner/AppDelegate.swift (created)
      example/ios/Runner.xcodeproj/project.pbxproj (created)
      example/analysis_options.yaml (created)
      example/.idea/runConfigurations/main_dart.xml (created)
      example/.idea/libraries/Dart_SDK.xml (created)
      example/.idea/libraries/KotlinJavaRuntime.xml (created)
      example/.idea/modules.xml (created)
      example/.idea/workspace.xml (created)
    Running "flutter pub get" in example...                          2,436ms
    Wrote 81 files.
    
    All done!
    In order to run your application, type:
    
      $ cd example
      $ flutter run
    
    Your application code is in example/lib/main.dart.