import 'package:flutter/material.dart';

class ListViewWidget extends StatelessWidget {
  final Widget Function(int) childBuilder;
  final int itemCount;
  final ScrollPhysics? physics;
  final Axis? scrollDirection;
  final ScrollController? scrollController;
  final double? itemExtent;
  final EdgeInsetsGeometry? padding;
  const ListViewWidget(
      {super.key,
      required this.itemCount,
      required this.childBuilder,
      this.itemExtent,
      this.physics,
      this.scrollDirection,
      this.scrollController,
      this.padding});

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
        padding: padding,
        itemExtent: itemExtent,
        controller: scrollController,
        scrollDirection: scrollDirection ?? Axis.vertical,
        physics: physics ?? const NeverScrollableScrollPhysics(),
        itemCount: itemCount,
        shrinkWrap: true,
        itemBuilder: (BuildContext context, index) {
          return childBuilder(index);
        });
  }
}
