of static method

RollState? of(
  1. BuildContext context
)

Finds and returns the nearest ancestor RollState in the widget tree.

This allows descendant Foil widgets to access the Roll's properties such as its gradient and animation settings. Returns null if no ancestor Roll is found.

Implementation

static RollState? of(BuildContext context) =>
    context.findAncestorStateOfType<RollState>();