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

weather_state.dart redundant properties for FailState and NotFoundState #1

Open
philite opened this issue Jul 15, 2022 · 2 comments
Open

Comments

@philite
Copy link
Collaborator

philite commented Jul 15, 2022

@JsonSerializable()
class FailState extends WeatherState {
  const FailState({required String cityName, required Units units})
      : super(cityName: cityName, units: units);

  factory FailState.fromJson(Map<String, dynamic> json) =>
      _$FailStateFromJson(json);

  Map<String, dynamic> toJson() => _$FailStateToJson(this);
}

@JsonSerializable()
class NotFoundState extends WeatherState {
  const NotFoundState({required String cityName, required Units units})
      : super(cityName: cityName, units: units);

  factory NotFoundState.fromJson(Map<String, dynamic> json) =>
      _$NotFoundStateFromJson(json);

  Map<String, dynamic> toJson() => _$NotFoundStateToJson(this);
}

I don't see cityName and units use anywhere for FailState and NotFoundState

@philite
Copy link
Collaborator Author

philite commented Jul 15, 2022

@philite
Copy link
Collaborator Author

philite commented Jul 16, 2022

a better implementation for Kotlin's sealed class in Dart dart-lang/language#349 (comment)

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

1 participant