mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00

* refactor: remove SourcedTrack based audio player and utilize mediakit playback system * feat: implement local (loopback) server to resolve stream source and leverage the media_kit playback API * feat: add source change support and re-add prefetching tracks * fix: assign lastId when track fetch completes regardless of error * chore: remove print statements * fix: remote queue not working * fix: increase mpv network timeout to reduce auto-skipping * fix: do not pre-fetch local tracks * fix(proxy-playlist): reset collections on load * chore: fix lint warnings * fix(mobile): player overlay should not be visible when the player is not playing * chore: fix typo in turkish translation * cd: checkout PR branch * cd: upgrade flutter version * chore: fix lint errors
89 lines
2.2 KiB
Dart
89 lines
2.2 KiB
Dart
library bordered_text;
|
|
|
|
import 'package:flutter/widgets.dart';
|
|
|
|
/// Adds stroke to text widget
|
|
/// We can apply a very thin and subtle stroke to a [Text]
|
|
/// ```dart
|
|
/// BorderedText(
|
|
/// strokeWidth: 1.0,
|
|
/// text: Text(
|
|
/// 'Bordered Text',
|
|
/// style: TextStyle(
|
|
/// decoration: TextDecoration.none,
|
|
/// decorationStyle: TextDecorationStyle.wavy,
|
|
/// decorationColor: Colors.red,
|
|
/// ),
|
|
/// ),
|
|
/// )
|
|
/// ```
|
|
class BorderedText extends StatelessWidget {
|
|
const BorderedText({
|
|
super.key,
|
|
required this.child,
|
|
this.strokeCap = StrokeCap.round,
|
|
this.strokeJoin = StrokeJoin.round,
|
|
this.strokeWidth = 6.0,
|
|
this.strokeColor = const Color.fromRGBO(53, 0, 71, 1),
|
|
});
|
|
|
|
/// the stroke cap style
|
|
final StrokeCap strokeCap;
|
|
|
|
/// the stroke joint style
|
|
final StrokeJoin strokeJoin;
|
|
|
|
/// the stroke width
|
|
final double strokeWidth;
|
|
|
|
/// the stroke color
|
|
final Color strokeColor;
|
|
|
|
/// the [Text] widget to apply stroke on
|
|
final Text child;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
TextStyle style;
|
|
if (child.style != null) {
|
|
style = child.style!.copyWith(
|
|
foreground: Paint()
|
|
..style = PaintingStyle.stroke
|
|
..strokeCap = strokeCap
|
|
..strokeJoin = strokeJoin
|
|
..strokeWidth = strokeWidth
|
|
..color = strokeColor,
|
|
color: null,
|
|
);
|
|
} else {
|
|
style = TextStyle(
|
|
foreground: Paint()
|
|
..style = PaintingStyle.stroke
|
|
..strokeCap = strokeCap
|
|
..strokeJoin = strokeJoin
|
|
..strokeWidth = strokeWidth
|
|
..color = strokeColor,
|
|
);
|
|
}
|
|
return Stack(
|
|
alignment: Alignment.center,
|
|
textDirection: child.textDirection,
|
|
children: <Widget>[
|
|
Text(
|
|
child.data!,
|
|
style: style,
|
|
maxLines: child.maxLines,
|
|
overflow: child.overflow,
|
|
semanticsLabel: child.semanticsLabel,
|
|
softWrap: child.softWrap,
|
|
strutStyle: child.strutStyle,
|
|
textAlign: child.textAlign,
|
|
textDirection: child.textDirection,
|
|
textScaler: child.textScaler,
|
|
),
|
|
child,
|
|
],
|
|
);
|
|
}
|
|
}
|