mobile bluesky app made with flutter
lazurite.stormlightlabs.org/
mobile
bluesky
flutter
1import 'package:flutter/material.dart';
2import 'package:lazurite/src/features/thread/domain/thread.dart';
3
4/// Displays reply restriction information when a threadgate is present.
5class ThreadgateIndicator extends StatelessWidget {
6 const ThreadgateIndicator({required this.threadgate, super.key});
7
8 final Threadgate threadgate;
9
10 @override
11 Widget build(BuildContext context) {
12 final theme = Theme.of(context);
13 final colorScheme = theme.colorScheme;
14
15 return Semantics(
16 label: 'Reply restriction: ${threadgate.restrictionDescription}',
17 child: Tooltip(
18 message: threadgate.restrictionDescription,
19 child: Container(
20 padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
21 decoration: BoxDecoration(
22 color: colorScheme.secondaryContainer.withValues(alpha: 0.5),
23 borderRadius: BorderRadius.circular(12),
24 ),
25 child: Row(
26 mainAxisSize: MainAxisSize.min,
27 children: [
28 Icon(Icons.lock_outline, size: 14, color: colorScheme.onSecondaryContainer),
29 const SizedBox(width: 4),
30 Flexible(
31 child: Text(
32 threadgate.restrictionDescription,
33 style: theme.textTheme.labelSmall?.copyWith(
34 color: colorScheme.onSecondaryContainer,
35 ),
36 overflow: TextOverflow.ellipsis,
37 ),
38 ),
39 ],
40 ),
41 ),
42 ),
43 );
44 }
45}