💄 Optimize poll
This commit is contained in:
@@ -186,10 +186,9 @@ class ComposePollSheet extends HookConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget? _buildPollSubtitle(SnPoll poll) {
|
||||
Widget? _buildPollSubtitle(SnPollWithStats poll) {
|
||||
try {
|
||||
final SnPoll dyn = poll;
|
||||
final List<SnPollQuestion> options = dyn.questions;
|
||||
final List<SnPollQuestion> options = poll.questions;
|
||||
if (options.isEmpty) return null;
|
||||
final preview = options.take(3).map((e) => e.title).join(' · ');
|
||||
if (preview.trim().isEmpty) return null;
|
||||
|
@@ -354,6 +354,7 @@ class PostItem extends HookConsumerWidget {
|
||||
final translatedWidget =
|
||||
(translatedText.value?.isNotEmpty ?? false)
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
@@ -398,6 +399,7 @@ class PostItem extends HookConsumerWidget {
|
||||
: null;
|
||||
|
||||
final translationSection = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
if (translatedWidget != null) translatedWidget,
|
||||
if (translatableWidget != null) translatableWidget,
|
||||
|
@@ -639,13 +639,18 @@ class PostBody extends ConsumerWidget {
|
||||
if (!isFullPost && item.type == 1)
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.surfaceContainerHigh,
|
||||
border: Border.all(
|
||||
color: Theme.of(context).dividerColor.withOpacity(0.5),
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
margin: const EdgeInsets.only(top: 4),
|
||||
margin: EdgeInsets.only(
|
||||
top: 4,
|
||||
left: renderingPadding.horizontal,
|
||||
right: renderingPadding.vertical,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
|
Reference in New Issue
Block a user