Affix constructor
Affix(
- Element element, {
- int? offsetTop()?,
- 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();
}