MouseRegion is disabled when mouse pressed

Viewed 246

When I press the mouse(left click) on move the pointer around the container (red section) onEnter\onExit are not been called. However, when the mouse is not pressed and I'm moving the mouse around the container onEnter/onExit are being called. How can I detect mouse movement in the widget when the mouse is being pressed?

import 'package:flutter/material.dart';    
void main() {
  runApp(
    MaterialApp(
      // theme: design.getThemeData(),
      home: TestWidget(),
      debugShowCheckedModeBanner: false,
    ),
  );
}

class TestWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.all(50.0),
      child: MouseRegion(
        onEnter: (ds) {
          print('Enterred:');
        },
        onExit: (ds) {
          print('Exit: ');
        },
        child: Container(
          color: Colors.red,
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
        ),
      ),
    );
  }
}
0 Answers
Related