isShortForm property

bool get isShortForm

True, if short-form for writing hosted-dependencies was used.

Example of a hosted-dependency written in short-form:

dependencies:
  foo:
    hosted: https://some-pub-server.com
    version: ^1.2.3

The long-form for writing the dependency given above is:

dependencies:
  foo:
    hosted:
      url: https://some-pub-server.com
      name: foo
    version: ^1.2.3

The short-form was added in Dart 2.15.0 because:

  • The name property just specifies the package name, which can be inferred from the context. So it is unnecessary to write it.
  • The nested object and url key becomes unnecessary when the name property is removed.

Implementation

bool get isShortForm;