build method

  1. @override
Widget build(
  1. BuildContext context,
  2. RouteBase content
)
override

Builds the layout widget tree for the given content item.

This method is called by the content system to render the content item with the specified layout.

Implementation

@override
Widget build(BuildContext context, vt.RouteBase content) {
  return DefaultTabController(
    length: routes.length,
    child: Scaffold(
      appBar: AppBar(
        toolbarHeight: 0,
        bottom: TabBar(
          tabs: routes
              .map((e) => Tab(
                    text: e.title,
                    icon: e.title == null
                        ? const Icon((Icons.question_mark))
                        : null,
                  ))
              .toList(growable: false),
        ),
      ),
      body: TabBarView(
        children: routes
            .map((e) => VyuhBinding.instance.content
                .buildRoute(context, routeId: e.route.ref))
            .toList(growable: false),
      ),
    ),
  );
}