Skip to content

Conversation

@arjav1528
Copy link

PR Description

This PR refactors the EnvironmentModel and EnvironmentVariableModel classes to use abstract class declarations instead of regular class declarations. This change improves extensibility and follows Dart best practices for freezed models. Additionally, this PR removes an orphaned generated file (dashbot_window_notifier.g.dart) that was no longer needed.

Changes Made

  1. Refactored EnvironmentModel classes (packages/apidash_core/lib/models/environment_model.dart):

    • Changed EnvironmentModel from class to abstract class
    • Changed EnvironmentVariableModel from class to abstract class
    • Cleaned up @JsonSerializable annotation formatting for consistency
  2. Removed orphaned generated code (lib/dashbot/providers/dashbot_window_notifier.g.dart):

    • Deleted the unused generated file that was not referenced anywhere in the codebase
    • The source file dashbot_window_notifier.dart does not use code generation annotations, making this file unnecessary

Benefits

  • Improved extensibility: Using abstract class allows for better inheritance patterns and extensibility
  • Code cleanup: Removes unused generated code that could cause confusion
  • Consistency: Aligns with Dart/Flutter best practices for freezed models

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: This is a refactoring change that maintains existing functionality. The models already have comprehensive test coverage, and the removal of the orphaned generated file does not affect any functionality.

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

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

Successfully merging this pull request may close these issues.

Ability to inherit auth credentials

1 participant