build method

  1. @override
Widget build(
  1. BuildContext _,
  2. GoRouterState __
)
override

Creates the Widget for this route.

Subclasses must override one of build, buildPage, or redirect.

Corresponds to GoRoute.builder.

Implementation

@override
Widget build(_, __) {
  // If there is no id (i.e. path is '/post'), move to createPost
  if (edit == true) return const CreatePostPage();
  return PostPage(id: id);
}