Files
buzz/mobile/lib/features/profile/profile_setup_empty_avatar.dart
klopez4212 5c2ea2e507 feat(mobile): add full-screen profile setup with inline avatar editing (#8628)
Replace the iOS profile setup sheet with a full-screen name → avatar
flow. Require a display name, enable avatar Continue after Done, and let
Skip save the name without an avatar. After a failed save, Not now
continues without saving the draft.

Embed photo, emoji, and animated avatar editing with native Back/Done,
matching 220-point previews, a rounded-notch pencil edit badge, an entry
haptic, equal emoji-preview spacing, and 200 ms transitions that move
the avatar into its editor position without resizing. Apply appearance
changes live across setup and editing while preserving the draft. Keep
the camera exit rail stationary, use a solid shutter, and present photo
positioning full-screen with Back/Done. Preserve the main Flutter view
during presentation and hide underlying controls from VoiceOver while
editing.

Validation: Flutter analysis, 3,796 Flutter tests, and 106 native tests
passed. Built, installed, and launched the isolated iPhone preview;
inspected the native emoji/badge rendering. The local preview entry
point is excluded. Draft pending real login/join → profile-save
verification and owner verification of the updated device flow.

---------

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

62 lines
1.4 KiB
Dart

import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
import '../../shared/theme/buzz_icons.dart';
/// Matches the native setup avatar, using the same 220-point preview bounds.
class ProfileSetupEmptyAvatar extends StatelessWidget {
const ProfileSetupEmptyAvatar({super.key});
@override
Widget build(BuildContext context) => FittedBox(
child: SizedBox.square(
dimension: 220,
child: CustomPaint(
painter: _RingPainter(
CupertinoDynamicColor.resolve(CupertinoColors.tertiaryLabel, context),
),
child: Center(
child: Icon(
BuzzIcons.plus,
size: 40,
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 = 3;
final bounds = Offset.zero & size;
const count = 32;
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;
}