I need to store a Dart object from my Flutter application in Firestore

This object includes an enum property.

What is the best solution to serialize / deserialize this enum property ?

* As a String
* As an Int

I do not find any easy solution to do this.