chore: remove redundant comments and boilerplate across codebase

Strip doc comments, section dividers, HTML comments, and Flutter
template boilerplate that add no informational value. No logic or
behavior changes.
This commit is contained in:
zarzet committed 2026-05-05 21:35:18 +07:00
1 parent b5973c45a2
commit 2143de3aa7
33 files changed
+2 -194

No files matched your search

-1
View File
@@ -1753,7 +1753,6 @@ class _HomeTabState extends ConsumerState<HomeTab>
);
}
/// Build YT Music "Quick picks" style swipeable pages section
Widget _buildYTMusicQuickPicksSection(
ExploreSection section,
ColorScheme colorScheme,
@@ -125,7 +125,6 @@ class _LibraryTracksFolderScreenState
return null;
}
/// Returns true if [url] is a local file path rather than a network URL.
bool _isCoverLocalPath(String url) {
return !url.startsWith('http://') && !url.startsWith('https://');
}
@@ -1301,7 +1300,6 @@ class _CollectionTrackTile extends ConsumerWidget {
return null;
}
/// Builds a cover image widget that handles both network URLs and local file paths.
Widget _buildTrackCover(BuildContext context, String coverUrl, double size) {
final isLocal =
!coverUrl.startsWith('http://') && !coverUrl.startsWith('https://');
-4
View File
@@ -2162,7 +2162,6 @@ class _QueueTabState extends ConsumerState<QueueTab> {
.createPlaylist(playlistName);
}
/// Build a playlist cover thumbnail (custom cover > first track cover > icon fallback).
/// Pass a finite [size] (e.g. 56) for list view, or `null` for grid view
/// where the widget should expand to fill its parent.
Widget _buildPlaylistCover(
@@ -2987,7 +2986,6 @@ class _QueueTabState extends ConsumerState<QueueTab> {
);
}
/// Returns the visible collection entries, hiding Wishlist/Loved when empty.
List<_CollectionEntry> _getVisibleCollectionEntries(
LibraryCollectionsState collectionState,
) {
@@ -4483,7 +4481,6 @@ class _QueueTabState extends ConsumerState<QueueTab> {
}
}
/// Show batch convert bottom sheet for selected tracks
Future<void> _showBatchConvertSheet(
BuildContext context,
List<UnifiedLibraryItem> allItems,
@@ -5629,7 +5626,6 @@ class _QueueTabState extends ConsumerState<QueueTab> {
);
}
/// Build cover image widget for unified library item.
/// When [size] is provided, renders at fixed dimensions (list mode).
/// When [size] is null, fills the parent container (grid mode).
Widget _buildUnifiedCoverImage(
@@ -60,7 +60,6 @@ class AppSettingsPage extends ConsumerWidget {
),
),
// ── Updates ────────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionApp),
),
@@ -97,7 +96,6 @@ class AppSettingsPage extends ConsumerWidget {
),
),
// ── Data ───────────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionData),
),
@@ -122,7 +120,6 @@ class AppSettingsPage extends ConsumerWidget {
),
),
// ── Debug ──────────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionDebug),
),
@@ -741,7 +741,6 @@ class _LanguageSelector extends StatelessWidget {
('zh_TW', '繁體中文', Icons.language),
];
/// Get only languages that meet the translation threshold.
/// Uses filteredLocaleCodes from supported_locales.dart (generated file).
List<(String, String, IconData)> get _languages {
return _allLanguages.where((lang) {
-1
View File
@@ -166,7 +166,6 @@ class _RecentDonorsCard extends StatelessWidget {
final isDark = Theme.of(context).brightness == Brightness.dark;
const donorNames = <String>[];
// Match SettingsGroup color logic
final cardColor = isDark
? Color.alphaBlend(
Colors.white.withValues(alpha: 0.08),
@@ -74,7 +74,6 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
),
),
// ── Service ────────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionService),
),
@@ -91,7 +90,6 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
),
),
// ── Audio Quality ──────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.sectionAudioQuality,
@@ -117,7 +115,6 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
),
),
// ── Network & Performance ──────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.sectionPerformance,
@@ -176,7 +173,6 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
),
),
// ── Fallback & Search ──────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.sectionSearchSource,
@@ -211,7 +207,6 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
),
),
// ── Misc ───────────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionDownload),
),
@@ -611,8 +606,6 @@ class _DownloadSettingsPageState extends ConsumerState<DownloadSettingsPage> {
}
}
// ── Private widgets (reused from original) ─────────────────────────────────
class _BetaBadge extends StatelessWidget {
const _BetaBadge();
@@ -896,7 +889,6 @@ class _ConcurrentChip extends StatelessWidget {
}
}
// Imported from options_settings_page — search source selectors
class _MetadataSourceSelector extends ConsumerWidget {
const _MetadataSourceSelector();
@@ -347,7 +347,6 @@ class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
return _getFriendlyErrorMessage(firstError);
}
/// Parse error message to be more user-friendly
String _getFriendlyErrorMessage(String? error) {
if (error == null) return context.l10n.snackbarFailedToInstall;
@@ -135,7 +135,6 @@ class _FilesSettingsPageState extends ConsumerState<FilesSettingsPage> {
),
),
// ── Download Location ──────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.setupDownloadLocationTitle,
@@ -159,7 +158,6 @@ class _FilesSettingsPageState extends ConsumerState<FilesSettingsPage> {
),
),
// ── Filename Formats ───────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.sectionFileSettings,
@@ -199,7 +197,6 @@ class _FilesSettingsPageState extends ConsumerState<FilesSettingsPage> {
),
),
// ── Folder Structure ───────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.downloadFolderOrganization,
@@ -318,7 +315,6 @@ class _FilesSettingsPageState extends ConsumerState<FilesSettingsPage> {
),
),
// ── Storage Access (Android 13+) ───────────────────────────
if (Platform.isAndroid && _androidSdkVersion >= 33) ...[
SliverToBoxAdapter(
child: SettingsSectionHeader(
@@ -379,8 +375,6 @@ class _FilesSettingsPageState extends ConsumerState<FilesSettingsPage> {
);
}
// ── Helpers ──────────────────────────────────────────────────────────────
String _getAlbumFolderStructureLabel(String structure) {
switch (structure) {
case 'album_only':
-1
View File
@@ -556,7 +556,6 @@ class _LogEntryTile extends StatelessWidget {
}
}
/// Summary card showing detected issues in logs
class _LogSummaryCard extends StatelessWidget {
final List<LogEntry> logs;
@@ -358,7 +358,6 @@ class _DisabledProviderItem extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: Row(
children: [
// Empty space aligned with numbered badge
const SizedBox(width: 28),
const SizedBox(width: 16),
Icon(info.icon, color: colorScheme.outline),
@@ -60,7 +60,6 @@ class LyricsSettingsPage extends ConsumerWidget {
),
),
// ── Lyrics Embedding ───────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionLyrics),
),
@@ -112,7 +111,6 @@ class LyricsSettingsPage extends ConsumerWidget {
),
),
// ── Provider Options ───────────────────────────────────────
if (settings.embedMetadata && settings.embedLyrics) ...[
SliverToBoxAdapter(
child: SettingsSectionHeader(
@@ -61,7 +61,6 @@ class MetadataSettingsPage extends ConsumerWidget {
),
),
// ── Embedding ──────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(title: context.l10n.sectionDownload),
),
@@ -116,7 +115,6 @@ class MetadataSettingsPage extends ConsumerWidget {
),
),
// ── Providers ─────────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.sectionMetadataProviders,
@@ -141,7 +139,6 @@ class MetadataSettingsPage extends ConsumerWidget {
),
),
// ── Deduplication ──────────────────────────────────────────
SliverToBoxAdapter(
child: SettingsSectionHeader(
title: context.l10n.sectionDuplicates,
-3
View File
@@ -61,7 +61,6 @@ class SettingsTab extends ConsumerWidget {
),
),
// ── Group 1: Appearance & Content ──────────────────────────────
SliverToBoxAdapter(
child: Builder(
builder: (context) {
@@ -96,7 +95,6 @@ class SettingsTab extends ConsumerWidget {
),
),
// ── Group 2: Download ──────────────────────────────────────────
SliverToBoxAdapter(
child: Builder(
builder: (context) {
@@ -139,7 +137,6 @@ class SettingsTab extends ConsumerWidget {
),
),
// ── Group 3: App ───────────────────────────────────────────────
SliverToBoxAdapter(
child: Builder(
builder: (context) {
-4
View File
@@ -717,7 +717,6 @@ class _SetupScreenState extends ConsumerState<SetupScreen> {
);
}
// --- Language data (native names, always readable regardless of current locale) ---
static const _allLanguages = [
('system', 'System Default', Icons.phone_android),
('en', 'English', Icons.language),
@@ -757,7 +756,6 @@ class _SetupScreenState extends ConsumerState<SetupScreen> {
return LayoutBuilder(
builder: (context, constraints) {
final shortestSide = MediaQuery.sizeOf(context).shortestSide;
// Match _StepLayout sizing exactly
final iconPadding = (shortestSide * 0.06).clamp(16.0, 24.0);
final iconSize = (shortestSide * 0.12).clamp(32.0, 48.0);
final titleGap = (shortestSide * 0.06).clamp(16.0, 32.0);
@@ -766,7 +764,6 @@ class _SetupScreenState extends ConsumerState<SetupScreen> {
return Column(
children: [
// Header: identical to _StepLayout (same padding, spacing, styles)
Padding(
padding: const EdgeInsets.fromLTRB(24, 24, 24, 0),
child: Column(
@@ -805,7 +802,6 @@ class _SetupScreenState extends ConsumerState<SetupScreen> {
],
),
),
// Language list (scrollable action area)
Expanded(
child: ListView.builder(
padding: const EdgeInsets.fromLTRB(24, 0, 24, 80),