MapRF constructor

MapRF({
  1. Key? key,
  2. IConfigRF? IConfig,
  3. CoordinateRF? CurrentLocation,
  4. SettingsRF? Settings,
  5. List<MarkerRF> Markers = const [],
  6. List<PanelRF> Panels = const [],
  7. PolylineRF? polyline,
  8. List<IShapeRF>? Fences,
  9. required MapControllerRF Controller,
  10. dynamic OnMapScroll(
    1. double lat,
    2. double lng,
    3. double zoom
    )?,
  11. dynamic OnTap(
    1. double lat,
    2. double lng
    )?,
  12. dynamic OnCircleTap()?,
  13. dynamic OnPolygonTap()?,
  14. dynamic OnMapCreated()?,
  15. dynamic OnPointerUp(
    1. double lat,
    2. double lng
    )?,
})

Implementation

MapRF({
  super.key,
  this.IConfig,
  this.CurrentLocation,
  this.Settings,
  this.Markers = const [],
  this.Panels = const [],
  this.polyline,
  this.Fences,
  required this.Controller,
  this.OnMapScroll,
  this.OnTap,
  this.OnCircleTap,
  this.OnPolygonTap,
  this.OnMapCreated,
  this.OnPointerUp,
}) {
  LibsRF();

  ConfigurationRF configuration = ConfigurationRF();
  if (IConfig != null) IConfig!.configure(configuration);

  RFN = RapidFireNavigator(
    // configuration,
    Controller: Controller,
    Settings: Settings,
    polyline: polyline,
    Fences: Fences,
    Markers: Markers,
    OnMapScroll: OnMapScroll,
    OnMapTap: OnTap,
    OnCircleTap: OnCircleTap,
    OnPolygonTap: OnPolygonTap,
    OnMapCreated: OnMapCreated,
    onPointerUp: OnPointerUp,
  );
  Controller.Http = HttpClientRF(config: IConfig);

  // if (IConfig == null) {
  //   // var appConfig = DefaultAppConfigRF(
  //   //   currentLocation: CurrentLocation,
  //   // );

  //   // LibsRF.instance.LoadConfiguration(appConfig);

  //   RFN = RapidFireNavigator(
  //     // _configuration,
  //     Controller: Controller,
  //     Settings: Settings,
  //     polyline: polyline,
  //     Fences: Fences,
  //     Markers: Markers,
  //     OnMapScroll: OnMapScroll,
  //     OnMapTap: OnTap,
  //     OnCircleTap: OnCircleTap,
  //     OnPolygonTap: OnPolygonTap,
  //     OnMapCreated: OnMapCreated,
  //     onPointerUp: OnPointerUp,
  //   );
  //   Controller.RFN.Engine.Map!.OnTap = OnTap;
  //   Controller.Http = HttpClientRF(config: IConfig);
  // } else {
  //   LibsRF.instance.LoadConfiguration(IConfig!);
  //   RFN = RapidFireNavigator(
  //     // IConfig!,
  //     Controller: Controller,
  //     Settings: Settings,
  //     polyline: polyline,
  //     Fences: Fences,
  //     Markers: Markers,
  //     OnMapScroll: OnMapScroll,
  //     OnMapTap: OnTap,
  //     OnCircleTap: OnCircleTap,
  //     OnPolygonTap: OnPolygonTap,
  //     OnMapCreated: OnMapCreated,
  //     onPointerUp: OnPointerUp,
  //   );
  //   Controller.Http = HttpClientRF(config: IConfig);
  // }
  Controller.RFN = RFN;
  _layout = LayoutRF(
    Panel: Panels,
    polyline: polyline,
    RFN: RFN,
    Controller: Controller,
  );
}