🐛 Bug fixes in posts
This commit is contained in:
parent
060bfa4887
commit
9f8c8923d9
@ -151,6 +151,7 @@ class PostCommentSliverListState extends State<PostCommentSliverList> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
GoRouter.of(context).pushNamed(
|
GoRouter.of(context).pushNamed(
|
||||||
'postDetail',
|
'postDetail',
|
||||||
pathParameters: {'slug': _posts[idx].id.toString()},
|
pathParameters: {'slug': _posts[idx].id.toString()},
|
||||||
@ -225,6 +226,9 @@ class _PostCommentListPopupState extends State<PostCommentListPopup> {
|
|||||||
onPost: () {
|
onPost: () {
|
||||||
_childListKey.currentState!.refresh();
|
_childListKey.currentState!.refresh();
|
||||||
},
|
},
|
||||||
|
onExpand: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1597,39 +1597,30 @@ class _PostContentHeader extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Text(data.publisher.nick).bold(),
|
||||||
child: Text(data.publisher.nick).bold(),
|
|
||||||
),
|
|
||||||
if (data.preload?.realm != null)
|
if (data.preload?.realm != null)
|
||||||
const Icon(Symbols.arrow_right, size: 16)
|
const Icon(Symbols.arrow_right, size: 16)
|
||||||
.padding(horizontal: 2)
|
.padding(horizontal: 2)
|
||||||
.opacity(0.5),
|
.opacity(0.5),
|
||||||
if (data.preload?.realm != null)
|
if (data.preload?.realm != null) Text(data.preload!.realm!.name),
|
||||||
Flexible(
|
|
||||||
child: Text(data.preload!.realm!.name),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Text(
|
||||||
child: Text(
|
'@${data.publisher.name}',
|
||||||
'@${data.publisher.name}',
|
maxLines: 1,
|
||||||
maxLines: 1,
|
).fontSize(13),
|
||||||
).fontSize(13),
|
|
||||||
),
|
|
||||||
const Gap(4),
|
const Gap(4),
|
||||||
Flexible(
|
Text(
|
||||||
child: Text(
|
isRelativeDate
|
||||||
isRelativeDate
|
? RelativeTime(context)
|
||||||
? RelativeTime(context).format(
|
.format((data.publishedAt ?? data.createdAt).toLocal())
|
||||||
(data.publishedAt ?? data.createdAt).toLocal())
|
: DateFormat('y/M/d HH:mm')
|
||||||
: DateFormat('y/M/d HH:mm').format(
|
.format((data.publishedAt ?? data.createdAt).toLocal()),
|
||||||
(data.publishedAt ?? data.createdAt).toLocal()),
|
maxLines: 1,
|
||||||
maxLines: 1,
|
overflow: TextOverflow.fade,
|
||||||
overflow: TextOverflow.fade,
|
).fontSize(13),
|
||||||
).fontSize(13),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
).opacity(0.8),
|
).opacity(0.8),
|
||||||
],
|
],
|
||||||
|
@ -9,6 +9,7 @@ import 'package:styled_widget/styled_widget.dart';
|
|||||||
import 'package:surface/controllers/post_write_controller.dart';
|
import 'package:surface/controllers/post_write_controller.dart';
|
||||||
import 'package:surface/providers/config.dart';
|
import 'package:surface/providers/config.dart';
|
||||||
import 'package:surface/providers/sn_network.dart';
|
import 'package:surface/providers/sn_network.dart';
|
||||||
|
import 'package:surface/screens/post/post_editor.dart';
|
||||||
import 'package:surface/types/post.dart';
|
import 'package:surface/types/post.dart';
|
||||||
import 'package:surface/widgets/account/account_image.dart';
|
import 'package:surface/widgets/account/account_image.dart';
|
||||||
import 'package:surface/widgets/dialog.dart';
|
import 'package:surface/widgets/dialog.dart';
|
||||||
@ -17,8 +18,10 @@ import 'package:surface/widgets/loading_indicator.dart';
|
|||||||
class PostMiniEditor extends StatefulWidget {
|
class PostMiniEditor extends StatefulWidget {
|
||||||
final int? postReplyId;
|
final int? postReplyId;
|
||||||
final Function? onPost;
|
final Function? onPost;
|
||||||
|
final Function? onExpand;
|
||||||
|
|
||||||
const PostMiniEditor({super.key, this.postReplyId, this.onPost});
|
const PostMiniEditor(
|
||||||
|
{super.key, this.postReplyId, this.onPost, this.onExpand});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PostMiniEditor> createState() => _PostMiniEditorState();
|
State<PostMiniEditor> createState() => _PostMiniEditorState();
|
||||||
@ -214,12 +217,16 @@ class _PostMiniEditorState extends State<PostMiniEditor> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
GoRouter.of(context).pushNamed(
|
GoRouter.of(context).pushNamed(
|
||||||
'postEditor',
|
'postEditor',
|
||||||
|
extra: PostEditorExtra(
|
||||||
|
text: _writeController.contentController.text,
|
||||||
|
),
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
if (widget.postReplyId != null)
|
if (widget.postReplyId != null)
|
||||||
'replying': widget.postReplyId.toString(),
|
'replying': widget.postReplyId.toString(),
|
||||||
'mode': 'stories',
|
'mode': 'stories',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
widget.onExpand?.call();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user