psk907 / fluttermoji

A light-weight and highly customizable SVG graphic set for Flutter which generates avatars and provides a Customizer Widget, personalized CircleAvatar and other utility functions.
https://pub.dev/packages/fluttermoji
MIT License
72 stars 50 forks source link

How to get the raw string given to SvgPicture #32

Closed dri94 closed 1 year ago

dri94 commented 1 year ago

I want to obtain the finalized SVG to save to my server. The SVG that can be used within the Fluttermoji library. I believe this is the same raw string that must be given to SvgPicture.string() for it to display. How do I obtain this?

psk907 commented 1 year ago

Please look into the methods exposed by the FluttermojiFunctions class. API Documentation for the above

dri94 commented 1 year ago

For anyone wondering. I achieved it like this

            FluttermojiController? controller = avatar.buildGetX().init;
            Map<String?, int>? options =
                await controller?.getFluttermojiOptions();
            String? decoded = FluttermojiFunctions()
                .decodeFluttermojifromString(jsonEncode(options));