Skip to content

Hover Listener ignores any previous transforms #31986

@goderbauer

Description

@goderbauer

The following code should paint a rotated blue scare with a "p" on it, but for some reason the rotation is not applied. As soon as the "onPointerHover" is commented out, the box is drawn as expected.

import 'package:flutter/material.dart';
import 'package:flutter/gestures.dart';

void main() => runApp(MyApp1());

class MyApp1 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Center(
        child: Transform.rotate(
          angle: 1.57,
          child: Listener(
            onPointerHover: (PointerHoverEvent event) { }, // <-- comment this out to make it work
            child: Container(
              color: Colors.blue,
              height: 100,
              width: 100,
              child: Text('p'),
            ),
          ),
        ),
      ),
    );
  }
}

Suspicion: The extra AnnotatedRegionLayer that the onPointerHover inserts may be screwing with the transform...

Metadata

Metadata

Assignees

Labels

a: desktopRunning on desktopframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions