feat: REV-001 — DiceBear Notionists avatars on review cards
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
// lib/features/reviews/widgets/review_card.dart
|
// lib/features/reviews/widgets/review_card.dart
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import '../models/review_models.dart';
|
import '../models/review_models.dart';
|
||||||
import 'star_display.dart';
|
import 'star_display.dart';
|
||||||
|
|
||||||
@@ -119,11 +120,23 @@ class _ReviewCardState extends State<ReviewCard> {
|
|||||||
// Header row
|
// Header row
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
CircleAvatar(
|
ClipOval(
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
imageUrl: 'https://api.dicebear.com/9.x/notionists/svg?seed=${Uri.encodeComponent(_review.username)}',
|
||||||
|
width: 36,
|
||||||
|
height: 36,
|
||||||
|
placeholder: (_, __) => CircleAvatar(
|
||||||
radius: 18,
|
radius: 18,
|
||||||
backgroundColor: _avatarColor(_review.username),
|
backgroundColor: _avatarColor(_review.username),
|
||||||
child: Text(initial, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15)),
|
child: Text(initial, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15)),
|
||||||
),
|
),
|
||||||
|
errorWidget: (_, __, ___) => CircleAvatar(
|
||||||
|
radius: 18,
|
||||||
|
backgroundColor: _avatarColor(_review.username),
|
||||||
|
child: Text(initial, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 15)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
Reference in New Issue
Block a user