# theList method Null safety

Widget theList(

1. BuildContext context,
2. dynamic values,
3. AccessState accessState

)

## Implementation

    Widget theList(BuildContext context, values, AccessState accessState) {
      return Container(
          decoration: widget.listBackground == null
              ? StyleRegistry.registry()
                  .styleWithApp(widget.app)
                  .adminListStyle()
                  .boxDecorator(widget.app, context, accessState.getMember())
              : BoxDecorationHelper.boxDecoration(
                  widget.app, accessState.getMember(), widget.listBackground),
          child: ListView.separated(
              separatorBuilder: (context, index) => StyleRegistry.registry()
                  .styleWithApp(widget.app)
                  .adminListStyle()
                  .divider(widget.app, context),
              shrinkWrap: true,
              physics: ScrollPhysics(),
              itemCount: values.length,
              itemBuilder: (context, index) {
                final value = values[index];

                if (widget.widgetProvider != null) {
                  return widget.widgetProvider!(value);
                }

                return DynamicWidgetListItem(
                  app: widget.app,
                  value: value,
    //            app: accessState.app,
                  onDismissed: (direction) {
                    BlocProvider.of<DynamicWidgetListBloc>(context)
                        .add(DeleteDynamicWidgetList(value: value));
                    ScaffoldMessenger.of(context).showSnackBar(DeleteSnackBar(
                      message: "DynamicWidget $value.documentID",
                      onUndo: () =>
                          BlocProvider.of<DynamicWidgetListBloc>(context)
                              .add(AddDynamicWidgetList(value: value)),
                    ));
                  },
                  onTap: () async {
                    final removedItem = await Navigator.of(context).push(
                        pageRouteBuilder(widget.app,
                            page: BlocProvider.value(
                                value: BlocProvider.of<DynamicWidgetListBloc>(
                                    context),
                                child: getForm(value, FormAction.updateAction))));
                    if (removedItem != null) {
                      ScaffoldMessenger.of(context).showSnackBar(
                        DeleteSnackBar(
                          message: "DynamicWidget $value.documentID",
                          onUndo: () =>
                              BlocProvider.of<DynamicWidgetListBloc>(context)
                                  .add(AddDynamicWidgetList(value: value)),
                        ),
                      );
                    }
                  },
                );
              }));
    }