applyParametersOnDefaultJson static method

Future<Map<String, dynamic>> applyParametersOnDefaultJson(
  1. String defaultJsonName,
  2. Map<String, dynamic> updatedParameters
)

This method takes the default json file and updates the parameters with the given parameters from customer configuration The approach is needed to always have the full json come to the native platform

Implementation

static Future<Map<String, dynamic>> applyParametersOnDefaultJson(
    String defaultJsonName, Map<String, dynamic> updatedParameters) async {
  var defaultConfiguration = jsonDecode(await rootBundle.loadString(
          'packages/' +
              scanbot_library_name +
              '/assets/jsonExamples/$defaultJsonName.json'))
      as Map<String, dynamic>;

  if (Platform.isAndroid) {
    checkColors(defaultConfiguration);
  }

  updateParameter(updatedParameters, defaultConfiguration);
  return defaultConfiguration;
}