Reload after post

This commit is contained in:
LittleSheep 2024-03-24 12:32:24 +08:00
parent eb01942e2d
commit cba4f19b17
4 changed files with 16 additions and 7 deletions

View File

@ -84,7 +84,9 @@ class _ExploreScreenState extends State<ExploreScreen> {
return FloatingActionButton(
child: const Icon(Icons.edit),
onPressed: () {
router.push("/post/moments");
router.push("/post/moments").then((value) {
if (value == true) paginationController.refresh();
});
},
);
} else {

View File

@ -51,7 +51,7 @@ class _CommentEditorScreenState extends State<CommentEditorScreen> {
);
} else {
if (router.canPop()) {
router.pop();
router.pop(true);
}
}
setState(() => isSubmitting = false);
@ -105,7 +105,8 @@ class _CommentEditorScreenState extends State<CommentEditorScreen> {
keyboardType: TextInputType.multiline,
controller: contentController,
decoration: const InputDecoration.collapsed(
hintText: "What do you want to say?"),
hintText: "What do you want to say?",
),
),
),
),

View File

@ -41,7 +41,7 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
);
} else {
if (router.canPop()) {
router.pop();
router.pop(true);
}
}
setState(() => isSubmitting = false);
@ -95,7 +95,8 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
keyboardType: TextInputType.multiline,
controller: contentController,
decoration: const InputDecoration.collapsed(
hintText: "What\'s happened?!"),
hintText: "What's happened?!",
),
),
),
),
@ -108,7 +109,8 @@ class _MomentEditorScreenState extends State<MomentEditorScreen> {
snapshot.data?.getBool(
"editor.hide_website_recommendation") ==
null) {
snapshot.data?.remove("editor.hide_website_recommendation");
snapshot.data
?.remove("editor.hide_website_recommendation");
return MaterialBanner(
padding: const EdgeInsets.all(20),
content: const Text(

View File

@ -92,7 +92,11 @@ class _CommentListWidgetState extends State<CommentListWidget> {
icon: const Icon(Icons.edit),
label: const Text("LEAVE COMMENT"),
onPressed: () {
router.push("/post/comments", extra: widget.parent);
router
.push("/post/comments", extra: widget.parent)
.then((value) {
if (value == true) paginationController.refresh();
});
},
);
} else {