of static method

RoadsdataWrapperState of(
  1. BuildContext context
)

Implementation

static RoadsdataWrapperState of(BuildContext context) {
  RoadsdataService? rdService =
      context.dependOnInheritedWidgetOfExactType<RoadsdataService>();
  if (rdService == null) {
    debugPrint(
        'Tried to access RoadsdataWrapperState from the outside of its context scope.');
    throw Exception(
        'Roadsdata service not found.\nMake sure that you have initialized correctly the Roadsdata sdk.');
  }
  return rdService.data;
}