Skip to content

Commit

Permalink
add thumb padding
Browse files Browse the repository at this point in the history
  • Loading branch information
NightFeather0615 committed Dec 13, 2023
1 parent ba871b7 commit 2faac69
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 22 deletions.
2 changes: 2 additions & 0 deletions lib/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ class Config {
static const String discordApiUrl = "https://discord.com/api/v9";

static const String evergreenBootstrapperUrl = "https://go.microsoft.com/fwlink/p/?LinkId=2124703";

static const double progressBarThumbSize = 2.438;
}
13 changes: 8 additions & 5 deletions lib/widget/progress_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';

import 'package:landart/landart.dart';
import 'package:lanyard_listening_along/config.dart';


class ProgressBar extends StatefulWidget {
Expand All @@ -21,8 +22,6 @@ class _ProgressBarState extends State<ProgressBar> {
late int _songLength = widget.timestamp.end! - widget.timestamp.start!;
int _songProgress = 0;
late final Timer _updateTimer;
static const double _thumbSize = 2.438;


@override
void initState() {
Expand Down Expand Up @@ -76,8 +75,8 @@ class _ProgressBarState extends State<ProgressBar> {
data: SliderThemeData(
overlayShape: SliderComponentShape.noOverlay,
thumbShape: const RoundSliderThumbShape(
enabledThumbRadius: _thumbSize,
disabledThumbRadius: _thumbSize,
enabledThumbRadius: Config.progressBarThumbSize,
disabledThumbRadius: Config.progressBarThumbSize,
elevation: 0
),
trackHeight: 3,
Expand All @@ -92,7 +91,11 @@ class _ProgressBarState extends State<ProgressBar> {
),
),
Padding(
padding: const EdgeInsets.only(right: _thumbSize / 2, left: _thumbSize / 2, top: 1),
padding: const EdgeInsets.only(
right: Config.progressBarThumbSize / 2,
left: Config.progressBarThumbSize / 2,
top: 1.2
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
Expand Down
50 changes: 33 additions & 17 deletions lib/widget/spotify_card.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:landart/landart.dart';
import 'package:lanyard_listening_along/config.dart';
import 'package:lanyard_listening_along/widget/progress_bar.dart';


Expand Down Expand Up @@ -43,32 +44,47 @@ class _SpotifyCardState extends State<SpotifyCard> {
child: SizedBox(
height: 130,
child: Padding(
padding: const EdgeInsets.only(left: 14, top: 6),
padding: const EdgeInsets.only(left: 12, top: 6),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Text(
widget.spotifyData.song,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis
Padding(
padding: const EdgeInsets.only(
left: Config.progressBarThumbSize / 2
),
child: Text(
widget.spotifyData.song,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
overflow: TextOverflow.ellipsis
),
),
),
Text(
"by ${widget.spotifyData.artist}",
style: const TextStyle(
fontSize: 16,
overflow: TextOverflow.ellipsis
Padding(
padding: const EdgeInsets.only(
left: Config.progressBarThumbSize / 2
),
child: Text(
"by ${widget.spotifyData.artist}",
style: const TextStyle(
fontSize: 16,
overflow: TextOverflow.ellipsis
),
),
),
Text(
"on ${widget.spotifyData.album}",
style: const TextStyle(
fontSize: 16,
overflow: TextOverflow.ellipsis
Padding(
padding: const EdgeInsets.only(
left: Config.progressBarThumbSize / 2
),
child: Text(
"on ${widget.spotifyData.album}",
style: const TextStyle(
fontSize: 16,
overflow: TextOverflow.ellipsis
),
),
),
Expanded(
Expand Down

0 comments on commit 2faac69

Please sign in to comment.