美文网首页
flutter 鼠标放上去变成手指

flutter 鼠标放上去变成手指

作者: 你妹妹的灵魂 | 来源:发表于2020-02-16 15:49 被阅读0次

    导包:
    https://pub.dev/packages/universal_html

    import 'package:flutter/gestures.dart';
    import 'package:flutter/widgets.dart';
    import 'package:universal_html/html.dart' as html;
    
    class HoverAware extends Listener {
      static final bodyContainer =
          html.window.document.getElementById('body-container');
    
      HoverAware({Widget child})
          : super(
              onPointerHover: (PointerHoverEvent evt) {
                bodyContainer.style.cursor = 'pointer';
              },
              onPointerExit: (PointerExitEvent evt) {
                bodyContainer.style.cursor = 'default';
              },
              child: child,
            );
    }
    

    相关文章

      网友评论

          本文标题:flutter 鼠标放上去变成手指

          本文链接:https://www.haomeiwen.com/subject/fxzpfhtx.html