Skip to content

Enable prefer_const_constructors lint and apply across all packages#351

Open
quetool wants to merge 1 commit intoreown-com:tron_servicefrom
quetool:tron_service
Open

Enable prefer_const_constructors lint and apply across all packages#351
quetool wants to merge 1 commit intoreown-com:tron_servicefrom
quetool:tron_service

Conversation

@quetool
Copy link
Contributor

@quetool quetool commented Feb 16, 2026

Description

  • Performance improvements:
    • Add prefer_const_constructors and avoid_field_initializers_in_const_classes lint rules to analysis_options.yaml in all packages
    • Apply const keyword to constructor invocations throughout the codebase which
  • Convert final field initializers to getters in const classes (basic_event.dart _ErrorOptions, _ModalTrackOptions)
  • Standardize analysis_options.yaml in pos_client to use package:lints/recommended.yaml

Rationale: Using const keyword in static objects leads to a much better performance improvement leveraging Dart's canonicalization and reusability

Resolves # (issue)

How Has This Been Tested?

Due Dilligence

  • Breaking change
  • Requires a documentation update

- Add prefer_const_constructors and avoid_field_initializers_in_const_classes
  lint rules to analysis_options.yaml in all packages
- Apply const keyword to constructor invocations throughout the codebase
- Convert final field initializers to getters in const classes
  (basic_event.dart _ErrorOptions, _ModalTrackOptions)
- Standardize analysis_options.yaml in pos_client to use
  package:lints/recommended.yaml
- Sort dependencies in pubspec.yaml files
- Switch to local path dependencies for development

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant