replace route instead of pushing
This commit is contained in:
parent
15ebfb6caa
commit
bc736eb6aa
|
@ -169,7 +169,7 @@ class CreatePost extends HookWidget {
|
|||
name: titleController.text,
|
||||
communityId: selectedCommunity.value.id,
|
||||
auth: token.raw);
|
||||
goTo(context, (_) => FullPostPage.fromPostView(res));
|
||||
goToReplace(context, (_) => FullPostPage.fromPostView(res));
|
||||
return;
|
||||
// ignore: avoid_catches_without_on_clauses
|
||||
} catch (e) {
|
||||
|
|
|
@ -14,6 +14,14 @@ Future<dynamic> goTo(
|
|||
builder: builder,
|
||||
));
|
||||
|
||||
Future<dynamic> goToReplace(
|
||||
BuildContext context,
|
||||
Widget Function(BuildContext context) builder,
|
||||
) =>
|
||||
Navigator.of(context).pushReplacement(CupertinoPageRoute(
|
||||
builder: builder,
|
||||
));
|
||||
|
||||
void goToInstance(BuildContext context, String instanceUrl) =>
|
||||
goTo(context, (context) => InstancePage(instanceUrl: instanceUrl));
|
||||
|
||||
|
|
Loading…
Reference in New Issue