of static method

SliverDraggableListState of(
  1. BuildContext context

The state from the closest instance of this class that encloses the given context.

This method is typically used by SliverDraggableList item widgets to start or cancel an item drag operation.

If no SliverDraggableList surrounds the context given, this function will assert in debug mode and throw an exception in release mode.

See also:


static SliverDraggableListState of(BuildContext context) {
  assert(context != null);
  final SliverDraggableListState result =
  assert(() {
    if (result == null) {
      throw FlutterError.fromParts(<DiagnosticsNode>[
            'SliverDraggableList.of() called with a context that does not contain a SliverDraggableList.'),
            'No SliverDraggableList ancestor could be found starting from the context that was passed to SliverDraggableList.of().'),
            'This can happen when the context provided is from the same StatefulWidget that '
            'built the SliverDraggableList. Please see the SliverDraggableList documentation for examples '
            'of how to refer to an SliverDraggableList object:'
            '  https://api.flutter.dev/flutter/widgets/SliverDraggableListState-class.html'),
        context.describeElement('The context used was')
    return true;
  return result;