title: In Flutter, how can I align an arbitrary point in one widget with an arbitrary point in another?
body: <p>I'm developing an app in Flutter that takes a snapshot of a Google Map (so I have the image available to display offline) and displays a location icon on top of it.</p>
  <p>Along with the map snapshot, I capture the latitude and longitude of the four corners of the map. So with a current GPS reading, I can figure the relative location in the map to display the location icon.</p>
  <p>The problem is that I want the pointy part of the icon to be positioned at the GPS location. That means the mid-point of the bottom edge of the icon.</p>
  <p>Currently, I'm using a Stack with the map image as the first layer and the icon stacked on top, positioned using the FractionalOffset widget:</p>
  <pre><code>  // Calculate the relative location of the icon over the map
    // by finding the ratio of our current location in the
    // map
    double locationMarkerLeft = (_currentLocation.longitude - bounds.southwest.longitude) /
          (bounds.northeast.longitude - bounds.southwest.longitude);
    double locationMarkerTop = (_currentLocation.latitude - bounds.northeast.latitude) /
          (bounds.southwest.latitude - bounds.northeast.latitude);
  
    return Stack(children: &lt;Widget&gt;[
      Image.memory(_mapImage),
      Align(child: Icon(Icons.location_on),
          alignment: FractionalOffset(locationMarkerLeft, locationMarkerTop)
      )
    ]);
  </code></pre>
  <p>My understanding is that FractionalOffset applies the same relative offset to the parent and the child. So while this positions the icon approximately, it is not exact.</p>
  <p>So, how can I position the mid-point of the bottom edge of the icon at a specific point atop the image of the map?</p>
  <p>Thank you.</p>