widget method

Widget widget(
  1. BuildContext context
)
override

Implementation

widget(context) {
  switch (type) {
    case NikuListViewType.children:
      return ListView(
        key: key,
        scrollDirection: scrollDirection ?? Axis.vertical,
        reverse: reverse ?? false,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: _shrinkWrap ?? false,
        padding: padding?.value,
        itemExtent: itemExtent,
        prototypeItem: prototypeItem,
        addAutomaticKeepAlives: addAutomaticKeepAlives ?? true,
        addRepaintBoundaries: addRepaintBoundaries ?? true,
        addSemanticIndexes: addSemanticIndexes ?? true,
        cacheExtent: cacheExtent,
        children: children ?? [],
        semanticChildCount: semanticChildCount,
        dragStartBehavior: dragStartBehavior ?? DragStartBehavior.start,
        keyboardDismissBehavior: keyboardDismissBehavior ??
            ScrollViewKeyboardDismissBehavior.manual,
        restorationId: restorationId,
        clipBehavior: clipBehavior ?? Clip.hardEdge,
      );

    case NikuListViewType.builder:
      return ListView.builder(
        key: key,
        scrollDirection: scrollDirection ?? Axis.vertical,
        reverse: reverse ?? false,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: _shrinkWrap ?? false,
        padding: padding?.value,
        itemExtent: itemExtent,
        prototypeItem: prototypeItem,
        itemBuilder: itemBuilder!,
        itemCount: itemCount,
        addAutomaticKeepAlives: addAutomaticKeepAlives ?? true,
        addRepaintBoundaries: addRepaintBoundaries ?? true,
        addSemanticIndexes: addSemanticIndexes ?? true,
        cacheExtent: cacheExtent,
        semanticChildCount: semanticChildCount,
        dragStartBehavior: dragStartBehavior ?? DragStartBehavior.start,
        keyboardDismissBehavior: keyboardDismissBehavior ??
            ScrollViewKeyboardDismissBehavior.manual,
        restorationId: restorationId,
        clipBehavior: clipBehavior ?? Clip.hardEdge,
      );

    case NikuListViewType.separated:
      return ListView.separated(
        key: key,
        scrollDirection: scrollDirection ?? Axis.vertical,
        reverse: reverse ?? false,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: _shrinkWrap ?? false,
        padding: padding?.value,
        itemBuilder: itemBuilder!,
        separatorBuilder: separatorBuilder!,
        itemCount: itemCount ?? 0,
        addAutomaticKeepAlives: addAutomaticKeepAlives ?? true,
        addRepaintBoundaries: addRepaintBoundaries ?? true,
        addSemanticIndexes: addSemanticIndexes ?? true,
        cacheExtent: cacheExtent,
        dragStartBehavior: dragStartBehavior ?? DragStartBehavior.start,
        keyboardDismissBehavior: keyboardDismissBehavior ??
            ScrollViewKeyboardDismissBehavior.manual,
        restorationId: restorationId,
        clipBehavior: clipBehavior ?? Clip.hardEdge,
      );

    case NikuListViewType.custom:
      return ListView.custom(
        key: key,
        scrollDirection: scrollDirection ?? Axis.vertical,
        reverse: reverse ?? false,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: _shrinkWrap ?? false,
        padding: padding?.value,
        itemExtent: itemExtent,
        prototypeItem: prototypeItem,
        childrenDelegate: childrenDelegate!,
        cacheExtent: cacheExtent,
        semanticChildCount: semanticChildCount,
        dragStartBehavior: dragStartBehavior ?? DragStartBehavior.start,
        keyboardDismissBehavior: keyboardDismissBehavior ??
            ScrollViewKeyboardDismissBehavior.manual,
        restorationId: restorationId,
        clipBehavior: clipBehavior ?? Clip.hardEdge,
      );

    default:
      return ListView(
        key: key,
        scrollDirection: scrollDirection ?? Axis.vertical,
        reverse: reverse ?? false,
        controller: controller,
        primary: primary,
        physics: physics,
        shrinkWrap: _shrinkWrap ?? false,
        padding: padding?.value,
        itemExtent: itemExtent,
        prototypeItem: prototypeItem,
        addAutomaticKeepAlives: addAutomaticKeepAlives ?? true,
        addRepaintBoundaries: addRepaintBoundaries ?? true,
        addSemanticIndexes: addSemanticIndexes ?? true,
        cacheExtent: cacheExtent,
        children: children ?? [],
        semanticChildCount: semanticChildCount,
        dragStartBehavior: dragStartBehavior ?? DragStartBehavior.start,
        keyboardDismissBehavior: keyboardDismissBehavior ??
            ScrollViewKeyboardDismissBehavior.manual,
        restorationId: restorationId,
        clipBehavior: clipBehavior ?? Clip.hardEdge,
      );
  }
}