getValue<T> method

T? getValue<T>(
  1. String name
)

Get a property value by its name.

T must be the type of the value, which depends on the property type. The following Tiled properties map to the follow Dart types:

  • int property -> int
  • float property -> double
  • boolean property -> bool
  • string property -> string
  • color property -> ui.Color
  • file property -> string (path)
  • object property -> int (ID)

Implementation

T? getValue<T>(String name) {
  return getProperty(name)?.value as T?;
}