Files
buzz/mobile/lib/features/profile/profile_setup_empty_avatar.dart
klopez4212 f7708d0694 Polish mobile onboarding and profile setup (#8438)
Originally stacked on #8375, now merged. Rebased onto main.

Polishes the onboarding landing page, community-link entry, and recovery
sheets. Profile setup uses a consistent sheet with a larger avatar,
inline display name, and draft photo/emoji/animated editing; iOS uses
native controls and coordinated avatar/sheet transitions.

Validation: mobile analysis, full tests, and normal pre-push checks
passed after rebase. Prior iOS build and device walkthrough passed;
native validation was not repeated after this rebase. Snapshots omitted
as requested.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Co-authored-by: Tom Brow <tomb@block.xyz>
2026-10-22 17:27:38 +00:00

63 lines
1.5 KiB
Dart

import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
import '../../shared/theme/buzz_icons.dart';
/// Matches the native setup avatar, scaled from its 96-point source bounds.
class ProfileSetupEmptyAvatar extends StatelessWidget {
const ProfileSetupEmptyAvatar({super.key});
@override
Widget build(BuildContext context) => FittedBox(
child: SizedBox.square(
dimension: 96,
child: CustomPaint(
painter: _RingPainter(
CupertinoDynamicColor.resolve(CupertinoColors.tertiaryLabel, context),
),
child: Center(
child: Icon(
BuzzIcons.plus,
size: 28,
color: CupertinoDynamicColor.resolve(
CupertinoColors.label,
context,
),
),
),
),
),
);
}
class _RingPainter extends CustomPainter {
const _RingPainter(this.color);
final Color color;
@override
void paint(Canvas canvas, Size size) {
final paint = Paint()
..color = color
..style = PaintingStyle.stroke
..strokeWidth = 2;
final bounds = Offset.zero & size;
final radius = (size.width - 4) / 2;
final circumference = 2 * math.pi * radius;
final count = (circumference / 9).round();
final step = 2 * math.pi / count;
for (var index = 0; index < count; index++) {
canvas.drawArc(
bounds.deflate(2),
index * step,
step * 4 / 9,
false,
paint,
);
}
}
@override
bool shouldRepaint(_RingPainter oldDelegate) => oldDelegate.color != color;
}