applyInternal method

  1. @override
bool applyInternal(
  1. String applyType,
  2. AFWidgetSelector selector,
  3. Element element,
  4. dynamic data,
)
override

Note that data is ignored, this toggles the chip state.

Implementation

@override
bool applyInternal(String applyType, AFWidgetSelector selector, Element element, dynamic data) {
  final widget = element.widget;
  if(widget is Switch) {
    bool isSel = data;
    if(widget.value != isSel) {
      widget.onChanged?.call(isSel);
    }
    return true;
  }
  return false;
}