cli library
The flutter3d command line, as functions: runFlutter3d, the whole
command, and the parts a test or a tool calls on its own (convert,
doctor, create project). Every file in bin/ is one line over
runFlutter3d: bin/flutter3d.dart the command, the others its
subcommands under their dart run flutter3d_build:<name> names.
A library of its own, not part of flutter3d_build.dart, which the
build hook imports: the hook has no use for a Unity or USD reader and
should not compile one.
Classes
- CliExit
-
The exit codes every
flutter3dsubcommand answers with. - CliOptionSet
-
The options one subcommand reads: flags alone, valued with the
argument after them (or
--name=value). - ConvertCommandSettings
- The parsed command line.
- ConvertOutcome
- How one input ended.
- ConvertReport
- One input's report.
- DoctorCheck
- One line of the doctor's report.
- DoctorStatus
- How a check came out.
- ExternalTool
- A program found or not, with what installs it.
- ProjectKind
-
What a new project is for, which decides what
lib/main.dartdraws and what the project depends on.
Constants
- blender → const ExternalTool
-
Blender, for
.blendand for an.fbxwhen FBX2glTF is absent. -
cliCommands
→ const List<
String> -
The subcommands, in the order
flutter3d helplists them. -
cliJsonBodies
→ const Map<
String, String> -
The keys each subcommand's
--jsondocument carries aftercommand, asflutter3d help --surfaceprints them andapi/flutter3d_build.clicommits them, so a key removed or renamed is a change somebody reviews.?marks a key that may be absent;[...]a list of the object that follows. - cliJsonVersion → const int
-
The version of the
--jsonoutput's shape, written in every document a subcommand prints with--jsonas the envelope'sversion. -
cliOptions
→ const Map<
String, CliOptionSet> -
What each subcommand reads, by the words that name it (
create pluginfor the form ofcreatethat makes a plugin). - convertReportFormat → const FormatSpec
-
The file
flutter3d convert --report <file>writes, for aFormatRegistry: the envelope, thenreports, one ConvertReport an input. - convertReportVersion → const int
-
The version of the document
--reportwrites, and the newest convertReportsFrom reads. - convertUsage → const String
-
flutter3d convert's help. - createUsage → const String
-
What
flutter3d help createprints. - dartFloor → const String
- The Dart every pubspec's floor names (SUPPORT.md, "The Flutter and Dart SDKs"). A structure test reads that section and holds these to it.
- dartTested → const String
- The Dart CI runs the plain Dart packages on.
- decodeWorkerUsage → const String
-
What
flutter3d help decode-workerprints. - doctorUsage → const String
-
What
flutter3d help doctorprints. -
externalTools
→ const List<
ExternalTool> -
Every converter tool, in the order
doctorlists them. - fbx2gltf → const ExternalTool
-
FBX to glTF, the first choice for an
.fbx. - flutter3dUsage → const String
-
What
flutter3dprints with no arguments orhelp. - flutterFloor → const String
- The Flutter floor of every package that names Flutter.
- flutterTested → const String
- The Flutter stable CI runs.
- helpUsage → const String
-
What
flutter3d help helpprints. - initUsage → const String
-
What
flutter3d help initprints, and whatinitprints to stderr after an unknown option or a second project directory. - lightmapUsage → const String
-
What
flutter3d help lightmapprints. - lightsUsage → const String
-
What
dart run flutter3d_build:lightsprints when it is asked wrongly. - migrateUsage → const String
-
What
flutter3d help migrateprints. - pluginsUsage → const String
-
What
flutter3d help pluginsprints. - shadersUsage → const String
-
What
flutter3d help shadersprints. - usdcat → const ExternalTool
-
usdcat, for a binary (crate) USD layer. - visibilityUsage → const String
-
What
flutter3d help visibilityprints.
Functions
-
cliJson(
String command, Map< String, Object?> body) → Map<String, Object?> -
bodyas a subcommand's--jsondocument: the format envelope every flutter3d JSON document starts with (formatf3d.cli,versioncliJsonVersion,requires,generator), thencommand, then the subcommand's own keys, whose shapes cliJsonBodies lists. -
cliSurface(
) → String -
The whole surface, as
flutter3d help --surfaceprints it andapi/flutter3d_build.clicommits it: the top-level usage, then each subcommand's own help under a== <command> ==line. -
compareVersions(
String a, String b) → int -
Compares two dotted versions, ignoring anything after a space or
-. Negative whenais older. -
convertReportDocument(
Iterable< ConvertReport> reports) → Map<String, Object?> -
reportsas--reportwrites them. -
convertReportsFrom(
Object? json) → List< Map< String, Object?> > -
The reports a
--reportfile holds, each as ConvertReport.toJson wrote it: from the enveloped document, or from the bare list the file was before 1.0. -
createProject(
String target, String name, {ProjectKind kind = ProjectKind.scene}) → Answer -
Writes a new project called
name, ofkind, intotarget, which must be empty or not exist, and wires the build hook. Returns what it did, or why it did not. -
exitCodeFor(
Iterable< ConvertOutcome> outcomes) → int - The exit code for a whole run: 0 when every input converted, otherwise the code of the most serious outcome — a failure (1) before a missing tool (3) before a refusal to overwrite (4).
-
isPackageName(
String name) → bool -
Whether
nameis a valid Dart package name. -
projectAssetChecks(
Directory project) → List< DoctorCheck> -
What
doctorsays about a project's models (decision 54): whether a hook is there to convert what is underassets_src/, and whetherflutter: assets:names every directory the converted files land in. -
projectPlatformChecks(
Directory project) → List< DoctorCheck> -
What
doctorsays about the keys that turn Flutter GPU on for an application (decision 54):FLTEnableFlutterGPUandFLTEnableImpellerinmacos/Runner/Info.plistandios/Runner/Info.plist, andio.flutter.embedding.android.EnableFlutterGPUin Android's manifest. -
projectShaderChecks(
Directory project, {String? dart, String? engineRevision}) → List< DoctorCheck> -
What
doctorsays about a project's shaders (D15, D19): whether its hook is there to write the engine's bundle, whether its pubspec ships what the hook writes, whether the bundle there was compiled on the SDK that builds it now —dartandengineRevision, when known — and whether every installed plugin's material was compiled in. -
projectTemplate(
String name, {ProjectKind kind = ProjectKind.scene}) → Map< String, String> -
The text files of a new project called
name, ofkind, by path. -
runConvertCommand(
List< String> arguments, {IOSink? out, IOSink? err}) → Future<int> -
flutter3d convert'smain. Returns the exit code. -
runDoctor(
List< String> arguments, {IOSink? out}) → int -
flutter3d doctor'smain. Returns 1 when a required check failed. -
runDoctorChecks(
{ProcessProbe probe = _probe, String? locate(ExternalTool tool)?, String? dartVersion, Directory? project}) → List< DoctorCheck> - Every check, in the order the report prints them.
-
runFlutter3d(
List< String> arguments) → Future<int> -
Runs
flutter3d <command> [arguments]and returns its exit code (CliExit). Writes to stdout and stderr as the command does. -
unknownOption(
String option) → String - The sentence every command refuses an unknown option with, before its usage on stderr.
Typedefs
-
ProcessProbe
= String? Function(String executable, List<
String> arguments) - Runs a program and returns its stdout, or null when it cannot start or fails.
Exceptions / Errors
- MissingToolException
- A tool was needed and is not installed.
- ToolFailedException
- A tool ran and refused.