Post with publish at and until

This commit is contained in:
2024-08-01 15:49:42 +08:00
parent 7655dfdf37
commit c41a71388d
7 changed files with 189 additions and 20 deletions

View File

@@ -82,7 +82,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
setState(() => _isBusy = false);
}
void syncWidget() {
void _syncWidget() {
_editorController.mode.value = widget.mode;
if (widget.edit != null) {
_editorController.editTarget = widget.edit;
@@ -105,7 +105,7 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
void initState() {
super.initState();
_editorController.contentController.addListener(() => setState(() {}));
syncWidget();
_syncWidget();
}
@override
@@ -418,6 +418,25 @@ class _PostPublishScreenState extends State<PostPublishScreen> {
_editorController.editPublishZone(context);
},
),
IconButton(
icon: Obx(() {
return badges.Badge(
showBadge:
_editorController.publishedAt.value != null ||
_editorController.publishedUntil.value !=
null,
position: badges.BadgePosition.topEnd(
top: -4,
end: -6,
),
child: const Icon(Icons.schedule),
);
}),
color: Theme.of(context).colorScheme.primary,
onPressed: () {
_editorController.editPublishDate(context);
},
),
MarkdownToolbar(
hideImage: true,
useIncludedTextField: false,