build method

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

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

Implementation

@override
Widget build(BuildContext context, vf.Route content) {
  final first =
      content.regions.expand((element) => element.items).firstOrNull;

  final child =
      first == null ? vf.empty : vyuh.content.buildContent(context, first);

  return vf.RouteScaffold(
    content: content,
    appBar: showAppBar
        ? AppBar(
            title: Text(content.title),
            actions: actions
                ?.map(
                  (e) => IconButton(
                      onPressed: () => e.action?.execute(context),
                      icon: Icon(e.icon.iconData)),
                )
                .toList(growable: false),
          )
        : null,
    useSafeArea: useSafeArea,
    body: child,
  );
}