From ea401cf5fe0d34c7c1961680dadd5b59b8168314 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sun, 25 Jun 2023 17:29:24 +0600 Subject: [PATCH] chore: relayout shimmer track tiles --- .../shared/shimmers/shimmer_track_tile.dart | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/lib/components/shared/shimmers/shimmer_track_tile.dart b/lib/components/shared/shimmers/shimmer_track_tile.dart index 7d50c1068..1717d50bb 100644 --- a/lib/components/shared/shimmers/shimmer_track_tile.dart +++ b/lib/components/shared/shimmers/shimmer_track_tile.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:spotube/collections/spotube_icons.dart'; import 'package:spotube/extensions/theme.dart'; @@ -26,29 +27,37 @@ class ShimmerTrackTilePainter extends CustomPainter { canvas.drawRRect( RRect.fromRectAndRadius( - const Rect.fromLTWH(5, 5, 40, 40), + Rect.fromLTWH(0, 0, size.height, size.height), const Radius.circular(5), ), Paint()..color = foreground, ); - canvas.drawCircle( - const Offset(70, 25), - 15, - Paint()..color = foreground, - ); - canvas.drawRRect( RRect.fromRectAndRadius( - const Rect.fromLTWH(95, 10, 100, 10), + const Rect.fromLTWH(70, 10, 100, 10), const Radius.circular(5), ), Paint()..color = foreground, ); + // draw Icons.play + const icon = Icons.play_arrow_outlined; + TextPainter textPainter = TextPainter(textDirection: TextDirection.rtl); + textPainter.text = TextSpan( + text: String.fromCharCode(icon.codePoint), + style: TextStyle( + fontSize: 40.0, + fontFamily: icon.fontFamily, + color: background, + ), + ); + textPainter.layout(); + textPainter.paint(canvas, const Offset(10, 10)); + canvas.drawRRect( RRect.fromRectAndRadius( - const Rect.fromLTWH(95, 30, 170, 7), + const Rect.fromLTWH(70, 30, 170, 7), const Radius.circular(5), ), Paint()..color = foreground, @@ -81,7 +90,7 @@ class ShimmerTrackTile extends StatelessWidget { return Padding( padding: const EdgeInsets.only(bottom: 8.0, left: 8, right: 8), child: CustomPaint( - size: const Size(double.infinity, 50), + size: const Size(double.infinity, 60), painter: ShimmerTrackTilePainter( background: shimmerTheme.shimmerBackgroundColor ?? theme.scaffoldBackgroundColor, @@ -98,7 +107,7 @@ class ShimmerTrackTile extends StatelessWidget { (BuildContext context, int index) => Padding( padding: const EdgeInsets.only(bottom: 8.0, left: 8, right: 8), child: CustomPaint( - size: const Size(double.infinity, 50), + size: const Size(double.infinity, 60), painter: ShimmerTrackTilePainter( background: shimmerTheme.shimmerBackgroundColor ?? theme.scaffoldBackgroundColor,