maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
226 stars 125 forks source link

Add opportunity to use map in widget tests #281

Closed ManoyloK closed 1 year ago

ManoyloK commented 1 year ago

Hey! I needed to use the map in widget tests. But as it uses platform views those are not working properly during widget tests. So I made some classes visible and added a method to provide fake MethodChannelMaplibreGl to MapLibreGlPlatform.

Usage

class FakeMethodChannelMaplibreGl implements MethodChannelMaplibreGl {
...
}

 MapLibreGlPlatform.instance = FakeMethodChannelMaplibreGl();
JulianBissekkou commented 1 year ago

Thanks! @ManoyloK