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',
},
},
);
await GlamAr.init(
accessKey: 'YOUR_ACCESS_KEY', // Replace with your actual key
overrides: overrides
);
Initialization Config
| Parameters | Type | Description | Options |
|---|---|---|---|
| accessKey | string | Pass your unique Access Key | |
| category | string | Pass skinanalysis | Can only pass skinanalysis |
| overrides | GlamAROverrides | Object containing Skin Analyis appId details |
Post-Initialization Methods
open
GlamAr.skinAnalysis();
Opens the Skin Analysis flow.
Return Value: None
| Parameters | Description | Type | Options |
|---|---|---|---|
| options | Pass start (Required) | string | start |
addEventListener
GlamAr.addEventListener(eventName, handlerFunction);
Adds the listener to the given event name.
Return Value:None
| Parameters | Type | Description |
|---|---|---|
| eventName | string | A Name of specific event or "*" To listen to the all the events. |
| handlerFunction | function | Your handler function that will listen to callback. |
removeEventListener
GlamAr.removeEventListener(eventName, handlerFunction);
Removes the given listener for the event name.
Return Value: None
| Parameters | Type | Description |
|---|---|---|
| eventName | string | A Name of specific event or "*" To remove all the events. |
| handlerFunction | function | Your handler function that will listen to callback. |
reset
GlamAr.reset();
Removes all the current effects from the canvas.
Return Value: None
| Parameters | Description |
|---|---|
None | No parameters required. |
close
GlamAr.close();
Closes canvas and returns to the main widget page.
Return Value: None
| Parameters | Description |
|---|---|
None | No parameters required. |
snapshot
GlamAr.snapshot();
After a successfully scan, client can be get a PDF of his scan from
shareevent
Return Value: none
| Parameters | Description |
|---|---|
None | No parameters required. |
Events
Refer to Setup Page to understand how we can register to events Check Events Page for event details.