Package io.flutter.util

## Class ViewUtils

- java.lang.Object
- - io.flutter.util.ViewUtils

-     public final class ViewUtils
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ViewUtils()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static int` | `generateViewId​(int fallbackId)` | Generates a view id.
    `static Activity` | `getActivity​(Context context)` | Retrieves the `Activity` from a given `Context`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ViewUtils

          public ViewUtils()

  - ### Method Detail

    - #### getActivity

          public static Activity getActivity​(Context context)

      Retrieves the `Activity` from a given `Context`.

      This method will recursively traverse up the context chain if it is a `ContextWrapper` until it finds the first instance of the base context that is an `Activity`.

    - #### generateViewId

          public static int generateViewId​(int fallbackId)

      Generates a view id.

      In API level 17 and above, this ID is unique. Below 17, the fallback id is used instead.

      Parameters:
        `fallbackId` - the fallback id.
      Returns:
        the view id.