BuildContext constructor

BuildContext({
  1. required Widget widget,
  2. BuildContext? parent,
  3. Map<Type, Widget>? inheritedWidgets,
  4. Map<Type, dynamic>? states,
  5. String? path,
  6. SlotTracker? slotTracker,
  7. State<StatefulWidget>? currentBuildingState,
})

Implementation

BuildContext({
  required this.widget,
  this.parent,
  Map<Type, Widget>? inheritedWidgets,
  Map<Type, dynamic>? states,
  String? path,
  SlotTracker? slotTracker,
  this.currentBuildingState,
})  : inheritedWidgets = inheritedWidgets ?? parent?.inheritedWidgets ?? {},
      _states = states ?? parent?._states ?? {},
      path = path ?? parent?.path ?? 'root',
      slotTracker = slotTracker ?? parent?.slotTracker ?? SlotTracker();