zuke.tools.flutter
@zuke/flutter 1.0.0: @zuke/flutter — typed FlutterTasks wrappers for the [Flutter](https://flutter.dev) CLI, for use in Zuke builds: analyze, test, build every artifact, manage pub dependencies, and drive devices and the SDK.
zuke on PyPI ↗ 20 symbols
Symbols
class FlutterAnalyzeSettings(FlutterSettings) Settings for flutter analyze.
-
path(path: str) -> SelfA file or directory to analyze (defaults to the project); repeatable.
-
no_fatal_infos() -> SelfDo not fail on info-level issues (
--no-fatal-infos). -
no_fatal_warnings() -> SelfDo not fail on warnings (
--no-fatal-warnings). -
write(path: str) -> SelfAlso write the analysis results to a file (
--write).
class FlutterAppSettings(FlutterCompileSettings) Compile flags plus the build mode and the entry point (--target), shared by flutter build and flutter drive.
-
mode(mode: Literal['debug', 'profile', 'release']) -> SelfThe build mode (
--debug,--profileor--release). -
release() -> SelfBuild in release mode (
--release). -
target(path: str) -> SelfThe main entry-point file, instead of
lib/main.dart(--target).
class FlutterCommandSettings(FlutterSettings) Settings for a flagless command: flutter clean, or flutter gen-l10n (configured by l10n.yaml). Extra flags go through .args().
class FlutterCompileSettings(FlutterSettings) Flags shared by the commands that compile Dart code: --no-pub, --dart-define, --dart-define-from-file and --flavor.
-
no_pub() -> SelfSkip the implicit
flutter pub get(--no-pub). -
dart_define(name: str, value: str) -> SelfDefine a compile-time constant (
--dart-define=name=value); repeatable. -
dart_define_from_file(path: str) -> SelfRead compile-time constants from a JSON or
.envfile (--dart-define-from-file); repeatable. -
flavor(name: str) -> SelfThe build flavor, for apps with product flavors or schemes (
--flavor).
class FlutterConfigSettings(FlutterSettings) Settings for flutter config.
-
enable(feature: str) -> SelfTurn a feature on, e.g.
web→--enable-web; repeatable. -
disable(feature: str) -> SelfTurn a feature off, e.g.
web→--no-enable-web; repeatable. -
android_sdk(dir: str) -> SelfThe Android SDK directory (
--android-sdk). -
no_analytics() -> SelfTurn analytics reporting off (
--no-analytics). -
clear_features() -> SelfReset every feature flag to its default (
--clear-features).
class FlutterCreateSettings(FlutterSettings) Settings for flutter create.
-
dir(path: str) -> SelfThe directory to create the project in; required.
-
org(org: str) -> SelfThe reverse-domain organization, e.g.
com.example(--org). -
project_name(name: str) -> SelfThe Dart package name, instead of the directory's (
--project-name). -
description(text: str) -> SelfThe project description (
--description). -
template(name: str) -> SelfThe template:
app,module,package,plugin, … (--template). -
platform(name: str) -> SelfA platform to scaffold, e.g.
androidorweb(--platforms); repeatable. -
empty() -> SelfScaffold a minimal app without the counter sample (
--empty).
class FlutterDevicesSettings(FlutterSettings) Settings for flutter devices.
-
machine() -> SelfPrint the devices as JSON (
--machine).
class FlutterDoctorSettings(FlutterSettings) Settings for flutter doctor.
-
verbose() -> SelfShow full details for every check (
--verbose).
class FlutterDriveSettings(FlutterAppSettings) Settings for flutter drive, which runs integration tests on a device.
-
driver(path: str) -> SelfThe test driver file, e.g.
test_driver/integration_test.dart(--driver). -
device_id(id: str) -> SelfThe device to run on, e.g.
chromeor an emulator id (--device-id). -
screenshot(dir: str) -> SelfSave a screenshot to this directory if the run fails (
--screenshot).
class FlutterInstallSettings(FlutterSettings) Settings for flutter install, which installs a built app on a device.
-
mode(mode: Literal['debug', 'profile', 'release']) -> SelfInstall the build of this mode (
--debug,--profileor--release). -
flavor(name: str) -> SelfInstall this build flavor (
--flavor). -
device_id(id: str) -> SelfThe device to install on (
--device-id). -
use_application_binary(path: str) -> SelfInstall this prebuilt binary instead (
--use-application-binary). -
uninstall_only() -> SelfOnly uninstall the app (
--uninstall-only).
class FlutterPrecacheSettings(FlutterSettings) Settings for flutter precache, which downloads platform artifacts.
-
platform(name: str) -> SelfFetch a platform's artifacts, e.g.
android→--android; repeatable. -
force() -> SelfRe-download even when cached (
--force).
class FlutterPubDepsSettings(FlutterSettings) Settings for flutter pub deps.
-
json() -> SelfPrint the dependency graph as JSON (
--json).
class FlutterPubGetSettings(FlutterSettings) Settings for flutter pub get.
-
offline() -> SelfResolve from the local pub cache only (
--offline). -
enforce_lockfile() -> SelfFail rather than change
pubspec.lock(--enforce-lockfile).
class FlutterPubOutdatedSettings(FlutterSettings) Settings for flutter pub outdated.
-
json() -> SelfPrint machine-readable JSON (
--json). -
show_all() -> SelfInclude packages that are already up to date (
--show-all).
class FlutterPubPackagesSettings(FlutterSettings) Settings for flutter pub add and flutter pub remove.
-
package(spec: str) -> SelfA package to add or remove; repeatable, at least one is required. For
addit takes pub's descriptor syntax:http,http:^1.2.0, ordev:mocktailfor a dev dependency.
class FlutterPubUpgradeSettings(FlutterSettings) Settings for flutter pub upgrade.
-
package(name: str) -> SelfUpgrade only this package (defaults to all); repeatable.
-
major_versions() -> SelfAlso raise constraints in
pubspec.yamlacross majors (--major-versions). -
tighten() -> SelfRaise lower bounds in
pubspec.yamlto the resolved versions (--tighten).
class FlutterSettings(ToolSettings) Base for all flutter settings: the binary is flutter, found on PATH.
class FlutterTasks Typed task functions for the flutter CLI.
-
static async analyze(ctx: ServiceContext, configure: Callable[[FlutterAnalyzeSettings], FlutterAnalyzeSettings] | None=None) -> ExecResultAnalyze the project's Dart code:
flutter analyze. -
static async test(ctx: ServiceContext, configure: Callable[[FlutterTestSettings], FlutterTestSettings] | None=None) -> ExecResultRun the unit and widget tests:
flutter test. -
static async pub_get(ctx: ServiceContext, configure: Callable[[FlutterPubGetSettings], FlutterPubGetSettings] | None=None) -> ExecResultResolve dependencies:
flutter pub get. -
static async pub_upgrade(ctx: ServiceContext, configure: Callable[[FlutterPubUpgradeSettings], FlutterPubUpgradeSettings] | None=None) -> ExecResultUpgrade dependencies:
flutter pub upgrade. -
static async pub_outdated(ctx: ServiceContext, configure: Callable[[FlutterPubOutdatedSettings], FlutterPubOutdatedSettings] | None=None) -> ExecResultList outdated dependencies:
flutter pub outdated. -
static async pub_deps(ctx: ServiceContext, configure: Callable[[FlutterPubDepsSettings], FlutterPubDepsSettings] | None=None) -> ExecResultPrint the dependency graph:
flutter pub deps. -
static async pub_add(ctx: ServiceContext, configure: Callable[[FlutterPubPackagesSettings], FlutterPubPackagesSettings]) -> ExecResultAdd dependencies to
pubspec.yaml:flutter pub add. -
static async pub_remove(ctx: ServiceContext, configure: Callable[[FlutterPubPackagesSettings], FlutterPubPackagesSettings]) -> ExecResultRemove dependencies from
pubspec.yaml:flutter pub remove. -
static async clean(ctx: ServiceContext, configure: Callable[[FlutterCommandSettings], FlutterCommandSettings] | None=None) -> ExecResultDelete the build and
.dart_tooldirectories:flutter clean. -
static async create(ctx: ServiceContext, configure: Callable[[FlutterCreateSettings], FlutterCreateSettings]) -> ExecResultScaffold a project:
flutter create. -
static async gen_l10n(ctx: ServiceContext, configure: Callable[[FlutterCommandSettings], FlutterCommandSettings] | None=None) -> ExecResultGenerate localizations from
l10n.yaml:flutter gen-l10n. -
static async drive(ctx: ServiceContext, configure: Callable[[FlutterDriveSettings], FlutterDriveSettings] | None=None) -> ExecResultRun integration tests on a device:
flutter drive. -
static async install(ctx: ServiceContext, configure: Callable[[FlutterInstallSettings], FlutterInstallSettings] | None=None) -> ExecResultInstall a built app on a device:
flutter install. -
static async devices(ctx: ServiceContext, configure: Callable[[FlutterDevicesSettings], FlutterDevicesSettings] | None=None) -> ExecResultList connected devices:
flutter devices. -
static async doctor(ctx: ServiceContext, configure: Callable[[FlutterDoctorSettings], FlutterDoctorSettings] | None=None) -> ExecResultCheck the toolchain:
flutter doctor. -
static async precache(ctx: ServiceContext, configure: Callable[[FlutterPrecacheSettings], FlutterPrecacheSettings] | None=None) -> ExecResultDownload platform artifacts:
flutter precache. -
static async config(ctx: ServiceContext, configure: Callable[[FlutterConfigSettings], FlutterConfigSettings] | None=None) -> ExecResultChange SDK settings:
flutter config. -
static async version(ctx: ServiceContext, configure: Callable[[FlutterVersionSettings], FlutterVersionSettings] | None=None) -> ExecResultPrint the Flutter, Dart and engine versions:
flutter --version.
class FlutterTestSettings(FlutterCompileSettings) Settings for flutter test.
-
path(path: str) -> SelfA test file or directory to run (defaults to
test/); repeatable. -
coverage() -> SelfCollect coverage into
coverage/lcov.info(--coverage). -
coverage_path(path: str) -> SelfWhere to write the lcov coverage report (
--coverage-path). -
merge_coverage() -> SelfMerge with the existing coverage report (
--merge-coverage). -
name(pattern: str) -> SelfRun only tests whose name matches a regular expression (
--name); repeatable. -
plain_name(text: str) -> SelfRun only tests whose name contains a string (
--plain-name); repeatable. -
tags(expression: str) -> SelfRun only tests with a tag expression (
--tags). -
exclude_tags(expression: str) -> SelfSkip tests matching a tag expression (
--exclude-tags). -
concurrency(count: float) -> SelfHow many test suites to run at once (
--concurrency). -
reporter(name: str) -> SelfThe console reporter:
compact,expanded,github,json, … (--reporter). -
file_reporter(spec: str) -> SelfAlso write a reporter's output to a file, e.g.
json:report.json(--file-reporter). -
update_goldens() -> SelfRewrite golden files instead of comparing against them (
--update-goldens). -
platform(name: str) -> SelfRun on a platform other than the VM, e.g.
chrome(--platform). -
randomize_ordering_seed(seed: str | float) -> SelfShuffle test order with a seed, or
random(--test-randomize-ordering-seed). -
timeout(value: str) -> SelfThe default per-test timeout, e.g.
30sor2x(--timeout). -
shard(index: float, total: float) -> SelfRun one shard of the suite:
shard(index, total)renders--total-shards total --shard-index index, withindexfrom 0.
class FlutterVersionSettings(FlutterSettings) Settings for flutter --version.
-
machine() -> SelfPrint the versions as JSON (
--machine).