Skip to content

Commit

Permalink
fix: lyrics page text contrast
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Aug 26, 2023
1 parent 8d46029 commit 179d536
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
25 changes: 16 additions & 9 deletions lib/pages/lyrics/synced_lyrics.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:palette_generator/palette_generator.dart';
import 'package:spotify/spotify.dart';
import 'package:spotify/spotify.dart' hide Offset;
import 'package:spotube/collections/spotube_icons.dart';
import 'package:spotube/components/lyrics/zoom_controls.dart';
import 'package:spotube/components/shared/shimmers/shimmer_lyrics.dart';
Expand All @@ -16,6 +15,7 @@ import 'package:spotube/services/audio_player/audio_player.dart';
import 'package:spotube/services/queries/queries.dart';

import 'package:spotube/utils/type_conversion_utils.dart';
import 'package:stroke_text/stroke_text.dart';

final _delay = StateProvider<int>((ref) => 0);

Expand Down Expand Up @@ -130,15 +130,13 @@ class SyncedLyrics extends HookConsumerWidget {
child: AnimatedDefaultTextStyle(
duration: const Duration(milliseconds: 250),
style: TextStyle(
color: isActive
? Colors.white
: palette.bodyTextColor,
fontWeight: isActive
? FontWeight.w500
: FontWeight.normal,
fontSize: (isActive ? 28 : 26) *
(textZoomLevel.value / 100),
),
textAlign: TextAlign.center,
child: InkWell(
onTap: () async {
final duration =
Expand All @@ -153,10 +151,19 @@ class SyncedLyrics extends HookConsumerWidget {
}
audioPlayer.seek(time);
},
child: Text(
lyricSlice.text,
textAlign: TextAlign.center,
),
child: Builder(builder: (context) {
return StrokeText(
text: lyricSlice.text,
textStyle:
DefaultTextStyle.of(context).style,
textColor: isActive
? Colors.white
: palette.bodyTextColor,
strokeColor: isActive
? Colors.black
: Colors.transparent,
);
}),
),
),
),
Expand Down
12 changes: 7 additions & 5 deletions lib/pages/settings/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,17 @@ class SettingsPage extends HookConsumerWidget {
text: TextSpan(
children: [
TextSpan(
text: context
.l10n.piped_description),
text: context
.l10n.piped_description,
style:
theme.textTheme.bodyMedium,
),
const TextSpan(text: "\n"),
TextSpan(
text:
context.l10n.piped_warning,
style: Theme.of(context)
.textTheme
.labelMedium,
style:
theme.textTheme.labelMedium,
)
],
),
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
stroke_text:
dependency: "direct main"
description:
name: stroke_text
sha256: "0ec0e526c0eae7d21ce628d78eb9ae9be634259f26b0f1735f9ed540890d8cf6"
url: "https://pub.dev"
source: hosted
version: "0.0.2"
supabase:
dependency: "direct main"
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies:
ref: a738913c8ce2c9f47515382d40827e794a334274
path: plugins/window_size
youtube_explode_dart: ^2.0.1
stroke_text: ^0.0.2

dev_dependencies:
build_runner: ^2.3.2
Expand Down

0 comments on commit 179d536

Please sign in to comment.