mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
feat: libadwaita theming, track tile and PlayButtonCard play button icon fix
This commit is contained in:
parent
36c5e02f18
commit
e795e23e42
@ -139,10 +139,7 @@ class Sidebar extends HookConsumerWidget {
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
"Spotube",
|
||||
style: PlatformTheme.of(context).textTheme?.headline,
|
||||
),
|
||||
PlatformText.headline("Spotube"),
|
||||
PlatformIconButton(
|
||||
icon: const Icon(Icons.menu_rounded),
|
||||
onPressed: toggleExtended,
|
||||
|
@ -78,7 +78,12 @@ class Player extends HookConsumerWidget {
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
linux: null,
|
||||
linux: Border(
|
||||
top: BorderSide(
|
||||
color: PlatformTheme.of(context).borderColor ?? Colors.transparent,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
windows: null,
|
||||
),
|
||||
);
|
||||
|
@ -90,10 +90,7 @@ class Search extends HookConsumerWidget {
|
||||
onChanged: (value) {
|
||||
ref.read(searchTermStateProvider.notifier).state = value;
|
||||
},
|
||||
suffix: PlatformFilledButton(
|
||||
onPressed: onSearch,
|
||||
child: const Icon(Icons.search_rounded),
|
||||
),
|
||||
prefixIcon: Icons.search_rounded,
|
||||
placeholder: "Search...",
|
||||
onSubmitted: (value) {
|
||||
onSearch();
|
||||
|
@ -42,10 +42,8 @@ class PlaybuttonCard extends HookWidget {
|
||||
ios: null,
|
||||
macos: null,
|
||||
linux: BoxShadow(
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 3),
|
||||
spreadRadius: 5,
|
||||
color: Theme.of(context).shadowColor,
|
||||
blurRadius: 6,
|
||||
color: Theme.of(context).shadowColor.withOpacity(0.3),
|
||||
),
|
||||
windows: null,
|
||||
),
|
||||
@ -78,7 +76,10 @@ class PlaybuttonCard extends HookWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: backgroundColor,
|
||||
borderRadius: BorderRadius.circular(
|
||||
platform == TargetPlatform.windows ? 5 : 8,
|
||||
[TargetPlatform.windows, TargetPlatform.linux]
|
||||
.contains(platform)
|
||||
? 5
|
||||
: 8,
|
||||
),
|
||||
boxShadow: [
|
||||
if (boxShadow != null) boxShadow,
|
||||
@ -104,7 +105,10 @@ class PlaybuttonCard extends HookWidget {
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
platform == TargetPlatform.windows ? 5 : 8,
|
||||
[TargetPlatform.windows, TargetPlatform.linux]
|
||||
.contains(platform)
|
||||
? 5
|
||||
: 8,
|
||||
),
|
||||
child: UniversalImage(
|
||||
path: imageUrl,
|
||||
@ -126,6 +130,11 @@ class PlaybuttonCard extends HookWidget {
|
||||
),
|
||||
child: PlatformIconButton(
|
||||
onPressed: onPlaybuttonPressed,
|
||||
backgroundColor:
|
||||
PlatformTheme.of(context).primaryColor,
|
||||
hoverColor: PlatformTheme.of(context)
|
||||
.primaryColor
|
||||
?.withOpacity(0.5),
|
||||
icon: isLoading
|
||||
? const SizedBox(
|
||||
height: 23,
|
||||
@ -137,7 +146,7 @@ class PlaybuttonCard extends HookWidget {
|
||||
isPlaying
|
||||
? Icons.pause_rounded
|
||||
: Icons.play_arrow_rounded,
|
||||
color: backgroundColor,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -214,16 +214,22 @@ class TrackTile extends HookConsumerWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
PlatformIconButton(
|
||||
icon: Icon(
|
||||
playback.track?.id != null &&
|
||||
playback.track?.id == track.value.id
|
||||
? Icons.pause_circle_rounded
|
||||
: Icons.play_circle_rounded,
|
||||
color: PlatformTheme.of(context).primaryColor,
|
||||
),
|
||||
onPressed: () => onTrackPlayButtonPressed?.call(
|
||||
track.value,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0).copyWith(left: 0),
|
||||
child: PlatformIconButton(
|
||||
icon: Icon(
|
||||
playback.track?.id != null &&
|
||||
playback.track?.id == track.value.id
|
||||
? Icons.pause_rounded
|
||||
: Icons.play_arrow_rounded,
|
||||
color: Colors.white,
|
||||
),
|
||||
backgroundColor: PlatformTheme.of(context).primaryColor,
|
||||
hoverColor:
|
||||
PlatformTheme.of(context).primaryColor?.withOpacity(0.5),
|
||||
onPressed: () => onTrackPlayButtonPressed?.call(
|
||||
track.value,
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
@ -227,6 +227,8 @@ class SpotubeState extends ConsumerState<Spotube> with WidgetsBindingObserver {
|
||||
accentMaterialColor: accentMaterialColor,
|
||||
backgroundMaterialColor: backgroundMaterialColor,
|
||||
),
|
||||
linuxTheme: linuxTheme,
|
||||
linuxDarkTheme: linuxDarkTheme,
|
||||
iosTheme: themeMode == ThemeMode.dark ? iosDarkTheme : iosTheme,
|
||||
windowsTheme: windowsTheme,
|
||||
windowsDarkTheme: windowsDarkTheme,
|
||||
|
@ -1,3 +1,4 @@
|
||||
import 'package:adwaita/adwaita.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:macos_ui/macos_ui.dart';
|
||||
@ -149,3 +150,16 @@ final macosDarkTheme = MacosThemeData.dark().copyWith(
|
||||
);
|
||||
const iosTheme = CupertinoThemeData(brightness: Brightness.light);
|
||||
const iosDarkTheme = CupertinoThemeData(brightness: Brightness.dark);
|
||||
|
||||
final linuxTheme = AdwaitaThemeData.light().copyWith(
|
||||
listTileTheme: ListTileThemeData(
|
||||
iconColor: Colors.grey[900],
|
||||
horizontalTitleGap: 0,
|
||||
),
|
||||
);
|
||||
final linuxDarkTheme = AdwaitaThemeData.dark().copyWith(
|
||||
listTileTheme: ListTileThemeData(
|
||||
iconColor: Colors.grey[50],
|
||||
horizontalTitleGap: 0,
|
||||
),
|
||||
);
|
||||
|
58
pubspec.lock
58
pubspec.lock
@ -8,6 +8,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "47.0.0"
|
||||
adwaita:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: adwaita
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.2"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -594,6 +601,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.42.0"
|
||||
flutter_svg:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flutter_svg
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -639,6 +653,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
gsettings:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: gsettings
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.5"
|
||||
hive:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -737,6 +758,20 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.5.0"
|
||||
libadwaita:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: libadwaita
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.5"
|
||||
libadwaita_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: libadwaita_core
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.5.4"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -893,6 +928,20 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.2"
|
||||
path_drawing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_drawing
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
path_parsing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_parsing
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1004,7 +1053,7 @@ packages:
|
||||
path: "../platform_ui"
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.0.1"
|
||||
version: "0.1.0"
|
||||
plugin_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1026,6 +1075,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.6+3"
|
||||
popover_gtk:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: popover_gtk
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.6+3"
|
||||
process:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -66,6 +66,8 @@ dependencies:
|
||||
path: ../platform_ui
|
||||
fluent_ui: ^4.0.3
|
||||
macos_ui: ^1.7.5
|
||||
libadwaita: ^1.2.5
|
||||
adwaita: ^0.5.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
Loading…
Reference in New Issue
Block a user