mirror of
https://github.com/block/buzz.git
synced 2026-11-28 04:01:45 +00:00
## 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>
67 lines
2.0 KiB
Dart
67 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// A fixed-size conversation identity with up to four distinct portraits.
|
|
class DmHeaderCluster extends StatelessWidget {
|
|
const DmHeaderCluster({
|
|
super.key,
|
|
required this.count,
|
|
required this.builder,
|
|
});
|
|
|
|
static const diameter = 64.0;
|
|
|
|
final int count;
|
|
final Widget Function(int index, double size) builder;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (count == 0) return const SizedBox.shrink();
|
|
if (count == 1) {
|
|
return SizedBox.square(dimension: diameter, child: builder(0, diameter));
|
|
}
|
|
// Centers and diameters are fractions of the 60pt inner circle.
|
|
final positions = switch (count) {
|
|
2 => [(0.355, 0.355, 0.58), (0.709, 0.709, 0.38)],
|
|
3 => [(0.360, 0.340, 0.50), (0.380, 0.780, 0.34), (0.736, 0.622, 0.40)],
|
|
_ => [
|
|
(0.350, 0.340, 0.50),
|
|
(0.745, 0.340, 0.25),
|
|
(0.350, 0.760, 0.30),
|
|
(0.706, 0.678, 0.39),
|
|
],
|
|
};
|
|
final theme = Theme.of(context);
|
|
final inverse = theme.brightness == Brightness.dark
|
|
? Colors.white
|
|
: Colors.black;
|
|
return DecoratedBox(
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
border: Border.all(
|
|
color: inverse.withValues(alpha: 0.07),
|
|
width: 1,
|
|
strokeAlign: BorderSide.strokeAlignOutside,
|
|
),
|
|
),
|
|
child: ClipOval(
|
|
child: ColoredBox(
|
|
color: theme.scaffoldBackgroundColor,
|
|
child: SizedBox.square(
|
|
dimension: diameter,
|
|
child: Stack(
|
|
children: [
|
|
for (var i = 0; i < positions.length; i++)
|
|
Positioned(
|
|
left: 2 + 60 * (positions[i].$1 - positions[i].$3 / 2),
|
|
top: 2 + 60 * (positions[i].$2 - positions[i].$3 / 2),
|
|
child: builder(i, 60 * positions[i].$3),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|