title: Stack position not accurate
body: <p>I want  to add red blinking dot on the container when it is tapped, but the dot position is not accurate.
  How to fix?</p>
  
  <p><strong>MyApp</strong></p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  import 'blinking_dot.dart';
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(title: 'Flutter Demo Home Page'),
      );
    }
  }
  
  class MyHomePage extends StatefulWidget {
    MyHomePage({Key key, this.title}) : super(key: key);
  
    final String title;
  
    @override
    _MyHomePageState createState() =&gt; _MyHomePageState();
  }
  
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    int _counter = 0;
    double posx;
    double posy;
  
    void onTapDown(BuildContext context, TapDownDetails details) {
      print('${details.globalPosition}');
      final RenderBox box = context.findRenderObject();
      final Offset localOffset = box.globalToLocal(details.globalPosition);
      setState(() {
        posx = localOffset.dx;
        posy = localOffset.dy;
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
          appBar: AppBar(
            title: Text(widget.title),
          ),
          body: GestureDetector(
              onTapDown: (TapDownDetails details) =&gt; onTapDown(context, details),
              child: Stack(
                children: &lt;Widget&gt;[
                  Container(
                    height: double.infinity,width: double.infinity,
                      padding: EdgeInsets.all(10),
                      child: Image.asset("assets/img.jpg")),
                  Positioned(
                    child: BlinkingDot(),
                    left: posx,
                    top: posy,
                  )
                ],
              )));
    }
  }
  </code></pre>
  
  <p><strong>blinking_dot.dart</strong></p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  class BlinkingDot extends StatefulWidget {
    @override
    _BlinkingDotState createState() =&gt; _BlinkingDotState();
  }
  
  class _BlinkingDotState extends State&lt;BlinkingDot&gt;
      with SingleTickerProviderStateMixin {
    AnimationController _animationController;
  
    @override
    void initState() {
      _animationController =
          new AnimationController(vsync: this, duration: Duration(seconds: 1));
      _animationController.repeat();
      super.initState();
    }
  
    @override
    Widget build(BuildContext context) {
      return FadeTransition(
          opacity: _animationController,
          child: Container(
              height: 15,
              width: 15,
              child: FloatingActionButton(
                backgroundColor: Colors.redAccent,
              )));
    }
  
    @override
    void dispose() {
      _animationController.dispose();
      super.dispose();
    }
  }
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p><a href="https://i.stack.imgur.com/EiOZs.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EiOZs.gif" alt="enter image description here"></a></p>