Skip to content

Commit

Permalink
fix(macos): black text in dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 3, 2022
1 parent c201624 commit fb9c0e4
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Flutter",
"type": "dart",
"request": "launch",
"program": "lib/main.dart"
"program": "${workspaceFolder}/lib/main.dart"
},
],
"compounds": []
Expand Down
1 change: 1 addition & 0 deletions lib/components/Library/UserAlbums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class UserAlbums extends HookConsumerWidget {
return SingleChildScrollView(
child: Material(
type: MaterialType.transparency,
textStyle: PlatformTheme.of(context).textTheme!.body!,
color: PlatformTheme.of(context).scaffoldBackgroundColor,
child: Container(
width: double.infinity,
Expand Down
1 change: 1 addition & 0 deletions lib/components/Library/UserArtists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class UserArtists extends HookConsumerWidget {

return Material(
type: MaterialType.transparency,
textStyle: PlatformTheme.of(context).textTheme!.body!,
color: PlatformTheme.of(context).scaffoldBackgroundColor,
child: GridView.builder(
itemCount: artists.length,
Expand Down
2 changes: 2 additions & 0 deletions lib/components/Library/UserPlaylists.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:fl_query_hooks/fl_query_hooks.dart';
import 'package:flutter/material.dart' hide Image;
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotify/spotify.dart';
import 'package:spotube/components/LoaderShimmers/ShimmerPlaybuttonCard.dart';
import 'package:spotube/components/Playlist/PlaylistCard.dart';
Expand Down Expand Up @@ -36,6 +37,7 @@ class UserPlaylists extends HookConsumerWidget {
return SingleChildScrollView(
child: Material(
type: MaterialType.transparency,
textStyle: PlatformTheme.of(context).textTheme!.body!,
child: Container(
width: double.infinity,
padding: const EdgeInsets.all(8.0),
Expand Down
7 changes: 2 additions & 5 deletions lib/components/Lyrics/LyricDelayAdjustDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,10 @@ class LyricDelayAdjustDialog extends HookConsumerWidget {
},
),
Flexible(
child: TextField(
child: PlatformTextField(
keyboardType: TextInputType.number,
controller: controller,
decoration: const InputDecoration(
isDense: true,
hintText: "Delay in milliseconds",
),
placeholder: "Delay in milliseconds",
onSubmitted: (_) {
Navigator.of(context).pop(
Duration(
Expand Down
1 change: 1 addition & 0 deletions lib/components/Lyrics/SyncedLyrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class SyncedLyrics extends HookConsumerWidget {
height: breakpoint >= Breakpoints.md ? 50 : 30,
child: Material(
type: MaterialType.transparency,
textStyle: PlatformTheme.of(context).textTheme!.body!,
child: Stack(
children: [
Center(
Expand Down
1 change: 1 addition & 0 deletions lib/components/Player/Player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Player extends HookConsumerWidget {
),
child: Material(
type: MaterialType.transparency,
textStyle: PlatformTheme.of(context).textTheme!.body!,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expand Down
1 change: 1 addition & 0 deletions lib/components/Player/PlayerOverlay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class PlayerOverlay extends HookConsumerWidget {
duration: const Duration(milliseconds: 250),
opacity: canShow ? 1 : 0,
child: Material(
textStyle: PlatformTheme.of(context).textTheme!.body!,
type: MaterialType.transparency,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down
1 change: 1 addition & 0 deletions lib/components/Player/PlayerView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class PlayerView extends HookConsumerWidget {
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 15, sigmaY: 15),
child: Material(
textStyle: PlatformTheme.of(context).textTheme!.body!,
color: paletteColor.color.withOpacity(.5),
child: SafeArea(
child: Column(
Expand Down
4 changes: 2 additions & 2 deletions lib/components/Player/SiblingTracksSheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/components/Shared/UniversalImage.dart';
import 'package:spotube/provider/Playback.dart';
import 'package:spotube/utils/primitive_utils.dart';
Expand Down Expand Up @@ -59,7 +60,7 @@ class SiblingTracksSheet extends HookConsumerWidget {
itemCount: playback.siblingYtVideos.length,
itemBuilder: (context, index) {
final video = playback.siblingYtVideos[index];
return ListTile(
return PlatformListTile(
title: Text(video.title),
leading: UniversalImage(
path: video.thumbnails.lowResUrl,
Expand All @@ -69,7 +70,6 @@ class SiblingTracksSheet extends HookConsumerWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
horizontalTitleGap: 10,
trailing: Text(
PrimitiveUtils.toReadableDuration(
video.duration ?? Duration.zero,
Expand Down
4 changes: 2 additions & 2 deletions lib/components/Playlist/PlaylistCreateDialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ class PlaylistCreateDialog extends HookConsumerWidget {
const SizedBox(height: 10),
CheckboxListTile(
value: public.value,
title: const Text("Public"),
title: const PlatformText("Public"),
onChanged: (val) => public.value = val ?? false,
),
const SizedBox(height: 10),
CheckboxListTile(
value: collaborative.value,
title: const Text("Collaborative"),
title: const PlatformText("Collaborative"),
onChanged: (val) => collaborative.value = val ?? false,
),
],
Expand Down
1 change: 1 addition & 0 deletions lib/components/Search/Search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class Search extends HookConsumerWidget {
return SafeArea(
child: Material(
color: PlatformTheme.of(context).scaffoldBackgroundColor,
textStyle: PlatformTheme.of(context).textTheme!.body!,
child: Column(
children: [
Container(
Expand Down
11 changes: 6 additions & 5 deletions lib/components/Settings/About.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class About extends HookWidget {

return PlatformListTile(
leading: const Icon(Icons.info_outline_rounded),
title: Text(
title: PlatformText(
"About Spotube",
style: PlatformTextTheme.of(context).body,
),
Expand All @@ -48,7 +48,7 @@ class About extends HookWidget {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text("Author: "),
PlatformText("Author: "),
Hyperlink(
"Kingkor Roy Tirtho",
"https:/KRTirtho",
Expand All @@ -63,20 +63,21 @@ class About extends HookWidget {
"💚 Sponsor/Donate 💚",
"https://opencollective.com/spotube",
),
Text(" • "),
PlatformText(" • "),
Hyperlink(
"BSD-4-Clause LICENSE",
"https:/KRTirtho/spotube/blob/master/LICENSE",
),
Text(" • "),
PlatformText(" • "),
Hyperlink(
"Bug Report",
"https:/KRTirtho/spotube/issues/new?assignees=&labels=bug&template=bug_report.md&title=",
),
],
),
const SizedBox(height: 10),
const Center(child: Text("© Spotube 2022. All rights reserved"))
const Center(
child: PlatformText("© Spotube 2022. All rights reserved"))
]);
},
);
Expand Down
12 changes: 4 additions & 8 deletions lib/components/Settings/Settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:go_router/go_router.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:macos_ui/macos_ui.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/components/Settings/About.dart';
import 'package:spotube/components/Settings/ColorSchemePickerDialog.dart';
Expand Down Expand Up @@ -339,17 +338,14 @@ class Settings extends HookConsumerWidget {
),
AdaptiveListTile(
leading: const Icon(Icons.screen_search_desktop_rounded),
title: SizedBox(
title: const SizedBox(
height: 50,
width: 200,
child: Align(
alignment: Alignment.centerLeft,
child: DefaultTextStyle(
style: PlatformTextTheme.of(context).body!,
child: const AutoSizeText(
"Format of the YouTube Search term",
maxLines: 2,
),
child: AutoSizeText(
"Format of the YouTube Search term",
maxLines: 2,
),
),
),
Expand Down
13 changes: 3 additions & 10 deletions lib/components/Shared/PlaybuttonCard.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'package:fluent_ui/fluent_ui.dart' as FluentUI;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:macos_ui/macos_ui.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:spotube/components/Shared/HoverBuilder.dart';
import 'package:spotube/components/Shared/SpotubeMarqueeText.dart';
Expand Down Expand Up @@ -54,10 +51,6 @@ class PlaybuttonCard extends HookWidget {
),
);

final titleStyle = PlatformTextTheme.of(context).body;

final descriptionStyle = PlatformTextTheme.of(context).caption;

final splash = usePlatformProperty<InteractiveInkFeatureFactory?>(
(context) => PlatformProperty.multiPlatformGroup({
InkRipple.splashFactory: {TargetPlatform.android, TargetPlatform.linux},
Expand Down Expand Up @@ -164,8 +157,8 @@ class PlaybuttonCard extends HookWidget {
height: 20,
child: SpotubeMarqueeText(
text: title,
style: titleStyle?.copyWith(
fontWeight: FontWeight.bold),
style:
const TextStyle(fontWeight: FontWeight.bold),
isHovering: isHovering,
),
),
Expand All @@ -176,7 +169,7 @@ class PlaybuttonCard extends HookWidget {
height: 30,
child: SpotubeMarqueeText(
text: description!,
style: descriptionStyle,
style: PlatformTextTheme.of(context).caption,
isHovering: isHovering,
),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/components/Shared/SpotubeMarqueeText.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class SpotubeMarqueeText extends HookWidget {
return AutoSizeText(
text,
minFontSize: 13,
style: style,
style: DefaultTextStyle.of(context).style.merge(style),
maxLines: 1,
overflowReplacement: Marquee(
key: uKey.value,
text: text,
style: style,
style: DefaultTextStyle.of(context).style.merge(style),
scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.start,
blankSpace: 40.0,
Expand Down
1 change: 1 addition & 0 deletions lib/components/Shared/TrackCollectionView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class TrackCollectionView<T> extends HookConsumerWidget {
),
),
child: Material(
textStyle: PlatformTheme.of(context).textTheme!.body!,
type: MaterialType.transparency,
child: Padding(
padding: const EdgeInsets.symmetric(
Expand Down
1 change: 1 addition & 0 deletions lib/components/Shared/TrackTile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class TrackTile extends HookConsumerWidget {
),
child: Material(
type: MaterialType.transparency,
textStyle: PlatformTheme.of(context).textTheme!.body!,
child: Row(
children: [
if (showCheck)
Expand Down
4 changes: 1 addition & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import 'dart:convert';
import 'package:audio_service/audio_service.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:fl_query/fl_query.dart';
import 'package:fluent_ui/fluent_ui.dart' as FluentUI;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:macos_ui/macos_ui.dart';
import 'package:platform_ui/platform_ui.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:spotube/components/Shared/ReplaceDownloadedFileDialog.dart';
Expand Down Expand Up @@ -201,7 +199,7 @@ class SpotubeState extends ConsumerState<Spotube> with WidgetsBindingObserver {
};
}, []);

platform = TargetPlatform.windows;
platform = TargetPlatform.macOS;

return PlatformApp.router(
routeInformationParser: router.routeInformationParser,
Expand Down

0 comments on commit fb9c0e4

Please sign in to comment.