horizontal_list_view 1.0.4 copy "horizontal_list_view: ^1.0.4" to clipboard
horizontal_list_view: ^1.0.4 copied to clipboard

Simple horizontal list view widget for displaying a list of items in a horizontal layout with fixed crosAxisCount.

horizontal_list_view Pub #

Simple and customizable horizontal list view widget for displaying a list of items in a horizontal layout. This package is designed to simplify the creation of horizontal lists with a specified crossAxisCount without the need to provide a fixed height for the ListView.

Preview example

Installing #

Add to pubspec.yaml file

dependencies:
  horizontal_list_view: ^1.0.4

import

import 'package:horizontal_list_view/horizontal_list_view.dart';

Usage #

Code example #

import 'package:horizontal_list_view/horizontal_list_view.dart';

HorizontalListView(
    crossAxisCount: 3, // Number of items displayed per row.
    crossAxisSpacing: 16, // Spacing between items in the same row.
    controller: HorizontalListViewController(), // Optional scroll controller.
    itemCount: 12, // Total number of items in the list.
    itemBuilder: (BuildContext context, int index) {
        // Create and return the widgets for each item.
        return AspectRatio(
            aspectRatio: 16 / 9,
            child: Container(
                color: Colors.red,
                child: Center(
                    child: Text('item: $index'),
                ),
            ),
        );
    },
)
8
likes
160
points
57
downloads

Publisher

verified publisherflameark.com

Weekly Downloads

Simple horizontal list view widget for displaying a list of items in a horizontal layout with fixed crosAxisCount.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on horizontal_list_view