Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enum support #8

Closed
stargazing-dino opened this issue Jun 29, 2020 · 3 comments
Closed

Enum support #8

stargazing-dino opened this issue Jun 29, 2020 · 3 comments

Comments

@stargazing-dino
Copy link

Hi!

Is there currently no way to use enums?

enum Role { admin, editor, user }

class Profile extends Document<Profile> {
  // ...
  @Field()
  Role role;
}
[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: type 'String' is not a subtype of type 'Role' in type cast
#0      _AppState.build.<anonymous closure> 
package:approach_builder/main.dart:107
#1      _streamStartListening.<anonymous closure>.<anonymous closure> 
package:provider/src/async_provider.dart:30
#2      _rootRunUnary  (dart:async/zone.dart:1198:47)
#3      _CustomZone.runUnary  (dart:async/zone.dart:1100:19)
#4      _CustomZone.runUnaryGuarded  (dart:async/zone.dart:1005:7)
#5      _BufferingStreamSubscription._sendError.sendError  (dart:async/stream_impl.dart:378:15)
#6      _BufferingStreamSubscription._sendError  (dart:async/stream_impl.dart:394:16)
#7      _BufferingStreamSubscription._addError  (dart:async/stream_impl.dart:294:7)
#8      _SyncBroadcastStreamController._sendError.<anonymous closure>  (dart:async/broadcast_stream_controller.dart:400:20)
#9      _BroadcastStreamController._forEachListener  (dart:async/broadcast_stream_controller.dart:330:15)
@hukusuke1007
Copy link
Owner

Sorry, response late. Firestore is not support enum. So flamingo is not support.

@stargazing-dino
Copy link
Author

That's fine. I'll close for now

@vladaman
Copy link

Would it be possible to translate enum to String and back? It's just a serialization issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants