WidgetElement constructor

WidgetElement(
  1. BindingContext? context, {
  2. Map<String, dynamic>? defaultStyle,
  3. bool isReplacedElement = false,
  4. bool isDefaultRepaintBoundary = true,
})

Implementation

WidgetElement(BindingContext? context, {
  Map<String, dynamic>? defaultStyle,
  bool isReplacedElement = false,
  // WidgetElement Adds repaintBoundary by default to prevent the internal paint process from affecting the outside.
  // If a lot of WidgetElement is used in a scene, you need to modify the default repaintBoundary according to the scene analysis.
  // Otherwise it will cause performance problems by creating most layers.
  bool isDefaultRepaintBoundary = true,
}) : super(
  context,
  defaultStyle: defaultStyle,
  isReplacedElement: isReplacedElement,
  isDefaultRepaintBoundary: isDefaultRepaintBoundary,
) {
  WidgetsFlutterBinding.ensureInitialized();
  _state = _KrakenAdapterWidgetState(this, attributes, childNodes);
  _widget = _KrakenAdapterWidget(_state!);
}