Skip to content

refactor(constants): extract configuration data to dedicated files#2279

Open
wqnmlgb151 wants to merge 1 commit into
Predidit:mainfrom
wqnmlgb151:refactor/extract-constants
Open

refactor(constants): extract configuration data to dedicated files#2279
wqnmlgb151 wants to merge 1 commit into
Predidit:mainfrom
wqnmlgb151:refactor/extract-constants

Conversation

@wqnmlgb151

Copy link
Copy Markdown
Contributor

Summary

Split the 271-line constants.dart into 9 logical sub-files under lib/constants/. The original file becomes a barrel re-export so all 23 callers continue to work without import changes.

constants.dart (271 lines → 9 lines of exports)
├── style.dart         — StyleString, LayoutBreakpoint, theme constants
├── http_client.dart   — userAgentsList, acceptLanguageList, bangumiHTTPHeader
├── syncplay.dart      — defaultSyncPlayEndPoints
├── decoders.dart      — hardwareDecodersList, androidVideoRenderersList
├── shaders.dart       — mpvAnime4KShaders, mpvAnime4KShadersLite
├── playback.dart      — defaultPlaySpeedList, aspectRatioTypeMap, playerLogLevelMap
├── danmaku_svg.dart   — danmakuOnSvg
├── anime_tags.dart    — defaultAnimeTags
└── shortcuts.dart     — defaultShortcuts, keyAliases, shortcutsChineseName

No behavior changes, no new dependencies.

Split the 271-line constants.dart into 9 logical sub-files under
lib/constants/. The original file becomes a barrel re-export so all
23 callers continue to work without import changes.

No behavior changes, no new dependencies.
@kilo-code-bot

kilo-code-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Pure mechanical refactor: lib/utils/constants.dart is split into 9 dedicated files under lib/constants/, with the original file reduced to a barrel of export statements. All public symbols from the original file are preserved 1:1 across the new files and re-exported, so the 23 existing callers keep working unchanged. Required imports are correctly carried over (style.dart → Flutter material/cupertino; http_client.dartapi_endpoints). The only non-structural changes are cosmetic whitespace reformatting of a few list literals; no values, logic, or behavior changed.

Files Reviewed (10 files)
  • lib/constants/anime_tags.dart
  • lib/constants/danmaku_svg.dart
  • lib/constants/decoders.dart
  • lib/constants/http_client.dart
  • lib/constants/playback.dart
  • lib/constants/shaders.dart
  • lib/constants/shortcuts.dart
  • lib/constants/style.dart
  • lib/constants/syncplay.dart
  • lib/utils/constants.dart

Reviewed by claude-4.8-opus-20260528 · Input: 4.3K · Output: 5.2K · Cached: 246.8K

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