title: How to get widget's absolute coordinates on a screen in Flutter?
body: <p>How to get widget's absolute coordinates on a screen in Flutter?</p>
  
  <p>Or its offset in a parent</p>
  
  <p>Example:</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MyApp());
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Simple app',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: SimpleScreen(
          title: 'Simple screen',
        ),
      );
    }
  }
  
  class SimpleScreen extends StatefulWidget {
    final String title;
  
    SimpleScreen({Key key, this.title}) : super(key: key);
  
    @override
    _SimpleScreenState createState() =&gt; new _SimpleScreenState();
  }
  
  class _SimpleScreenState extends State&lt;SimpleScreen&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Center(
          child: Container(
            width: 48.0,
            height: 48.0,
            color: Colors.blue,
          ),
        ),
      );
    }
  }
  </code></pre>
  
  <p>Goal is to get Container's offset in parent. If Center's size is 48.0, then Container's offset in Center's parent/root</p>
  
  <p>Condition: you don't know the wrapper layout (it's a library widget), should be flexible, without hardcoded values</p>
  
  <p>Thanks </p>