0

I'm developing a small game with a scrollable map and levels. I have a scrollable map in a SingleChildScrollView. I want to put my Positioned Widgets (my levels) on my map.

I used this formula to find map resolution: width_map/height_map. I used this formula to find left distance: MediaQuery_width * resolution_map * custom_width_position. I used this formula to find height distance: MediaQuery_height * resolution_map * custom_height_position.

Positioned(
          left: width * sizeMap * level['width'],
          top: height * sizeMap * level['height'],
          child: ...
)

This formula with different smartphones has different result => the levels are not on the identical place on map (they are near but places not corresponding). Any ideas?

Thanks in advance.

Carlo
  • 813
  • 1
  • 15
  • 34
  • Have you tried using debugPaintSizeEnabled = true; p.s. you need to add import 'package:flutter/rendering.dart'; – Guy Luz Jan 03 '19 at 11:15
  • Thanks guy. I've understand my error. Map are different on same devices because I didn't manage width of my image. – Carlo Jan 08 '19 at 22:53

0 Answers0