Update to flutter3

This commit is contained in:
Shohei YOSHIDA 2022-06-13 12:45:00 +09:00
parent 2e3c3f6cf0
commit 63d333ce88
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 365 additions and 175 deletions

View File

@ -32,6 +32,7 @@
# -------
#
# * Nikolai Simonov (https://github.com/NiKoTron) <nickolay.simonov@gmail.com>
# * Shohei Yoshida (https://github.com/syohex) <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
_flutter() {
@ -46,19 +47,28 @@ local ret=1
_arguments -C -A "-*" \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-v --verbose)'{-v,--verbose}'[Noisy logging, including all shell commands executed.]' \
'--prefixed-errors[Causes lines sent to stderr to be prefixed with "ERROR:"]' \
'--quiet[Reduce the amount of output from some commands.]' \
'(--no-wrap --wrap)--wrap[Whether to use output word wrapping]' \
'(--wrap --no-wrap)--no-wrap[Whether to use output word wrapping]' \
'--wrap-column=[Set the output wrap column]:number:' \
'(-d --device-id)'{-d,--device-id}'[Target device id or name (prefixes allowed).]' \
'--version[Reports the version of this tool.]' \
'--color[Whether to use terminal colors.]' \
'--no-color[Whether to use terminal colors.]' \
'--machine[When used with the "--version" flag, outputs the information using JSON]' \
'(--no-color --color)--color[Whether to use terminal colors.]' \
'(--color --no-color)--no-color[Whether to use terminal colors.]' \
'(--no-version-check --version-check)--version-check[Allow Flutter to check for updates when this command runs]' \
'(--version-check --no-version-check)--no-version-check[Not allow Flutter to check for updates when this command runs]' \
'--suppress-analytics[Suppress analytics reporting when this command runs.]' \
'--bug-report[Captures a bug report file to submit to the Flutter team (contains local paths, device identifiers, and log snippets).]' \
'--packages[Path to your ".packages" file. (required, since the current directory does not contain a ".packages" file)]' \
'--flutter-root[The root directory of the Flutter repository (uses $FLUTTER_ROOT if set).]' \
'--local-engine-src-path=[Path to your engine src directory]: :_path_files -/' \
'--local-engine=[Name of a build output within the engine out directory]' \
'--show-test-device=[List the special "flutter-tester" device in device listings]' \
'--show-web-server-device=[List the special "web-server" device in device listings]' \
'1: :_root_commands' \
'*::arg:->args' \
&& ret=0
case "$state" in
(args)
case $words[1] in
@ -70,35 +80,61 @@ _arguments -C -A "-*" \
(analyze)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--flutter-repo[Include all the examples and tests from the Flutter repository.]' \
'--no-flutter-repo[Include all the examples and tests from the Flutter repository.]' \
'--current-package[Include the lib/main.dart file from the current directory, if any. (defaults to on)]' \
'--no-current-package[Include the lib/main.dart file from the current directory, if any. (defaults to on)]' \
'--watch[Run analysis continuously, watching the filesystem for changes.]' \
'--preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
'--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
'--write=[Also output the results to a file. This is useful with --watch if you want a file to always contain the latest results.]: :_files -/' \
'--write=[Also output the results to a file.]: :_files ' \
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--congratulate[When analyzing the flutter repository, show output even when there are no errors, warnings, hints, or lints. (defaults to on)]' \
'--no-congratulate[When analyzing the flutter repository, show output even when there are no errors, warnings, hints, or lints. (defaults to on)]' \
'--preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \
'--no-preamble[When analyzing the flutter repository, display the number of files that will be analyzed. (defaults to on)]' \
'--congratulate[When analyzing, show output even when there are no errors/warnings/hints/lints (defaults to on)]' \
'--no-congratulate[When analyzing, show output even when there are no errors/warnings/hints/lints(defaults to on)]' \
'--preamble[When analyzing, display the number of files that will be analyzed. (defaults to on)]' \
'--no-preamble[When analyzing, display the number of files that will be analyzed. (defaults to on)]' \
'(--no-fatal-infos --fatal-infos)--fatal-infos[Treat info level issues as fatal]' \
'(--no-fatal-infos --fatal-infos)--no-fatal-infos[Not treat info level issues as fatal]' \
'(--no-fatal-warnings --fatal-warnings)--fatal-warnings[Treat warning level issues as fatal]' \
'(--no-fatal-warnings --fatal-warnings)--no-fatal-warnings[Not treat warning level issues as fatal]' \
&& ret=0
;;
(assemble)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
{-d,--define=}'[Allows passing configuration to a target]: :' \
'--performance-measurement-file[Output individual target performance to a JSON file]' \
{-i,--input=}'[Allows passing additional input]: :' \
'--depfile=[A file path where a depfile will be written]: :_path_files' \
'--build-inputs=[A file path where a newline-separated file containing all inputs used will be written after a build]: :_path_files' \
'(-o --output)'{-o,--output=}'[A directory where output files will be written]: :_path_files -/' \
'*--dart-define=[Additional key-value pairs that will be available as constants]: :' \
'--resouce-pool-size=[The maximum number of concurrent tasks the build system will run]:number:' \
&& ret=0
;;
(attach)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--debug[Build a debug version of your app (default mode).]' \
'--profile[Build a version of your app specialized for performance profiling.]' \
'(-t --target)'{-t,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]::_files -g "*.dart"' \
'--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \
'--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \
'*--dart-define=[Additional key-value pairs that will be available as constants]: :' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \
'--null-assertions[Perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--no-null-assertions[Not perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--debug-url=[The URL at which the observatory is listening]:url:' \
'--app-id=[The package name (Android) or bundle identifier (iOS) for the app]:app_id:' \
'--pid-file=[Specify a file to write the process id to]::_files' \
'--track-widget-creation[Track widget creation locations. (defaults to on)]' \
'--no-track-widget-creation[Not rack widget creation locations. (defaults to on)]' \
'--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port:' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
&& ret=0
;;
(bash-completion)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(--no-overwrite --overwrite)--overwrite[Overwritten completion setup if it already exists]' \
'(--overwrite --no-overwrite)--no-overwrite[Not overwritten completion setup if it already exists]' \
&& ret=0
;;
(build)
@ -123,37 +159,78 @@ _arguments -C -A "-*" \
'--analytics[Enable or disable reporting anonymously tool usage statistics and crash reports.]' \
'--no-analytics[Enable or disable reporting anonymously tool usage statistics and crash reports.]' \
'--clear-ios-signing-cert[Clear the saved development certificate choice used to sign apps for iOS device deployment.]' \
'--gradle-dir[The gradle install directory.]' \
'--android-sdk[The Android SDK directory.]' \
'--android-studio-dir[The Android Studio install directory.]' \
'--android-sdk=[The Android SDK directory.]: :_path_files -/' \
'--android-studio-dir=[The Android Studio install directory.]: :_path_files -/' \
'--build-dir=[The relative path to override a projects build directory]: :_path_files -/' \
'(--no-enable-web --enable-web)--enable-web[Enable Flutter for web]' \
'(--no-enable-web --enable-web)--no-enable-web[Disable Flutter for web]' \
'(--no-enable-linux-desktop --enable-linux-desktop)--enable-linux-desktop[Enable support for desktop on Linux]' \
'(--no-enable-linux-desktop --enable-linux-desktop)--no-enable-linux-desktop[Disable support for desktop on Linux]' \
'(--no-enable-macos-desktop --enable-macos-desktop)--enable-macos-desktop[Enable support for desktop on macOS]' \
'(--no-enable-macos-desktop --enable-macos-desktop)--no-enable-macos-desktop[Disable support for desktop on macOS]' \
'(--no-enable-windows-desktop --enable-windows-desktop)--enable-windows-desktop[Enable support for desktop on Windows]' \
'(--no-enable-windows-desktop --enable-windows-desktop)--no-enable-windows-desktop[Disable support for desktop on Windows]' \
'(--no-enable-windows-uwp-desktop --enable-windows-uwp-desktop)--enable-windows-uwp-desktop[Enable support for desktop on Windows UWP]' \
'(--no-enable-windows-uwp-desktop --enable-windows-uwp-desktop)--no-enable-windows-uwp-desktop[Disable support for desktop on Windows UWP]' \
'(--no-single-widget-reload-optimization --single-widget-reload-optimization)--single-widget-reload-optimization[Enable Hot reload optimization for a single widget]' \
'(--no-single-widget-reload-optimization --single-widget-reload-optimization)--no-single-widget-reload-optimization[Disable Hot reload optimization for a single widget]' \
'(--no-enable-android --enable-android)--enable-android[Enable Flutter for Android]' \
'(--no-enable-android --enable-android)--no-enable-android[Disable Flutter for Android]' \
'(--no-enable-ios --enable-ios)--enable-ios[Enable Flutter for iOS]' \
'(--no-enable-ios --enable-ios)--no-enable-ios[Disable Flutter for iOS]' \
'(--no-enable-fuchsia --enable-fuchsia)--enable-fuchsia[Enable Flutter for Fuchsia]' \
'(--no-enable-fuchsia --enable-fuchsia)--no-enable-fuchsia[Disable Flutter for Fuchsia]' \
'(--no-enable-custom-devices --enable-custom-devices)--enable-custom-devices[Enable Early support for custom device types]' \
'(--no-enable-custom-devices --enable-custom-devices)--no-custom-devices[Disable Early support for custom device types]' \
'--clear-features[Remove all configured features and restore them to the default values]' \
&& ret=0
;;
(create)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \
'--no-pub[Whether to run "flutter packages get" after the project has been created. (defaults to on)]' \
'--offline[When "flutter packages 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-offline[When "flutter packages 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.]' \
"--with-driver-test[Also add a fl:_root_commandsutter_driver dependency and generate a sample 'flutter drive' test.]" \
"--no-with-driver-test[Also add a flutter_driver dependency and generate a sample 'flutter drive' test.]" \
'(-t= --template=)'{-t=,--template=}'[Specify the type of project to create.]: :_project_templates' \
"--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')]" \
'(-i= --ios-language)'{-i=,--ios-language}'[iOS project language]: :_ios_languages' \
'(-a= --android-language)'{-a=,--android-language}'[Android project language]: :_droid_languages' \
'--offline[Offline mode when "flutter packages get" is run]' \
'--no-offline[Offline mode when "flutter packages get" is run]' \
'--overwrite[When performing operations, overwrite existing files.]' \
'--no-overwrite[When performing operations, not overwrite existing files.]' \
"--description=[The description to use for your new Flutter project. (defaults to 'A new Flutter project.')]::" \
"--org=[The organization responsible for new Flutter project, in reverse domain name notation.(defaults to 'com.example')]::" \
'--project-name=[The project name for this new Flutter project]:name:' \
'(-i --ios-language)'{-i,--ios-language=}'[iOS project language]: :_ios_languages' \
'(-a --android-language)'{-a,--android-language=}'[Android project language]: :_droid_languages' \
'--platforms[The platforms supported by this project]' \
'(-t --template=)'{-t,--template=}'[Specify the type of project to create.]: :_project_templates' \
'(-s --sample=)'{-s,--sample=}'[Specifies the Flutter code sample to use as the "main.dart" for an application]:id:' \
'--list-samples=[Specifies a JSON output file for a listing of Flutter code samples that can be created with "--sample"]::_path_files' \
&& ret=0
;;
(custom-devices)
_arguments -C \
'1: :_custom_devices_subcommands' \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
&& ret=0
;;
(daemon)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--listen-on-tcp-port=[If specified, the daemon will be listening for commands on the specified port instead of stdio]:port:' \
&& ret=0
;;
(debug-adapter)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port:' \
'(--no-test --test)--test[use the "flutter test" debug adapter to run tests]' \
'(--no-test --test)--no-test[not use the "flutter test" debug adapter to run tests]' \
&& ret=0
;;
(devices)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--machine[Output device information in machine readable structured JSON format.]' \
"--device-timeout=[Time in seconds to wait for devices to attach]:seconds:" \
&& ret=0
;;
(doctor)
@ -162,119 +239,157 @@ _arguments -C -A "-*" \
"--android-licenses[Run the Android SDK manager tool to accept the SDK's licenses.]" \
&& ret=0
;;
(downgrade)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
&& ret=0
;;
(drive)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--debug[Build a debug version of your app (default mode).]' \
'--profile[Build a version of your app specialized for performance profiling.]' \
'--release[Build a release version of your app.]' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts. Supports the use of custom Xcode schemes.]' \
'*--dart-define=[Additional key-value pairs that will be available as constants]: :' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup.]' \
'--web-renderer[The renderer implementation to use when building for the web]: :(auto canvaskit html)' \
'--trace-startup[Start tracing during startup.]' \
'(--cache-startup-profile --no-cache-startup-profile)--cache-startup-profile[Caches the CPU profile collected before the first frame for startup analysis.]' \
'(--cache-startup-profile --no-cache-startup-profile)--no-cache-startup-profile[Not caches the CPU profile collected before the first frame for startup analysis.]' \
'--verbose-system-logs[Include verbose logging from the Flutter engine]' \
'--cache-sksl[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \
'--dump-skp-on-shader-compilation[Cache the shader in the SkSL format instead of in binary or GLSL formats.]' \
'--purge-persistent-cache[Removes all existing persistent caches]' \
'--route[Which route to load when running the app.]' \
'--target-platform[Specify the target platform when building the app for an Android device. Ignored on iOS.]: :_target_platforms' \
'(-t= --target=)'{-t=,-target=}'[The main entry-point file of the application, as run on the device. If the --target option is omitted, but a file name is provided on the command line, then that is used instead. (defaults to "lib/main.dart")]: :_files -g "*.dart"' \
'--observatory-port[Listen to the given port for an observatory debugger connection. Specifying port 0 will find a random free port. Defaults to the first available port after 8100.]' \
'--use-application-binary=[Specify a pre-built application binary to use when running]::_files -g "*.apk"' \
'(--no-start-paused --start-paused)--start-paused[Start in a paused mode and wait for a debugger to connect.]' \
'(--no-start-paused --start-paused)--no-start-paused[Not tart in a paused mode and wait for a debugger to connect.]' \
'--endless-trace-buffer[Enable tracing to an infinite buffer, instead of a ring buffer]' \
'--trace-systrace[Enable tracing to the system tracer]' \
'--trace-skia[Enable tracing of Skia code]' \
*{-a,--dart-entrypoint-args=}'[Pass a list of arguments to the Dart entrypoint at application startup]: :' \
'--web-launch-url=[The URL to provide to the browser]: :' \
'(-t --target=)'{-t,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]: :_files -g "*.dart"' \
'--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \
'--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--no-keep-app-running[Will keep the Flutter application running when done testing. By default, "flutter drive" stops the application after tests are finished, and --keep-app-running overrides this. On the other hand, if --use-existing-app is specified, then "flutter drive" instead defaults to leaving the application running, and --no-keep-app-running overrides it.]' \
'--keep-app-running[Will keep the Flutter application running when done testing. By default, "flutter drive" stops the application after tests are finished, and --keep-app-running overrides this. On the other hand, if --use-existing-app is specified, then "flutter drive" instead defaults to leaving the application running, and --no-keep-app-running overrides it.]' \
'--use-existing-app=[Connect to an already running instance via the given observatory URL. If this option is given, the application will not be automatically started, and it will only be stopped if --no-keep-app-running is explicitly set.]' \
'--driver=[The test file to run on the host (as opposed to the target file to run on the device). By default, this file has the same base name as the target file, but in the "test_driver/" directory instead, and with "_test" inserted just before the extension, so e.g. if the target is "lib/main.dart", the driver will be "test_driver/main_test.dart".]: :_files' \
'--preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
'--no-preview-dart-2[Preview Dart 2.0 functionality. (defaults to on)]' \
'--track-widget-creation[Track widget creation locations. (defaults to on)]' \
'--no-track-widget-creation[Not rack widget creation locations. (defaults to on)]' \
'--null-assertions[Perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--no-null-assertions[Not perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
'--dds-port=[the Dart Development Service (DDS) will be bound to the provided port]:port:' \
*{-P,--android-project-arg=}'[Additional arguments specified as key=value that are passed directly to the gradle project]: :' \
'--multidex[indicates that the app should be built with multidex support(defaults to on)]' \
'--no-multidex[indicates that the app should not be built with multidex support(defaults to on)]' \
'--no-keep-app-running[Will not keep the Flutter application running when done testing.]' \
'--keep-app-running[Will keep the Flutter application running when done testing.]' \
'--use-existing-app=[Connect to an already running instance via the given observatory URL.]' \
'--driver=[The test file to run on the host]: :_files' \
'--build[If necessary, build the app before running. (defaults to on)]' \
'--no-build[If necessary, not build the app before running]' \
'--screenshot=[Directory location to write screenshots on test failure]::_path_files -/' \
'--driver-port=[The port where Webdriver server is launched at(default to "4444")]:port:' \
'(--no-headless --headless)--headless[Launch driver browser in headless mode(defaults to on)]' \
'(--no-headless --headless)--no-headless[Not launch driver browser in headless mode]' \
'--browser-name=[Name of the browser where tests will be executed]: :(android-chrome chrome edge firefox ios-safari safari)' \
'--browser-dimension=[The dimension of the browser when running a Flutter Web test(defaults to "1600,1024")]: :' \
'(--no-android-emulator --android-emulator)--android-emulator[Perform Flutter Driver testing using an Android Emulator]' \
'(--no-android-emulator --android-emulator)--no-android-emulator[Not perform Flutter Driver testing using an Android Emulator]' \
'--chrome-binary=[Location of the Chrome binary.]::_files' \
'--write-sksl-on-exit[Attempts to write an SkSL file when the drive process is finished to the provided file, overwriting it if necessary]' \
'*--test-artuments=[Additional arguments to pass to the Dart VM running The test script.]: :' \
'--profile-memory=[Launch devtools and profile application memory, writing the output data as JSON]::_files -g "*.json"' \
&& ret=0
;;
(emulators)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--launch[The full or partial ID of the emulator to launch]' \
'--cold[Used with the "--launch" flag to cold boot the emulator instance (Android only)]' \
'--create[Creates a new Android emulator based on a Pixel device]' \
'--name[Used with the "--create" flag. Specifies a name for the emulator being created]' \
&& ret=0
;;
(format)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-h --help)'{-h,--help}'[Print this usage information]' \
'(-v --verbose)'{-v,--verbose}'[Show all options and flags with --help]' \
'(-o --output)'{-o,--output=}'[Set where to write formatted output]: :(json none show write)' \
'--set-exit-if-changed[Return exit code 1 if there are any formatting changes]' \
'--fix[Apply all style fixes.]' \
'(-l --line-length)'{-l,--line-length=}'[Wrap lines longer than this(defaults to 80)]:lines:' \
&& ret=0
;;
(fuchsia_reload)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--debug[Build a debug version of your app (default mode).]' \
'--profile[Build a version of your app specialized for performance profiling.]' \
'--release[Build a release version of your app.]' \
'(-a --address)'{-a,--address}'[Fuchsia device network name or address.]' \
'(-b --build-dir)'{-b,--build-dir}'[Fuchsia build directory, e.g. out/release-x86-64.]' \
'(-g --gn-target)'{-g,--gn-target}'[GN target of the application, e.g //path/to/app:app.]' \
'(-i --isolate-number)'{-i,--isolate-number}'[To reload only one instance, specify the isolate number, e.g. the number in foo$main-###### given by --list.]' \
'(-l --list)'{-l,--list}'[Lists the running modules.]' \
'(-l --no-list)'{-l,--no-list}'[Lists the running modules.]' \
'(-n --name-override)'{-n,--name-override}'[On-device name of the application binary.]' \
'(-2 --preview-dart-2)'{-2,--preview-dart-2}'[Preview Dart 2.0 functionality.]' \
'(-2 --no-preview-dart-2)'{-2,--no-preview-dart-2}'[Preview Dart 2.0 functionality.]' \
'(-t --target)'{-t,--target}'[Target app path / main entry-point file. Relative to --gn-target path, e.g. lib/main.dart. (defaults to "lib/main.dart")]' \
&& ret=0
;;
(ide-config)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--overwrite[When performing operations, overwrite existing files.]' \
'--no-overwrite[When performing operations, overwrite existing files.]' \
'--update-templates[Update the templates in the template directory from the current configuration files. This is the opposite of what ide-config usually does. Will search the flutter tree for .iml files and copy any missing ones into the template directory. If --overwrite is also specified, it will update any out-of-date files, and remove any deleted files from the template directory.]' \
&& ret=0
;;
(inject-plugins)
(gen-l10n)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--arb-dir=[The directory where template arb files are located]::_path_files -/' \
'--output-dir=[The directory where the generated localization classes will be written]::_path_files -/' \
'--template-arb-file=[The path of template arb file]::_files' \
'--output-localization-file=[The filename for the output localization and localizations delegate classes]::_files -g "*.dart"' \
'--untranslated-messages-file=[The file that describes the localization messages have not been translated yet]::_files' \
'--output-class=[The Dart class name to use for the output localization and localizations delegate classes]:class:' \
'--preferred-supported-locales=[The list of preferred supported locales for the application]::' \
'--header=[The header to prepend to the generated Dart localizations files]:header:' \
'--header-file=[The header to prepend to the generated Dart localizations files]::_files' \
'(--no-use-deferred-loading --use-deferred-loading)--use-deferred-loading[Generate the Dart localization file as deferred]' \
'(--no-use-deferred-loading --use-deferred-loading)--no-use-deferred-loading[Not generate the Dart localization file as deferred]' \
'--gen-inputs-and-outputs-list=[the tool generates a JSON file containing the tools inputs and outputs]::_path_files -/' \
'(--no-synthetic-package --synthetic-package)--synthetic-package[Generate files as a synthetic package]' \
'(--no-synthetic-package --synthetic-package)--no-synthetic-package[Not generate files as a synthetic package]' \
'--project-dir=[the directory of the root Flutter project]::_path_files -/' \
'(--no-required-resource-attributes --required-resource-attributes)--required-resource-attributes[Requires all resource ids to contain a corresponding resource attribute.]' \
'(--no-required-resource-attributes --required-resource-attributes)--no-required-resource-attributes[Requires all resource ids to contain a corresponding resource attribute.]' \
'(--no-nullable-getter --nullable-getter)--nullable-getter[The localizations class getter is nullable.]' \
'(--no-nullable-getter --nullable-getter)--no-nullable-getter[The localizations class getter is not nullable.]' \
&& ret=0
;;
(install)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
'(--no-uninstall-only --uninstall-only)--uninstall-only[Uninstall the app if already on the device. Skip install.]' \
'(--no-uninstall-only --uninstall-only)--no-uninstall-only[Uninstall the app if already on the device. Skip install.]' \
&& ret=0
;;
(logs)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-c --clear)'{-c,--clear}'[Clear log history before reading from logs.]' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
&& ret=0
;;
(packages)
_arguments -C \
'1: :_package_subcomands' \
'*::pkg-arg:->pkg-args' \
&& ret=0
case "$state" in
(pkg-args)
case $words[1] in
(get)
_arguments \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--offline[Use cached packages instead of accessing the network.]' \
&& ret=0
;;
(pub)
_arguments \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
&& ret=0
;;
(test)
_arguments \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
&& ret=0
;;
(upgrade)
_arguments \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--offline[Use cached packages instead of accessing the network.]' \
&& ret=0
;;
esac
;;
esac
;;
(precache)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-a --all-platforms)]'{-a--all-platforms}'[Precache artifacts for all platforms.]' \
'(-a --all-platforms)'{-a,--all-platforms}'[Precache artifacts for all platforms.]' \
'(-f --force)'{-f,--force}'[Force re-downloading of artifacts]' \
'(--no-ios --ios)--ios[Precache artifacts for iOS development]' \
'(--no-ios --ios)--no-ios[Not precache artifacts for iOS development]' \
'(--no-web --web)--web[Precache artifacts for web development]' \
'(--no-web --web)--no-web[Not precache artifacts for web development]' \
'(--no-linux --linux)--linux[Precache artifacts for Linux desktop development]' \
'(--no-linux --linux)--no-linux[Not recache artifacts for Linux desktop development]' \
'(--no-windows --windows)--windows[Precache artifacts for Windows desktop development]' \
'(--no-windows --windows)--no-windows[Not precache artifacts for Windows desktop development]' \
'(--no-winuwp --winuwp)--winuwp[Precache artifacts for Windows UWP desktop development]' \
'(--no-winuwp --winuwp)--no-winuwp[Not recache artifacts for Windows UWP desktop development]' \
'(--no-macos --macos)--macos[Precache artifacts for macOS desktop development]' \
'(--no-macos --macos)--no-macos[Not precache artifacts for macOS desktop development]' \
'(--no-fuchsia --fuchsia)--fuchsia[Precache artifacts for Fuchsia development]' \
'(--no-fuchsia --fuchsia)--no-fuchsia[Not precache artifacts for Fuchsia development]' \
'(--no-universal --universal)--universal[Precache artifacts required for any development platform]' \
'(--no-universal --universal)--no-universal[Not precache artifacts required for any development platform]' \
&& ret=0
;;
(pub)
_arguments -C \
'1: :_pub_subcommands' \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
&& ret=0
;;
(run)
@ -283,98 +398,123 @@ _arguments -C -A "-*" \
'--debug[Build a debug version of your app (default mode).]' \
'--profile[Build a version of your app specialized for performance profiling.]' \
'--release[Build a release version of your app.]' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup. Supports the use of product flavors in Android Gradle scripts. Supports the use of custom Xcode schemes.]' \
'*--dart-define=[Additional key-value pairs that will be available as constants]: :' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup.]' \
'--web-renderer[The renderer implementation to use when building for the web]: :(auto canvaskit html)' \
'--trace-startup[Start tracing during startup.]' \
'(--cache-startup-profile --no-cache-startup-profile)--cache-startup-profile[Caches the CPU profile collected before the first frame for startup analysis.]' \
'(--cache-startup-profile --no-cache-startup-profile)--no-cache-startup-profile[Not caches the CPU profile collected before the first frame for startup analysis.]' \
'--verbose-system-logs[Include verbose logging from the Flutter engine]' \
'--cache-sksl[Cache the shader in the SkSL format instead of in binary or GLSL formats]' \
'--dump-skp-on-shader-compilation[Cache the shader in the SkSL format instead of in binary or GLSL formats.]' \
'--purge-persistent-cache[Removes all existing persistent caches]' \
'--route[Which route to load when running the app.]' \
'--target-platform[Specify the target platform when building the app for an Android device. Ignored on iOS.]: :_target_platforms' \
'(-t= --target=)'{-t=,--target=}'[The main entry-point file of the application, as run on the device. If the --target option is omitted, but a file name is provided on the command line, then that is used instead. (defaults to "lib/main.dart")]: :_files -g "*.dart"' \
'--observatory-port[Listen to the given port for an observatory debugger connection. Specifying port 0 will find a random free port.Defaults to the first available port after 8100.]' \
'--use-application-binary=[Specify a pre-built application binary to use when running]::_files -g "*.apk"' \
'(--no-start-paused --start-paused)--start-paused[Start in a paused mode and wait for a debugger to connect.]' \
'(--no-start-paused --start-paused)--no-start-paused[Not start in a paused mode and wait for a debugger to connect.]' \
'--endless-trace-buffer[Enable tracing to an infinite buffer, instead of a ring buffer]' \
'--trace-systrace[Enable tracing to the system tracer]' \
'--trace-skia[Enable tracing of Skia code]' \
*{-a,--dart-entrypoint-args=}'[Pass a list of arguments to the Dart entrypoint at application startup]: :' \
'--web-launch-url=[The URL to provide to the browser]: :' \
'(-t= --target=)'{-t=,--target=}'[The main entry-point file of the application, as run on the device.(defaults to "lib/main.dart")]: :_files -g "*.dart"' \
'--device-vmservice-port=[Look for vmservice connections only from the specified port]:port:' \
'--host-vmservice-port=[When a device-side vmservice port is forwarded to a host-side port]:port:' \
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--full-restart[Stop any currently running application process before running the app. (defaults to on)]' \
'--no-full-restart[Stop any currently running application process before running the app. (defaults to on)]' \
'--start-paused[Start in a paused mode and wait for a debugger to connect.]' \
'--enable-software-rendering[Enable rendering using the Skia software backend. This is useful when testing Flutter on emulators. By default, Flutter will attempt to either use OpenGL or Vulkan and fall back to software when neither is available.]' \
'--skia-deterministic-rendering When combined with --enable-software-rendering, provides 100% deterministic Skia rendering.]' \
'--trace-skia[Enable tracing of Skia code. This is useful when debugging the GPU thread. By default, Flutter will not log skia code.]' \
'--use-test-fonts[Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode.]' \
'--no-use-test-fonts[Enable (and default to) the "Ahem" font. This is a special font used in tests to remove any dependencies on the font metrics. It is enabled when you use "flutter test". Set this flag when running a test using "flutter run" for debugging purposes. This flag is only available when running in debug mode.]' \
'--track-widget-creation[Track widget creation locations. (defaults to on)]' \
'--no-track-widget-creation[Not rack widget creation locations. (defaults to on)]' \
'--null-assertions[Perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--no-null-assertions[Not perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
'--dds-port=[When this value is provided, the Dart Development Service (DDS) will be bound to the provided port]:port:' \
*{-P,--android-project-arg=}'[Additional arguments specified as key=value that are passed directly to the gradle project via the -P flag]: :' \
'--multidex[indicates that the app should be built with multidex support(defaults to on)]' \
'--no-multidex[indicates that the app should not be built with multidex support(defaults to on)]' \
'--ignore-deprecation[Indicates that the app should ignore deprecation warnings and continue to build using deprecated APIs]' \
'--enable-software-rendering[Enable rendering using the Skia software backend.]' \
'--skia-deterministic-rendering[When combined with --enable-software-rendering, provides 100% deterministic Skia rendering.]' \
'--await-first-frame-when-tracing[Wait for the first frame when tracing startup ("--trace-startup")(defaults to on)]' \
'--no-await-first-frame-when-trasing[Just dump the trace as soon as the application is running]' \
'--use-test-fonts[Enable (and default to) the "Ahem" font.]' \
'--no-use-test-fonts[Not enable (and default to) the "Ahem" font.]' \
'--build[If necessary, build the app before running. (defaults to on)]' \
'--no-build[If necessary, build the app before running. (defaults to on)]' \
'--hot[Run with support for hot reloading. (defaults to on)]' \
'--no-hot[Run with support for hot reloading. (defaults to on)]' \
'--pid-file[Specify a file to write the process id to. You can send SIGUSR1 to trigger a hot reload and SIGUSR2 to trigger a full restart.]' \
'--pid-file=[Specify a file to write the process id to.]::_files' \
&& ret=0
;;
(screenshot)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-o --out)'{-o,--out}'[Location to write the screenshot.]: :_files' \
'--skia=[Retrieve the last frame rendered by a Flutter app as a Skia picture using the specified observatory port. To find the observatory port number, use "flutter run --verbose" and look for "Forwarded host port ... for Observatory" in the output.]' \
'(-o --out)'{-o,--out=}'[Location to write the screenshot.]: :_files' \
'--observatory-url=[The Observatory URL to which to connect]:uri:' \
'--type=[The type of screenshot to retrieve.]: :(device rasterizer skia)' \
'--device-timeout=[Time in seconds to wait for devices to attach]:seconds:' \
&& ret=0
;;
(stop)
(symbolize)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-d --debug-info)'{-d,--debug-info=}'[A path to the symbols file generated with "--split-debug-info"]: :_files' \
'(-i --input)'{-i,--input=}'[A file path containing a Dart stack trace.]: :_files' \
'(-o --output)'{-o,--output=}'[A file path for a symbolized stack trace to be written to]: :_files' \
&& ret=0
;;
(test)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--no-pub[Whether to run "flutter packages get" before executing this command. (defaults to on)]' \
'--pub[Run "flutter packages get" before executing this command. (defaults to on)]' \
'--no-pub[Not to run "flutter packages get" before executing this command]' \
'--null-assertions[Perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--no-null-assertions[Not perform additional null assertions on the boundaries of migrated and un-migrated code]' \
'--track-widget-creation[Track widget creation locations]' \
'--no-track-widget-creation[Not track widget creation locations]' \
'*--dart-define=[Additional key-value pairs that will be available as constants]: :' \
'--web-renderer[The renderer implementation to use when building for the web]: :(auto canvaskit html)' \
'--device-user=[Identifier number for a user or work profile on Android only]:id:' \
'--flavor[Build a custom app flavor as defined by platform-specific build setup]' \
'--name=[A regular expression matching substrings of the names of tests to run.]' \
'--plain-name=[A plain-text substring of the names of tests to run.]' \
'--start-paused[Start in a paused mode and wait for a debugger to connect. You must specify a single test file to run, explicitly. Instructions for connecting with a debugger and printed to the console once the test has started.]' \
*{-t,--tags=}'[Run only tests associated with the specified tags]:tag:' \
*{-x,--exclude-tags=}'[Run only tests that do not have the specified tags]:tag:' \
'--start-paused[Start in a paused mode and wait for a debugger to connect.]' \
'--run-skipped[Run skipped tests instead of skipping them]' \
'--no-run-skipped[Not run skipped tests instead of skipping them]' \
'--coverage[Whether to collect coverage information.]' \
'--merge-coverage[Whether to merge coverage data with "coverage/lcov.base.info". Implies collecting coverage data. (Requires lcov)]' \
'--coverage-path[Where to store coverage information (if coverage is enabled). (defaults to "coverage/lcov.info")]' \
&& ret=0
(trace)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--start[Start tracing.]' \
'--stop[Stop tracing.]' \
'--out[Specify the path of the saved trace file.]' \
'(-d --duration)'{-d,--duration}'[Duration in seconds to trace. (defaults to "10")]' \
'--debug-port[Local port where the observatory is listening. (defaults to "8100")]' \
&& ret=0
;;
(update-packages)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'--force-upgrade[Attempt to update all the dependencies to their latest versions. This will actually modify the pubspec.yaml files in your checkout.]' \
'--no-force-upgrade[Attempt to update all the dependencies to their latest versions. This will actually modify the pubspec.yaml files in your checkout.]' \
'--paths[Finds paths in the dependency chain leading from package specified in --from to package specified in --to.]' \
'--no-paths[Finds paths in the dependency chain leading from package specified in --from to package specified in --to.]' \
'--from[Used with flag --dependency-path. Specifies the package to begin searching dependency path from.]' \
'--to[Used with flag --dependency-path. Specifies the package that the sought after dependency path leads to.]' \
'--transitive-closure[Prints the dependency graph that is the transitive closure of packages the Flutter SDK depends on.]' \
'--no-transitive-closure[Prints the dependency graph that is the transitive closure of packages the Flutter SDK depends on.]' \
'--verify-only[verifies the package checksum without changing or updating deps]' \
'--no-verify-only[verifies the package checksum without changing or updating deps]' \
'--merge-coverage[Whether to merge coverage data with "coverage/lcov.base.info" (Requires lcov)]' \
'--coverage-path=[Where to store coverage information (if coverage is enabled). (defaults to "coverage/lcov.info")]::_files' \
'--update-goldens[Whether "matchesGoldenFile()" calls within your test methods should update the golden files]' \
{-j,--concurrency=}'[The number of concurrent test processes to run]:nums:' \
'--test-assets[Build the assets bundle for testing]' \
'--no-test-assets[Not build the assets bundle for testing]' \
'--test-randomize-ordering-seed[The seed to randomize the execution order of test cases within test files]' \
'--total-shards[Tests can be sharded with the "--total-shards" and "--shard-index" arguments]' \
'--shard-index[Tests can be sharded with the "--total-shards" and "--shard-index" arguments]' \
{-r,--reporter=}'[Set how to print test results]: :(compact expanded json)' \
'--timeout=[The default test timeout, specified either in seconds (e.g. "60s"). Defaults to "30s"]:seconds:' \
'--dds-port=[the Dart Development Service (DDS) will be bound to the provided port]:port:' \
&& ret=0
;;
(upgrade)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
&& ret=0
;;
(version)
_arguments -C \
'(-h --help)'{-h,--help}'[Print this usage information.]' \
'(-f --force)'{-f,--force}'[Force upgrade the flutter branch, potentially discarding local changes]' \
'--verify-only[Checks for any new Flutter updates, without actually fetching them]' \
&& ret=0
;;
esac
;;
esac
return ret
}
(( $+functions[_root_commands] )) ||
_root_commands() {
local commands;
@ -388,63 +528,87 @@ _root_commands() {
'clean:Delete the build/ directory.'
'config:Configure Flutter settings.'
'create:Create a new Flutter project.'
'custom-devices:List, reset, add and delete custom devices'
'daemon:Run a persistent, JSON-RPC based server to communicate with devices.'
'debug-adapter:Run a Debug Adapter Protol server to communicate with the Flutter tool'
'downgrade:Downgrade Flutter to the last active version for the current channel'
'devices:List all connected devices.'
'doctor:Show information about the installed tooling.'
'drive:Runs Flutter Driver tests for the current project.'
'emulators:List, launch and create emulators.'
'format:Format one or more dart files.'
'fuchsia_reload:Hot reload on Fuchsia.'
'gen-l10n:Generate localizations for the current project.'
'help:Display help information for flutter.'
'ide-config:Configure the IDE for use in the Flutter tree.'
'inject-plugins:Re-generates the GeneratedPluginRegistrants.'
'install:Install a Flutter app on an attached device.'
'logs:Show log output for running Flutter apps.'
'packages:Commands for managing Flutter packages.'
"precache:Populates the Flutter tool's cache of binary artifacts."
'pub:Commands for managing Flutter packages.'
'run:Run your Flutter app on an attached device.'
'screenshot:Take a screenshot from a connected device.'
'stop:Stop your Flutter app on an attached device.'
'symbolize:Symbolize a stack trace from an AOT-compiled Flutter app.'
'test:Run Flutter unit tests for the current project.'
'trace:Start and stop tracing for a running Flutter app.'
'update-packages:Update the packages inside the Flutter repo.'
'upgrade:Upgrade your copy of Flutter.'
'version:List or switch flutter versions.')
)
_describe -t commands 'command' commands "$@"
}
(( $+functions[_build_entities] )) ||
_build_entities() {
local entities;
entities=("aot:Build an ahead-of-time compiled snapshot of your app's Dart code."
"apk:Build an Android APK file from your app."
"flx:Build a Flutter FLX file from your app."
"ios:Build an iOS application bundle (Mac OS X host only).")
entities=(
"aar:Build a repository containing an AAR and a POM file."
"apk:Build an Android APK file from your app."
"appbundle:Build an Android App Bundle file from your app."
"bundle:Build the Flutter assets directory from your app."
"fuchsia:Build the Fuchsia target."
"ios:Build an iOS application bundle (Mac OS X host only)."
"linux:Build a Linux desktop application."
"macos:Build a macOS desktop application."
"windows:Build a Windows desktop application."
"winuwp:Build a Windows UWP desktop application."
)
_describe -t entities 'entity' entities "$@"
}
(( $+functions[_custom_devices_subcommands] )) ||
_custom_devices_subcommands() {
local subcmds;
subcmds=(
"add:Add a new device the custom devices config file"
"delete:Delete a device from the config file"
"list:List the currently configured custom devices, both enabled and disabled, reachable or not"
"reset:Reset the config file to the default"
)
_describe -t subcmds 'subcommands' subcmds "$@"
}
(( $+functions[_project_templates] )) ||
_project_templates() {
local templates;
templates=("app:(default) Generate a Flutter 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.")
templates=(
"app:(default) Generate a Flutter application."
"module:Generate a shareable Flutter project containing modular Dart code."
"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."
"plugin_ffi:Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation through dart:ffi for Android, iOS, Linux, macOS, Windows, or any combination of these."
"skeleton:Generate a List View / Detail View Flutter application that follows community best practices."
)
_describe -t templates 'template' templates "$@"
}
(( $+functions[_ios_languages] )) ||
_ios_languages() {
local languages;
languages=("objc:(default) Objective-C."
"swift:Swift.")
languages=("objc:Objective-C."
"swift:(default) Swift.")
_describe -t languages 'language' languages "$@"
}
(( $+functions[_droid_languages] )) ||
_droid_languages() {
local languages;
languages=("java:(default) Java."
"kotlin:Kotlin.")
languages=("java:Java."
"kotlin:(default) Kotlin.")
_describe -t languages 'language' languages "$@"
}
@ -468,4 +632,30 @@ _package_subcomands() {
_describe -t subcommands 'subcommand' subcommands "$@"
}
(( $+functions[_pub_subcommands] )) ||
_pub_subcommands() {
local subcommands;
subcommands=(
"add:Add a dependency to pubspec.yaml"
"cache:Work with the Pub system cache"
"deps:Print package dependencies"
"downgrade:Downgrade packages in a Flutter project"
"get:Get packages in a Flutter project"
"global:Work with Pub global packages"
"login:Log into pub.dev"
"logout:Log out of pub.dev"
"outdated:Analyze dependencies to find which ones can be upgraded"
"pub:Pass the remaining arguments to Dart's 'pub' tool"
"publish:Publish the current package to pub.dartlang.org"
"remove:Removes a dependency from the current package"
"run:Run an executable from a package"
"test:Run the 'test' package"
"token:Manage authentication tokens for hosted pub repositories"
"upgrade:Upgrade the current package's dependencies to latest versions"
"uploader:Manage uploaders for a package on pub.dev"
"version:Print Pub version"
)
_describe -t subcommands 'subcommand' subcommands "$@"
}
_flutter "$@"