yandex_mapkit icon indicating copy to clipboard operation
yandex_mapkit copied to clipboard

YandexMap widget not displaying correctly on repeated screen opens in Flutter

Open nurullohabduvohidov opened this issue 1 year ago • 0 comments

I'm encountering an issue with the YandexMap widget in Flutter. When navigating back and forth between screens, the map widget sometimes fails to load correctly or appears blank. This problem persists across Android.

This is my code.

https://github.com/user-attachments/assets/b1c2a421-1436-40ef-b037-514f79d0d58d

import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:sott/core/app_text_style.dart'; import 'package:yandex_mapkit/yandex_mapkit.dart';

class YandexExample extends StatefulWidget { const YandexExample({super.key});

@override State<YandexExample> createState() => _YandexExampleState(); }

class _YandexExampleState extends State<YandexExample> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text("Yandex Example"), ), body: ListView.builder( itemCount: 50, itemBuilder: (context, index) { return InkWell( onTap: () { Navigator.of(context).push( MaterialPageRoute(builder: (context) => const YandexMapPage(),) ); }, child: Container( height: 48.h, color: Colors.red, alignment: Alignment.center, margin: EdgeInsets.only(bottom: 20.h), child: Text("Go to map $index", style: AppTextStyle.medium16,), ), ); }, ), ); } }

class YandexMapPage extends StatelessWidget { const YandexMapPage({super.key});

@override Widget build(BuildContext context) { return Scaffold( body: SizedBox( height: 192.h, child: const YandexMap(), ), ); } }

nurullohabduvohidov avatar Oct 29 '24 04:10 nurullohabduvohidov