build method

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

Builds the layout for the content item. This transforms the content into a Flutter Widget.

Implementation

@override
Widget build(BuildContext context, vt.RouteBase content) {
  final layout = content.layout as TabsRouteLayout;

  return RouteContainer(
    content: content,
    child: DefaultTabController(
      length: layout.routes.length,
      child: Scaffold(
        appBar: AppBar(
          toolbarHeight: 0,
          bottom: TabBar(
            tabs: layout.routes
                .map((e) => Tab(
                      text: e.title,
                      icon: e.title == null
                          ? const Icon((Icons.question_mark))
                          : null,
                    ))
                .toList(growable: false),
          ),
        ),
        body: TabBarView(
          children: layout.routes
              .map((e) =>
                  vyuh.content.buildRoute(context, routeId: e.route.ref))
              .toList(growable: false),
        ),
      ),
    ),
  );
}