mirror of
https://github.com/block/buzz.git
synced 2026-11-26 03:01:38 +00:00
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>
This commit is contained in:
@@ -16,6 +16,7 @@ class BuzzSheetHeader extends StatelessWidget {
|
||||
this.titleKey,
|
||||
this.leading,
|
||||
this.trailing,
|
||||
this.onClose,
|
||||
this.showDragHandle = false,
|
||||
});
|
||||
|
||||
@@ -23,6 +24,9 @@ class BuzzSheetHeader extends StatelessWidget {
|
||||
final Key? titleKey;
|
||||
final Widget? leading;
|
||||
final Widget? trailing;
|
||||
|
||||
/// Overrides route dismissal while retaining the standard close control.
|
||||
final VoidCallback? onClose;
|
||||
final bool showDragHandle;
|
||||
|
||||
@override
|
||||
@@ -61,7 +65,7 @@ class BuzzSheetHeader extends StatelessWidget {
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: trailing ?? const _SheetCloseButton(),
|
||||
child: trailing ?? _SheetCloseButton(onClose: onClose),
|
||||
),
|
||||
if (leading case final leading?)
|
||||
Align(alignment: Alignment.bottomLeft, child: leading),
|
||||
@@ -73,13 +77,18 @@ class BuzzSheetHeader extends StatelessWidget {
|
||||
}
|
||||
|
||||
class _SheetCloseButton extends StatelessWidget {
|
||||
const _SheetCloseButton();
|
||||
const _SheetCloseButton({this.onClose});
|
||||
final VoidCallback? onClose;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void closeSheet() {
|
||||
unawaited(HapticFeedback.lightImpact());
|
||||
Navigator.of(context).pop();
|
||||
if (onClose != null) {
|
||||
onClose!();
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
}
|
||||
|
||||
if (Theme.of(context).platform == TargetPlatform.iOS) {
|
||||
|
||||
@@ -13,6 +13,7 @@ class BuzzTitledSheetLayout extends HookWidget {
|
||||
required this.child,
|
||||
this.leading,
|
||||
this.trailing,
|
||||
this.onClose,
|
||||
this.titleKey,
|
||||
this.showDragHandle = false,
|
||||
this.surfaceColor,
|
||||
@@ -22,6 +23,9 @@ class BuzzTitledSheetLayout extends HookWidget {
|
||||
final Widget child;
|
||||
final Widget? leading;
|
||||
final Widget? trailing;
|
||||
|
||||
/// Overrides the header close action; null dismisses the current route.
|
||||
final VoidCallback? onClose;
|
||||
final Key? titleKey;
|
||||
final bool showDragHandle;
|
||||
final Color? surfaceColor;
|
||||
@@ -79,6 +83,7 @@ class BuzzTitledSheetLayout extends HookWidget {
|
||||
titleKey: titleKey,
|
||||
leading: leading,
|
||||
trailing: trailing,
|
||||
onClose: onClose,
|
||||
showDragHandle: showDragHandle,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -23,6 +23,7 @@ const buzzModalAnimationStyle = AnimationStyle(
|
||||
/// uses native concentric corners when available and paints a requested drag
|
||||
/// handle inside the shared header so its spacing is consistent on every
|
||||
/// platform.
|
||||
/// Set [padBottom] to false when the content owns its bottom edge spacing.
|
||||
Future<T?> showBuzzModalBottomSheet<T>({
|
||||
required BuildContext context,
|
||||
required WidgetBuilder builder,
|
||||
@@ -42,6 +43,7 @@ Future<T?> showBuzzModalBottomSheet<T>({
|
||||
bool? showDragHandle,
|
||||
bool showCloseButton = true,
|
||||
bool useSafeArea = false,
|
||||
bool padBottom = true,
|
||||
RouteSettings? routeSettings,
|
||||
AnimationController? transitionAnimationController,
|
||||
Offset? anchorPoint,
|
||||
@@ -83,8 +85,9 @@ Future<T?> showBuzzModalBottomSheet<T>({
|
||||
top: false,
|
||||
left: false,
|
||||
right: false,
|
||||
bottom: padBottom,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: Grid.half),
|
||||
padding: EdgeInsets.only(bottom: padBottom ? Grid.half : 0),
|
||||
child: Builder(builder: builder),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user