content: import 'package:app/models/models.dart';
  import 'package:app/router.dart';
  import 'package:app/ui/widgets/widgets.dart';
  import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  
  class ArtistCard extends StatefulWidget {
    final Artist artist;
    final AppRouter router;
  
    ArtistCard({
      Key? key,
      required this.artist,
      this.router = const AppRouter(),
    }) : super(key: key);
  
    @override
    _ArtistCardState createState() => _ArtistCardState();
  }
  
  class _ArtistCardState extends State<ArtistCard> {
    var _opacity = 1.0;
    final _cardWidth = 144.0;
  
    @override
    Widget build(BuildContext context) {
      return GestureDetector(
        onTapDown: (_) => setState(() => _opacity = 0.4),
        onTapUp: (_) => setState(() => _opacity = 1.0),
        onTapCancel: () => setState(() => _opacity = 1.0),
        onTap: () => widget.router.gotoArtistDetailsScreen(
          context,
          artistId: widget.artist.id,
        ),
        behavior: HitTestBehavior.opaque,
        child: AnimatedOpacity(
          duration: const Duration(milliseconds: 100),
          opacity: _opacity,
          child: Column(
            children: <Widget>[
              AlbumArtistThumbnail.md(entity: widget.artist, asHero: true),
              const SizedBox(height: 12),
              SizedBox(
                width: _cardWidth,
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      widget.artist.name,
                      style: const TextStyle(fontWeight: FontWeight.bold),
                      overflow: TextOverflow.ellipsis,
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      );
    }
  }
  