Affix constructor

Affix(
  1. Element element, {
  2. int? offsetTop()?,
  3. int? offsetBottom()?,
})

Implementation

Affix(Element element, {int? offsetTop()?, int? offsetBottom()?}) :
this.offsetTop = offsetTop ?? (() => _defaultOffset),
this.offsetBottom = offsetBottom ?? (() => _defaultOffset),
super(element, _name) {
  $(window)
  ..on('scroll.affix.data-api', (QueryEvent e) => checkPosition())
  ..on('click.affix.data-api', (QueryEvent e) {
    Timer(const Duration(milliseconds: 1), checkPosition);
  });
  checkPosition();
}