mirror of
https://github.com/block/buzz.git
synced 2026-10-29 05:21:31 +00:00
Fill mobile loading views across the screen and use known image, video, voice-note, and file shapes in message placeholders. Freeze each loading cycle’s layout so arriving metadata cannot reshuffle the shimmer just before content appears; preserve cached Home and forum content during reconnects. Validation: mobile analysis and full test suite passed (2,752 passed, 4 skipped), plus 3 unconfigured-push tests and file-size checks. Installed and launched the loading changes on Pixel 10 before the latest main merge. Full `just ci` was stopped during desktop checks due to low disk space. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com>
28 lines
793 B
Dart
28 lines
793 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../theme/theme.dart';
|
|
import 'skeleton.dart';
|
|
|
|
/// Fills the attachment's reserved geometry until its first frame is ready.
|
|
class MediaLoadingPlaceholder extends StatelessWidget {
|
|
final String label;
|
|
|
|
const MediaLoadingPlaceholder({required this.label, super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Semantics(
|
|
label: label,
|
|
child: LayoutBuilder(
|
|
builder: (context, constraints) => SkeletonShimmer(
|
|
child: SkeletonBar(
|
|
width: constraints.hasBoundedWidth ? constraints.maxWidth : 240,
|
|
height: constraints.hasBoundedHeight ? constraints.maxHeight : 180,
|
|
borderRadius: BorderRadius.circular(Radii.md),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|