Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YandexMap widget not displaying correctly on repeated screen opens in Flutter #383

Open
nurullohabduvohidov opened this issue Oct 29, 2024 · 0 comments

Comments

@nurullohabduvohidov
Copy link

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.

Screen.Recording.2024-10-28.at.22.33.31.mov

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 createState() => _YandexExampleState();
}

class _YandexExampleState extends State {
@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(),
),
);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant