Skip to content

@int

Declares a named integer value resource.

Declaration

<resources xmlns="https://xwidget.dev/values">
    <int name="maxRetries">3</int>
    <int name="maxLines">2</int>
    <int name="animationDuration">300</int>
</resources>
Attribute Description Required
name Unique key for the value Yes

The value must be a valid integer string parseable by int.parse().

Fragment Usage

Reference with the @int/ directive:

<Text data="${description}" maxLines="@int/maxLines"/>

Dart Usage

final maxRetries = Resources.instance.getInt("maxRetries");

Throws an exception if the resource name is not found.

See Also