layer_map.dart 611 B

1234567891011121314151617181920212223242526272829
  1. import 'layer_controller.dart';
  2. class LayerMap extends GetView<LayerController> {
  3. const LayerMap({
  4. super.key,
  5. });
  6. @override
  7. Widget build(BuildContext context) {
  8. return Obx((){
  9. final mapPic = controller.gameMap?.pic;
  10. final transform = controller.mapTransformMatrix.value;
  11. if (mapPic != null) {
  12. return Transform(
  13. transform: transform,
  14. alignment: Alignment.topLeft,
  15. child: Image.memory(
  16. mapPic,
  17. fit: BoxFit.contain,
  18. ));
  19. } else {
  20. return const SizedBox();
  21. }
  22. });
  23. }
  24. }