💄 Better ui
This commit is contained in:
parent
8dbf6ff4f3
commit
a6d8e2e311
@ -56,10 +56,6 @@ class _ArticleDetailScreenState extends State<ArticleDetailScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: const Divider(thickness: 0.3, height: 1)
|
||||
.paddingOnly(top: 4),
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: SizedBox(height: MediaQuery.of(context).padding.bottom),
|
||||
),
|
||||
|
@ -5,7 +5,7 @@ import 'package:solian/models/articles.dart';
|
||||
import 'package:solian/widgets/account/account_avatar.dart';
|
||||
import 'package:solian/widgets/account/account_profile_popup.dart';
|
||||
import 'package:solian/widgets/articles/article_quick_action.dart';
|
||||
import 'package:solian/widgets/feed/feed_content.dart';
|
||||
import 'package:solian/widgets/markdown_text_content.dart';
|
||||
import 'package:solian/widgets/feed/feed_tags.dart';
|
||||
import 'package:timeago/timeago.dart' show format;
|
||||
|
||||
@ -179,15 +179,11 @@ class _ArticleItemState extends State<ArticleItem> {
|
||||
right: 16,
|
||||
left: 16,
|
||||
),
|
||||
const Divider(thickness: 0.3, height: 0.3).paddingSymmetric(
|
||||
vertical: 10,
|
||||
),
|
||||
FeedContent(content: item.content).paddingSymmetric(
|
||||
horizontal: 20,
|
||||
),
|
||||
const Divider(thickness: 0.3, height: 0.3).paddingOnly(
|
||||
MarkdownTextContent(content: item.content).paddingOnly(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 10,
|
||||
bottom: 6,
|
||||
bottom: 8,
|
||||
),
|
||||
buildFooter().paddingOnly(left: 20),
|
||||
if (widget.isReactable)
|
||||
|
@ -24,11 +24,11 @@ class ArticleListWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PagedSliverList<int, Article>.separated(
|
||||
addRepaintBoundaries: true,
|
||||
pagingController: controller,
|
||||
builderDelegate: PagedChildBuilderDelegate<Article>(
|
||||
itemBuilder: (context, item, index) {
|
||||
return RepaintBoundary(
|
||||
child: CenteredContainer(
|
||||
return CenteredContainer(
|
||||
child: ArticleListEntryWidget(
|
||||
isClickable: isClickable,
|
||||
item: item,
|
||||
@ -36,7 +36,6 @@ class ArticleListWidget extends StatelessWidget {
|
||||
controller.refresh();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -102,8 +102,7 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
}
|
||||
|
||||
Widget buildEntry(Attachment element, int idx) {
|
||||
return RepaintBoundary(
|
||||
child: GestureDetector(
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
width: widget.width ?? MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
@ -176,7 +175,6 @@ class _AttachmentListState extends State<AttachmentList> {
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,6 @@ class ChatEventList extends StatelessWidget {
|
||||
final item = chatController.currentEvents[index].data;
|
||||
|
||||
return InkWell(
|
||||
child: RepaintBoundary(
|
||||
child: ChatEvent(
|
||||
key: Key('m${item.uuid}'),
|
||||
item: item,
|
||||
@ -66,7 +65,6 @@ class ChatEventList extends StatelessWidget {
|
||||
top: !isMerged ? 8 : 0,
|
||||
bottom: !hasMerged ? 8 : 0,
|
||||
),
|
||||
),
|
||||
onLongPress: () {
|
||||
showModalBottomSheet(
|
||||
useRootNavigator: true,
|
||||
|
@ -1,12 +1,10 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/models/event.dart';
|
||||
import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
import 'package:markdown/markdown.dart' as markdown;
|
||||
import 'package:solian/widgets/markdown_text_content.dart';
|
||||
|
||||
class ChatEventMessage extends StatelessWidget {
|
||||
final Event item;
|
||||
@ -44,28 +42,7 @@ class ChatEventMessage extends StatelessWidget {
|
||||
final body = EventMessageBody.fromJson(item.body);
|
||||
final hasAttachment = body.attachments?.isNotEmpty ?? false;
|
||||
|
||||
return Markdown(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
data: body.text,
|
||||
selectable: true,
|
||||
padding: const EdgeInsets.all(0),
|
||||
extensionSet: markdown.ExtensionSet(
|
||||
markdown.ExtensionSet.gitHubFlavored.blockSyntaxes,
|
||||
<markdown.InlineSyntax>[
|
||||
markdown.EmojiSyntax(),
|
||||
markdown.AutolinkExtensionSyntax(),
|
||||
...markdown.ExtensionSet.gitHubFlavored.inlineSyntaxes
|
||||
],
|
||||
),
|
||||
onTapLink: (text, href, title) async {
|
||||
if (href == null) return;
|
||||
await launchUrlString(
|
||||
href,
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
).paddingOnly(
|
||||
return MarkdownTextContent(content: body.text).paddingOnly(
|
||||
left: isQuote ? 0 : 12,
|
||||
right: isQuote ? 0 : 12,
|
||||
top: body.quoteEvent == null ? 2 : 0,
|
||||
|
@ -24,11 +24,11 @@ class FeedListWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PagedSliverList<int, FeedRecord>.separated(
|
||||
addRepaintBoundaries: true,
|
||||
pagingController: controller,
|
||||
builderDelegate: PagedChildBuilderDelegate<FeedRecord>(
|
||||
itemBuilder: (context, item, index) {
|
||||
return RepaintBoundary(
|
||||
child: CenteredContainer(
|
||||
return CenteredContainer(
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
switch (item.type) {
|
||||
@ -57,7 +57,6 @@ class FeedListWidget extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
@ -3,10 +3,10 @@ import 'package:flutter_markdown/flutter_markdown.dart';
|
||||
import 'package:markdown/markdown.dart' as markdown;
|
||||
import 'package:url_launcher/url_launcher_string.dart';
|
||||
|
||||
class FeedContent extends StatelessWidget {
|
||||
class MarkdownTextContent extends StatelessWidget {
|
||||
final String content;
|
||||
|
||||
const FeedContent({super.key, required this.content});
|
||||
const MarkdownTextContent({super.key, required this.content});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -15,6 +15,16 @@ class FeedContent extends StatelessWidget {
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
data: content,
|
||||
padding: EdgeInsets.zero,
|
||||
styleSheet: MarkdownStyleSheet.fromTheme(Theme.of(context)).copyWith(
|
||||
horizontalRuleDecoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
width: 1.0,
|
||||
color: Theme.of(context).dividerColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
extensionSet: markdown.ExtensionSet(
|
||||
markdown.ExtensionSet.gitHubFlavored.blockSyntaxes,
|
||||
<markdown.InlineSyntax>[
|
@ -7,7 +7,7 @@ import 'package:solian/router.dart';
|
||||
import 'package:solian/widgets/account/account_avatar.dart';
|
||||
import 'package:solian/widgets/account/account_profile_popup.dart';
|
||||
import 'package:solian/widgets/attachments/attachment_list.dart';
|
||||
import 'package:solian/widgets/feed/feed_content.dart';
|
||||
import 'package:solian/widgets/markdown_text_content.dart';
|
||||
import 'package:solian/widgets/feed/feed_tags.dart';
|
||||
import 'package:solian/widgets/posts/post_quick_action.dart';
|
||||
import 'package:timeago/timeago.dart' show format;
|
||||
@ -190,7 +190,7 @@ class _PostItemState extends State<PostItem> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
buildHeader().paddingSymmetric(horizontal: 12),
|
||||
FeedContent(content: item.content).paddingOnly(
|
||||
MarkdownTextContent(content: item.content).paddingOnly(
|
||||
left: 16,
|
||||
right: 12,
|
||||
top: 2,
|
||||
@ -231,7 +231,7 @@ class _PostItemState extends State<PostItem> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
buildHeader(),
|
||||
FeedContent(content: item.content)
|
||||
MarkdownTextContent(content: item.content)
|
||||
.paddingOnly(left: 12, right: 8),
|
||||
if (widget.item.replyTo != null && widget.isShowEmbed)
|
||||
GestureDetector(
|
||||
@ -275,7 +275,7 @@ class _PostItemState extends State<PostItem> {
|
||||
attachmentsId: item.attachments ?? List.empty(),
|
||||
divided: true,
|
||||
),
|
||||
if (!widget.isShowReply && widget.isReactable)
|
||||
if (widget.isShowReply && widget.isReactable)
|
||||
PostQuickAction(
|
||||
isShowReply: widget.isShowReply,
|
||||
isReactable: widget.isReactable,
|
||||
|
@ -24,11 +24,11 @@ class PostListWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return PagedSliverList<int, Post>.separated(
|
||||
addRepaintBoundaries: true,
|
||||
pagingController: controller,
|
||||
builderDelegate: PagedChildBuilderDelegate<Post>(
|
||||
itemBuilder: (context, item, index) {
|
||||
return RepaintBoundary(
|
||||
child: CenteredContainer(
|
||||
return CenteredContainer(
|
||||
child: PostListEntryWidget(
|
||||
isShowEmbed: isShowEmbed,
|
||||
isNestedClickable: isNestedClickable,
|
||||
@ -38,7 +38,6 @@ class PostListWidget extends StatelessWidget {
|
||||
controller.refresh();
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user