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

How can I convert super enums to this package #17

Open
ride4sun opened this issue Dec 29, 2022 · 1 comment
Open

How can I convert super enums to this package #17

ride4sun opened this issue Dec 29, 2022 · 1 comment

Comments

@ride4sun
Copy link

ride4sun commented Dec 29, 2022

I have this super_enum and the advise was to convert this to this package.
I am wondering how all this will convert?
Any help is appreciated...

import 'package:super_enum/super_enum.dart';

part 'emission_test_bloc_state.super.dart';

@superEnum
enum _EmissionTestBlocState {
  @object
  Disconnected,
  @object
  NoVinFailure,

  @object
  NoInternet,

  @Data(fields: [
    DataField<String>('vin'),
  ])
  Waiting,
  @Data(fields: [
    DataField<String>('request'),
  ])
  RequestMILStatus,
  @Data(fields: [
    DataField<String>('request'),
  ])
  RequestDTC,
  @object
  RequestRedinessMonitor,
  @Data(fields: [
    DataField<dynamic>('dtcs'),
    DataField<dynamic>('status'),
  ])
  TestFaliure,
  @Data(fields: [
    DataField<String>('message'),
    DataField<dynamic>('status'),
  ])
  TestPassed,
  @Data(fields: [
    DataField<dynamic>('status'),
  ])
  NotCompleted,
  @Data(fields: [
    DataField<String>('request'),
  ])
  RequestClearDTC,
  @object
  ErrorCodesCleared,
}
@FatulM
Copy link
Contributor

FatulM commented Mar 26, 2024

Hi,
The last version supporting super_enum was 1.4.0.
Please check it's docs and use it if it is possible ...
Also It would generate dart_sealed code in comments,
which you could use to migrate your code completely from super_enum to dart_sealed.

see:
doc

for an example see:
weather.dart
weather.super.dart

Afterwards, from version 1.5, I have droped support for super_enum. But I think making a workable code is very easy, from migrating code in version 1.4 to the last version.

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

2 participants