Portrait et nom à gauche du lecteur de l'article. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011VxSQeGQYUvPmSEoGdnidA
37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Le personnage qui parle, à côté du lecteur audio (plan Studio lot 8d) : portrait canon et
|
|
/// nom, sans libellé — un nom propre ne demande pas de traduction.
|
|
class NarratorAvatar extends StatelessWidget {
|
|
const NarratorAvatar({Key? key, required this.name, this.portraitUrl, this.size = 44}) : super(key: key);
|
|
|
|
final String name;
|
|
final String? portraitUrl;
|
|
final double size;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final placeholder = Container(
|
|
color: const Color(0xFFE8E3DA),
|
|
child: Icon(Icons.person, size: size * 0.6, color: const Color(0xFF6B7B86)),
|
|
);
|
|
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
ClipOval(
|
|
child: SizedBox(
|
|
width: size,
|
|
height: size,
|
|
child: portraitUrl == null
|
|
? placeholder
|
|
: Image.network(portraitUrl!, fit: BoxFit.cover, errorBuilder: (_, __, ___) => placeholder),
|
|
),
|
|
),
|
|
const SizedBox(width: 12),
|
|
Text(name, style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600)),
|
|
],
|
|
);
|
|
}
|
|
}
|