Open davidcantonnadales opened 3 years ago
@gaznerviozzo can you please elaborate on this?
Oh yes sorry for the short description.
I added a background color selector:
But when i save the avatar, background color is not exported with the rest of the avatar:
I think the backgroundColor property of the CircleAvatar is not valid
Padding(
padding: const EdgeInsets.symmetric(vertical: 30),
child: FluttermojiCircleAvatar(
backgroundColor: currentColor,
radius: 100,
),
),
When you save, the setFluttermoji()
function is called on the FluttermojiController, here we will encode the selectedIndexes
Map and store it as a string using shared preferences under the key: fluttermojiSelectedOptions .
If the background color attribute you've added is not being saved, it's most likely because you aren't actually saving it in the first place , in a map that looks like this -
{
'backgroundColor': <value>,
'topType': 24,
'accessoriesType': 0,
'hairColor': 1,
'facialHairType': 0,
'facialHairColor': 1,
'clotheType': 4,
'eyeType': 6,
'eyebrowType': 10,
'mouthType': 8,
'skinColor': 3,
'clotheColor': 8,
'style': 0,
'graphicType': 0
}
You should also update the fluttermojiProperties
and defaultFluttermojiOptions
in order to use background color as a part of the SVG.
These steps are needed as the above variables are define the whole structure of the fluttermoji.
Can export the background color with the rest of SVG items?
Thanks