A registry for packages to add licenses to, so that they can be displayed together in an interface such as the LicensePage.
Packages can register their licenses using addLicense. User interfaces that wish to show all the licenses can obtain them by calling licenses.
The flutter tool will automatically collect the contents of all the LICENSE
files found at the root of each package into a single LICENSE file in the
default asset bundle. Each license in that file is separated from the next
by a line of eighty hyphens (-
), and begins with a list of package names
that the license applies to, one to a line, separated from the next by a
blank line. The services
package registers a license collector that splits
that file and adds each entry to the registry.
The LICENSE files in each package can either consist of a single license, or can be in the format described above. In the latter case, each component license and list of package names is merged independently.
See also:
- showAboutDialog, which shows a Material-style dialog with information about the application, including a button that shows a LicensePage that uses this API to select licenses to show.
- AboutListTile, which is a widget that can be added to a Drawer. When tapped it calls showAboutDialog.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
licenses
→ Stream<
LicenseEntry> -
Returns the licenses that have been registered.
no setter
Static Methods
-
addLicense(
LicenseEntryCollector collector) → void - Adds licenses to the registry.
-
reset(
) → void - Resets the internal state of LicenseRegistry. Intended for use in testing.