Skip to main content

Flutter API References

To get started, call the GlamAR.init method. This adds the GlamAR SDK into the target container and configures it with the provided Access key and Skin Analysis > App Id configuration.

final overrides = GlamAROverrides(
category: 'skinanalysis',
configuration: {
'skinAnalysis': {
'appId': 'your_skin-app-id',
},
},
meta: {
'preloadMLModels': ['face', 'light'],
},
);

await GlamAr.init(
accessKey: 'YOUR_ACCESS_KEY', // Replace with your actual key
overrides: overrides
);

Initialization Config​

ParametersTypeDescriptionOptions
accessKeystringPass your unique Access Key
categorystringPass skinanalysisCan only pass skinanalysis
overridesGlamAROverridesObject containing Skin Analyis appId details
overrides.meta.preloadMLModelsList<String>Downloads the listed ML models during SDK initialization. Skin Analysis supports face and light.['face', 'light']

Post-Initialization Methods​

open​

GlamAr.skinAnalysis('start');

Opens the Skin Analysis flow.
Return Value: None

ParametersDescriptionTypeOptions
optionsPass start (Required)stringstart

addEventListener​

GlamAr.addEventListener(eventName, handlerFunction);

Adds the listener to the given event name.
Return Value: None

ParametersTypeDescription
eventNamestring

A Name of specific event or "*" To listen to the all the events.

handlerFunctionfunction Your handler function that will listen to callback.

removeEventListener​

GlamAr.removeEventListener(eventName, handlerFunction);

Removes the given listener for the event name.
Return Value: None

ParametersTypeDescription
eventNamestring

A Name of specific event or "*" To remove all the events.

handlerFunctionfunction Your handler function that will listen to callback.

reset​

GlamAr.reset();

Removes all the current effects from the canvas.
Return Value: None

ParametersDescription

None

No parameters required.

close​

GlamAr.close();

Closes canvas and returns to the main widget page.
Return Value: None

ParametersDescription

None

No parameters required.

snapshot​

GlamAr.snapshot();

After a successfully scan, client can be get a PDF of his scan from share event
Return Value: none

ParametersDescription

None

No parameters required.

Events​

Refer to Setup Page to understand how we can register to events Check Events Page for event details.