mirror of
https://github.com/block/buzz.git
synced 2026-11-03 16:01:35 +00:00
Updates mobile toast animations and styling. | Sign in | Retry | Copied | | --- | --- | --- | |  |  |  | --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
36 lines
1023 B
Dart
36 lines
1023 B
Dart
part of 'buzz_toast.dart';
|
|
|
|
/// Parent-owned persistent feedback with the same motion as transient toasts.
|
|
class ReconnectCapsule extends HookWidget {
|
|
const ReconnectCapsule({
|
|
super.key,
|
|
required this.onSignIn,
|
|
this.visible = true,
|
|
this.islandOrigin,
|
|
this.islandSpeed = 0.75,
|
|
});
|
|
|
|
final VoidCallback onSignIn;
|
|
final bool visible;
|
|
final Rect? islandOrigin;
|
|
final double islandSpeed;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final transientVisible = useValueListenable(_toastCoordinator(context));
|
|
// Remove immediately so neither text nor island surfaces overlap.
|
|
// Remounting after dismissal restarts the persistent entrance if needed.
|
|
if (transientVisible) return const SizedBox.shrink();
|
|
return _ToastBubble(
|
|
message: 'Reconnect to Builderlab',
|
|
actionLabel: 'Sign in',
|
|
onRetry: onSignIn,
|
|
onDismiss: () {},
|
|
persistent: true,
|
|
visible: visible,
|
|
islandOrigin: islandOrigin,
|
|
islandSpeed: islandSpeed,
|
|
);
|
|
}
|
|
}
|