mirror of
https://github.com/block/buzz.git
synced 2026-11-27 19:52:31 +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>
85 lines
2.1 KiB
Dart
85 lines
2.1 KiB
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import '../theme/buzz_icons.dart';
|
|
import '../theme/theme.dart';
|
|
|
|
class SectionHeadingLabel extends StatelessWidget {
|
|
const SectionHeadingLabel({
|
|
super.key,
|
|
required this.label,
|
|
required this.expanded,
|
|
this.icon,
|
|
});
|
|
final bool expanded;
|
|
final String label;
|
|
final Widget? icon;
|
|
|
|
@override
|
|
Widget build(BuildContext context) => Row(
|
|
children: [
|
|
?icon,
|
|
Flexible(
|
|
child: Text(
|
|
label,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: navigationBucketHeadingStyle(context),
|
|
),
|
|
),
|
|
SectionStateChevron(key: ValueKey(label), expanded: expanded),
|
|
],
|
|
);
|
|
}
|
|
|
|
/// Briefly indicates the new disclosure state without shifting the title.
|
|
class SectionStateChevron extends StatefulWidget {
|
|
const SectionStateChevron({super.key, required this.expanded});
|
|
|
|
final bool expanded;
|
|
|
|
@override
|
|
State<SectionStateChevron> createState() => _SectionStateChevronState();
|
|
}
|
|
|
|
class _SectionStateChevronState extends State<SectionStateChevron> {
|
|
Timer? _hide;
|
|
late bool _visible = !widget.expanded;
|
|
|
|
@override
|
|
void didUpdateWidget(SectionStateChevron oldWidget) {
|
|
super.didUpdateWidget(oldWidget);
|
|
if (widget.expanded == oldWidget.expanded) return;
|
|
_visible = true;
|
|
_hide?.cancel();
|
|
if (!widget.expanded) return;
|
|
_hide = Timer(const Duration(milliseconds: 900), () {
|
|
setState(() => _visible = false);
|
|
});
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_hide?.cancel();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) => ExcludeSemantics(
|
|
child: Padding(
|
|
padding: const EdgeInsetsDirectional.only(start: Grid.quarter),
|
|
child: AnimatedOpacity(
|
|
opacity: _visible ? 1 : 0,
|
|
duration: MediaQuery.disableAnimationsOf(context)
|
|
? Duration.zero
|
|
: Duration(milliseconds: _visible ? 120 : 180),
|
|
child: Icon(
|
|
widget.expanded ? BuzzIcons.chevronDown : BuzzIcons.chevronRight,
|
|
size: 14,
|
|
color: navigationAccessoryForeground(context),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|