android/src/main/java/com/example/flutter_segment/FlutterSegmentPlugin.java
@SuppressWarnings("unchecked")
  private Options buildOptions(HashMap<String, Object> optionsData) {
    Options options = new Options();

    if (optionsData != null &&
      optionsData.containsKey("integrations") &&
      (optionsData.get("integrations") instanceof HashMap)) {
      for (Map.Entry<String, Object> integration : ((HashMap<String,Object>)optionsData.get("integrations")).entrySet()) {
        String key = integration.getKey();

        if (integration.getValue() instanceof HashMap) {
          HashMap<String, Object> values = ((HashMap<String, Object>)integration.getValue());
          options.setIntegrationOptions(key, values);
        } else if (integration.getValue() instanceof Boolean) {
          Boolean value = ((Boolean)integration.getValue());
          options.setIntegration(key, value);
        }
      }
    }

    return options;
  }
/**
   * Enables / disables / sets custom integration properties so Segment can properly
   * interact with 3rd parties, such as Amplitude.
   * @see https://segment.com/docs/connections/sources/catalog/libraries/mobile/android/#selecting-destinations
   * @see https://github.com/segmentio/analytics-android/blob/master/analytics/src/main/java/com/segment/analytics/Options.java
   */
Enables / disables / sets custom integration properties so Segment can properly
interact with 3rd parties, such as Amplitude.
Enables / disables / sets custom integration properties so Segment can properly interact with 3rd parties such as Amplitude .
@SuppressWarnings("unchecked")
  private Options buildOptions(HashMap<String, Object> optionsData) {
    Options options = new Options();
    if (optionsData != null &&
      optionsData.containsKey("integrations") &&
      (optionsData.get("integrations") instanceof HashMap)) {
      for (Map.Entry<String, Object> integration : ((HashMap<String,Object>)optionsData.get("integrations")).entrySet()) {
        String key = integration.getKey();
        if (integration.getValue() instanceof HashMap) {
          HashMap<String, Object> values = ((HashMap<String, Object>)integration.getValue());
          options.setIntegrationOptions(key, values);
        } else if (integration.getValue() instanceof Boolean) {
          Boolean value = ((Boolean)integration.getValue());
          options.setIntegration(key, value);
        }
      }
    }
    return options;
  }
@ SuppressWarnings ( "unchecked" ) private Options buildOptions ( HashMap < String , Object > optionsData ) { Options options = new Options ( ) ; if ( optionsData != null && optionsData . containsKey ( "integrations" ) && ( optionsData . get ( "integrations" ) instanceof HashMap ) ) { for ( Map . Entry < String , Object > integration : ( ( HashMap < String , Object > ) optionsData . get ( "integrations" ) ) . entrySet ( ) ) { String key = integration . getKey ( ) ; if ( integration . getValue ( ) instanceof HashMap ) { HashMap < String , Object > values = ( ( HashMap < String , Object > ) integration . getValue ( ) ) ; options . setIntegrationOptions ( key , values ) ; } else if ( integration . getValue ( ) instanceof Boolean ) { Boolean value = ( ( Boolean ) integration . getValue ( ) ) ; options . setIntegration ( key , value ) ; } } } return options ; }
Enables / disables / sets custom integration properties so Segment can properly
 interact with 3rd parties, such as Amplitude.
Enables / disables / sets custom integration properties so Segment can properly interact with 3rd parties such as Amplitude .