mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-12 23:45:18 +00:00
chore: fix android build and player controls slider layout builder exception
This commit is contained in:
parent
db3aaa4b83
commit
e2143a0625
@ -106,3 +106,22 @@ extension ScreenBreakpoints on MediaQueryData {
|
||||
bool get lgAndDown => isXs || isSm || isMd || isLg;
|
||||
bool get xlAndDown => isXs || isSm || isMd || isLg || isXl;
|
||||
}
|
||||
|
||||
extension SizeBreakpoints on Size {
|
||||
bool get isXs => width <= Breakpoints.xs;
|
||||
bool get isSm => width > Breakpoints.xs && width <= Breakpoints.sm;
|
||||
bool get isMd => width > Breakpoints.sm && width <= Breakpoints.md;
|
||||
bool get isLg => width > Breakpoints.md && width <= Breakpoints.lg;
|
||||
bool get isXl => width > Breakpoints.lg && width <= Breakpoints.xl;
|
||||
bool get is2Xl => width > Breakpoints.xl;
|
||||
|
||||
bool get smAndUp => isSm || isMd || isLg || isXl || is2Xl;
|
||||
bool get mdAndUp => isMd || isLg || isXl || is2Xl;
|
||||
bool get lgAndUp => isLg || isXl || is2Xl;
|
||||
bool get xlAndUp => isXl || is2Xl;
|
||||
|
||||
bool get smAndDown => isXs || isSm;
|
||||
bool get mdAndDown => isXs || isSm || isMd;
|
||||
bool get lgAndDown => isXs || isSm || isMd || isLg;
|
||||
bool get xlAndDown => isXs || isSm || isMd || isLg || isXl;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import 'package:shadcn_flutter/shadcn_flutter.dart' hide ThemeData;
|
||||
|
||||
import 'package:spotube/collections/spotube_icons.dart';
|
||||
import 'package:spotube/collections/intents.dart';
|
||||
import 'package:spotube/extensions/constrains.dart';
|
||||
import 'package:spotube/extensions/context.dart';
|
||||
import 'package:spotube/extensions/duration.dart';
|
||||
import 'package:spotube/modules/player/use_progress.dart';
|
||||
@ -65,6 +66,8 @@ class PlayerControls extends HookConsumerWidget {
|
||||
if (!compact)
|
||||
HookBuilder(
|
||||
builder: (context) {
|
||||
final mediaQuery = MediaQuery.sizeOf(context);
|
||||
|
||||
final (
|
||||
:bufferProgress,
|
||||
:duration,
|
||||
@ -85,7 +88,10 @@ class PlayerControls extends HookConsumerWidget {
|
||||
children: [
|
||||
Tooltip(
|
||||
tooltip: TooltipContainer(
|
||||
child: Text(context.l10n.slide_to_seek)),
|
||||
child: Text(context.l10n.slide_to_seek),
|
||||
),
|
||||
child: SizedBox(
|
||||
width: mediaQuery.xlAndUp ? 600 : 500,
|
||||
child: Slider(
|
||||
value:
|
||||
SliderValue.single(progress.value.toDouble()),
|
||||
@ -104,6 +110,7 @@ class PlayerControls extends HookConsumerWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8.0,
|
||||
|
29
pubspec.lock
29
pubspec.lock
@ -159,12 +159,13 @@ packages:
|
||||
source: hosted
|
||||
version: "5.1.10"
|
||||
bonsoir_android:
|
||||
dependency: transitive
|
||||
dependency: "direct overridden"
|
||||
description:
|
||||
name: bonsoir_android
|
||||
sha256: a72d83a78780c1f238e3178d0585e5604fbd9f2503206293737cdfab899ce8d0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
path: "packages/bonsoir_android"
|
||||
ref: HEAD
|
||||
resolved-ref: aa5604628ba41e3a7153769f4465a3d375488f2e
|
||||
url: "https://github.com/KRTirtho/Bonsoir.git"
|
||||
source: git
|
||||
version: "5.1.5"
|
||||
bonsoir_darwin:
|
||||
dependency: transitive
|
||||
@ -514,10 +515,11 @@ packages:
|
||||
disable_battery_optimization:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: disable_battery_optimization
|
||||
sha256: "6b2ba802f984af141faf1b6b5fb956d5ef01f9cd555597c35b9cc335a03185ba"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
path: "."
|
||||
ref: HEAD
|
||||
resolved-ref: aa77a61946849fff495091fc13dcc390948cc60b
|
||||
url: "https://github.com/KRTirtho/Disable-Battery-Optimizations.git"
|
||||
source: git
|
||||
version: "1.1.1"
|
||||
draggable_scrollbar:
|
||||
dependency: "direct main"
|
||||
@ -1952,10 +1954,11 @@ packages:
|
||||
shadcn_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: shadcn_flutter
|
||||
sha256: "2b58f6ee6d15defd8d07aa1e82077c85455ddc68047368994c562006c2338ec2"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
path: "."
|
||||
ref: "5359958464a57235f0f34c43a4623356a32459a0"
|
||||
resolved-ref: "5359958464a57235f0f34c43a4623356a32459a0"
|
||||
url: "https://github.com/KRTirtho/shadcn_flutter.git"
|
||||
source: git
|
||||
version: "0.0.24"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
|
13
pubspec.yaml
13
pubspec.yaml
@ -30,7 +30,9 @@ dependencies:
|
||||
url: https://github.com/KRTirtho/flutter-plugins.git
|
||||
device_info_plus: ^11.1.1
|
||||
dio: ^5.4.3+1
|
||||
disable_battery_optimization: ^1.1.1
|
||||
disable_battery_optimization:
|
||||
git:
|
||||
url: https://github.com/KRTirtho/Disable-Battery-Optimizations.git
|
||||
draggable_scrollbar:
|
||||
git:
|
||||
ref: cfd570035bf393de541d32e9b28808b5d7e602df
|
||||
@ -98,7 +100,10 @@ dependencies:
|
||||
ref: dart-3-support
|
||||
url: https://github.com/KRTirtho/scrobblenaut.git
|
||||
scroll_to_index: ^3.0.1
|
||||
shadcn_flutter: ^0.0.24
|
||||
shadcn_flutter:
|
||||
git:
|
||||
url: https://github.com/KRTirtho/shadcn_flutter.git
|
||||
ref: 5359958464a57235f0f34c43a4623356a32459a0
|
||||
shared_preferences: ^2.2.3
|
||||
shelf: ^1.4.1
|
||||
shelf_router: ^1.1.4
|
||||
@ -149,6 +154,10 @@ dev_dependencies:
|
||||
drift_dev: ^2.21.0
|
||||
|
||||
dependency_overrides:
|
||||
bonsoir_android:
|
||||
git:
|
||||
url: https://github.com/KRTirtho/Bonsoir.git
|
||||
path: packages/bonsoir_android
|
||||
web: ^1.1.0
|
||||
meta: 1.16.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user