Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
improve mobile dark UI
Browse files Browse the repository at this point in the history
  • Loading branch information
boyan01 committed Dec 23, 2023
1 parent 21612eb commit e6c3b53
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
9 changes: 9 additions & 0 deletions lib/navigation/common/material/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ extension QuietAppTheme on BuildContext {
TextTheme get primaryTextTheme => Theme.of(this).primaryTextTheme;

AppColorScheme get colorScheme => AppTheme.colorScheme(this);

ColorScheme get colorScheme2 => Theme.of(this).colorScheme;

Color dynamicColor({
required Color light,
required Color dark,
}) {
return colorScheme.brightness == Brightness.light ? light : dark;
}
}

extension TextStyleExtesntion on TextStyle? {
Expand Down
6 changes: 5 additions & 1 deletion lib/navigation/common/player/player_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ class PlayingOperationBar extends ConsumerWidget {

@override
Widget build(BuildContext context, WidgetRef ref) {
final iconColor = this.iconColor ?? context.colorScheme.onPrimary;
final iconColor = this.iconColor ??
context.dynamicColor(
light: context.colorScheme2.onPrimary,
dark: context.colorScheme2.onBackground,
);
final music = ref.watch(playingTrackProvider)!;

return Row(
Expand Down
11 changes: 8 additions & 3 deletions lib/navigation/common/player/player_progress.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class DurationProgressBar extends ConsumerWidget {
final player = ref.read(playerProvider);
final theme = Theme.of(context).primaryTextTheme;

final primaryColor = context.dynamicColor(
light: context.colorScheme2.onPrimary,
dark: context.colorScheme2.onBackground,
);

return Padding(
padding: const EdgeInsets.symmetric(vertical: 20),
child: SliderTheme(
Expand All @@ -26,12 +31,12 @@ class DurationProgressBar extends ConsumerWidget {
trackShape: const UnboundedRoundedRectSliderTrackShape(
removeAdditionalActiveTrackHeight: true,
),
activeTrackColor: context.colorScheme.onPrimary,
inactiveTrackColor: context.colorScheme.onPrimary.withOpacity(0.5),
activeTrackColor: primaryColor,
inactiveTrackColor: primaryColor.withOpacity(0.5),
overlayShape: const RoundSliderOverlayShape(
overlayRadius: 10,
),
thumbColor: context.colorScheme.onPrimary,
thumbColor: primaryColor,
showValueIndicator: ShowValueIndicator.always,
),
child: Padding(
Expand Down
23 changes: 18 additions & 5 deletions lib/navigation/mobile/player/page_playing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PlayingPage extends ConsumerWidget {
}
}

///player controller
/// player controller
/// pause,play,play next,play previous...
class PlayerControllerBar extends ConsumerWidget {
const PlayerControllerBar({super.key});
Expand Down Expand Up @@ -91,8 +91,13 @@ class PlayerControllerBar extends ConsumerWidget {
),
);

return IconTheme(
data: IconThemeData(color: context.colorScheme.onPrimary),
return IconTheme.merge(
data: IconThemeData(
color: context.dynamicColor(
light: context.colorScheme2.onPrimary,
dark: context.colorScheme2.onBackground,
),
),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 16),
child: Row(
Expand Down Expand Up @@ -199,7 +204,12 @@ class PlayingTitle extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
return AppBar(
elevation: 0,
leading: AppBackButton(color: context.colorScheme.onPrimary),
leading: AppBackButton(
color: context.dynamicColor(
light: context.colorScheme2.onPrimary,
dark: context.colorScheme2.onBackground,
),
),
titleSpacing: 0,
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -228,7 +238,10 @@ class PlayingTitle extends ConsumerWidget {
Icon(
FluentIcons.chevron_right_20_regular,
size: 17,
color: context.colorScheme.onPrimary,
color: context.dynamicColor(
light: context.colorScheme2.onPrimary,
dark: context.colorScheme2.onBackground,
),
),
const SizedBox(width: 16),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class _AppBar extends StatelessWidget {
automaticallyImplyLeading: false,
title: Text(t > 0.5 ? playlist.name : context.strings.playlist),
backgroundColor: Colors.transparent,
foregroundColor: context.colorScheme.onPrimary,
foregroundColor: Colors.white,
elevation: 0,
centerTitle: false,
titleSpacing: 0,
Expand Down

0 comments on commit e6c3b53

Please sign in to comment.