Files
buzz/mobile/lib/shared/widgets/playing_avatar_image.dart
klopez4212 a0298539f7 Add mobile profile editing (#6583)
## Summary

- add mobile editing for display name, profile description, and profile
photo
- support image positioning, emoji backgrounds, and animated avatar
capture with native iOS controls
- refine settings navigation, profile motion, and the connection
identity row

## Testing

- `just mobile-check`
- `just mobile-test` (1,685 tests)

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Kenny Lopez <klopez4212@gmail.com>
Co-authored-by: Carl <3c4caeafb646d23867f1c4832e68211d77e2561946171625f75c3ce1a3f2670f@buzz.block.builderlab.xyz>
2026-08-24 20:26:28 +01:00

57 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import '../animated_avatar.dart';
import 'avatar_image.dart';
import 'progressive_animated_avatar.dart';
/// A circular avatar that opts into playback for animated profile descriptors.
class PlayingAvatarImage extends StatelessWidget {
/// Creates an avatar that plays animation when the profile URL describes it.
const PlayingAvatarImage({
super.key,
required this.imageUrl,
required this.radius,
required this.fallback,
this.backgroundColor,
});
/// The still-image URL or encoded animated-avatar descriptor.
final String? imageUrl;
/// The radius of the circular avatar.
final double radius;
/// Optional background shown behind still-image content.
final Color? backgroundColor;
/// Content shown while media is unavailable or still loading.
final Widget fallback;
@override
Widget build(BuildContext context) {
final descriptor = parseAnimatedAvatarUrl(imageUrl);
if (descriptor == null || MediaQuery.disableAnimationsOf(context)) {
return AvatarImage(
imageUrl: descriptor?.posterUrl ?? imageUrl,
radius: radius,
backgroundColor: backgroundColor,
fallback: fallback,
);
}
return CircleAvatar(
radius: radius,
backgroundColor: Colors.transparent,
child: ClipOval(
child: SizedBox.square(
dimension: radius * 2,
child: ProgressiveAnimatedAvatar(
descriptor: descriptor,
fallback: fallback,
),
),
),
);
}
}