Skip to content

As a Flutter Developer, one common issue we encounter is related to horizontal lists. Sometimes, it becomes challenging to maintain dynamic item heights within such lists. However, I have a solution that I'd like to share. By using this code, the horizontal list should now have dynamically sized items, making it more flexible to accommodate various

License

Notifications You must be signed in to change notification settings

shahi5472/Custom-Horizontal-ListView

Repository files navigation

Features

As a Flutter Developer, one common issue we encounter is related to horizontal lists. Sometimes, it becomes challenging to maintain dynamic item heights within such lists. However, I have a solution that I'd like to share. By using this code, the horizontal list should now have dynamically sized items, making it more flexible to accommodate various content heights.

Import it

Now in your Dart code, you can use:

import 'package:custom_horizontal_list_view/custom_horizontal_list_view.dart';

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  custom_horizontal_list_view: ^1.0.0

Example Code

CustomHorizontalView(
  spaceView: SizedBox(width: 10),
  padding: EdgeInsetsDirectional.symmetric(horizontal: 20),
  items: List.generate(
    10,
    (index) {
      return Text("INDEX : $index");
    },
  ),
);

Additional information

import 'package:custom_horizontal_list_view/custom_horizontal_list_view.dart';

CustomHorizontalListView(
    items: [],
    spaceView: SizedBox(width: 10),
    padding: EdgeInsets.zero,
    crossAxisAlignment: CrossAxisAlignment.start,
    reverse: false,
    physics: BouncingScrollPhysics(),
    controller: ScrollController(),
),

About

As a Flutter Developer, one common issue we encounter is related to horizontal lists. Sometimes, it becomes challenging to maintain dynamic item heights within such lists. However, I have a solution that I'd like to share. By using this code, the horizontal list should now have dynamically sized items, making it more flexible to accommodate various

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published