toWidget method

  1. @override
Widget toWidget(
  1. AnyWidgetContext context
)
override

Implementation

@override
Widget toWidget(AnyWidgetContext context) {
  return map(
    (value) => Scaffold(
      key: value.key?.toFlutter(context),
      body: value.body?.toWidget(context),
      floatingActionButton: value.floatingActionButton?.toWidget(context),
      persistentFooterButtons:
          value.persistentFooterButtons?.getChildren(context),
      appBar: value.appBar?.toWidget(context) as PreferredSizeWidget?,
      drawer: value.drawer?.toWidget(context),
      endDrawer: value.endDrawer?.toWidget(context),
      bottomNavigationBar: value.bottomNavigationBar?.toWidget(context),
      bottomSheet: value.bottomSheet?.toWidget(context),
      backgroundColor: value.backgroundColor?.toFlutter(context),
      resizeToAvoidBottomInset: value.resizeToAvoidBottomInset,
      primary: value.primary ?? true,
      extendBody: value.extendBody ?? false,
      extendBodyBehindAppBar: value.extendBodyBehindAppBar ?? false,
      drawerScrimColor: value.drawerScrimColor?.toFlutter(context),
      drawerEdgeDragWidth: value.drawerEdgeDragWidth,
      drawerEnableOpenDragGesture: value.drawerEnableOpenDragGesture ?? true,
      endDrawerEnableOpenDragGesture:
          value.endDrawerEnableOpenDragGesture ?? true,
      restorationId: value.restorationId,
    ),
    openDrawer: (_) => throw StateError('Should never happen'),
    openEndDrawer: (_) => throw StateError('Should never happen'),
    showBodyScrim: (_) => throw StateError('Should never happen'),
    showBottomSheet: (_) => throw StateError('Should never happen'),
  );
}