Files
buzz/mobile/lib/shared/widgets/navigation_button_surface.dart
klopez4212 8cc7e94392 Refine mobile Messages sections, Duo navigation, and chat typography (#9885)
## Summary

- Organize mobile Messages into configurable flat sections. See All
keeps the list and its search position when opening a conversation, and
supports side-by-side browsing on an unfolded Duo.
- Use the same 16-point Messages gutter in booklet and open Duo layouts.
The regular iPhone uses 20 points. Align navigation actions and use
native inline titles on See All.
- Update mobile typography and spacing across chat rows, message
bubbles, drafts, and the composer. Render code proportionally to the
17-point message body.

## Device review

Compare the leading edges of the section headings and channel icons in
Messages on the open Duo and in booklet mode. Open See All and check
that its rows follow the same column.

---------

Signed-off-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
2026-11-23 13:14:05 -08:00

72 lines
2.0 KiB
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../theme/theme.dart';
import 'concentric_sheet_surface.dart';
/// Native iOS glass with an opaque Material capsule on other platforms.
class NavigationButtonSurface extends StatelessWidget {
const NavigationButtonSurface({
required this.child,
this.capsule = false,
this.backgroundColor,
super.key,
});
final Widget child;
/// Optional Material background; native iOS glass retains its own treatment.
final Color? backgroundColor;
/// Uses fully rounded ends instead of device-concentric corners.
final bool capsule;
@override
Widget build(BuildContext context) {
if (NavigationGlassGroup.maybeOf(context)) return child;
if (defaultTargetPlatform != TargetPlatform.iOS) {
return Material(
color: backgroundColor ?? context.controlSurface,
shape: const StadiumBorder(),
clipBehavior: Clip.antiAlias,
child: child,
);
}
return ConcentricSheetSurface(
enabled: true,
usesGlass: true,
capsule: capsule,
providesSheetSurface: false,
padding: EdgeInsets.zero,
minimumRadius: Radii.navigationCapsule,
contentClipRadius: capsule ? 9999 : Radii.navigationCapsule,
child: child,
);
}
}
/// Uses the shared native navigation glass instead of a separate surface.
class NavigationGlassGroup extends InheritedWidget {
const NavigationGlassGroup({
super.key,
required super.child,
this.diameter = 56,
});
final double diameter;
static double diameterOf(BuildContext context) =>
context
.dependOnInheritedWidgetOfExactType<NavigationGlassGroup>()
?.diameter ??
56;
static bool maybeOf(BuildContext context) =>
context.dependOnInheritedWidgetOfExactType<NavigationGlassGroup>() !=
null;
@override
bool updateShouldNotify(NavigationGlassGroup oldWidget) =>
diameter != oldWidget.diameter;
}