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