Skip to content

A Flutter package that provides two-dimensional scrolling functionality.

License

Notifications You must be signed in to change notification settings

softjapan/xy_scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xy_scroll

XyScroll is a Flutter widget package that enables easy implementation of two-dimensional scrollable grids. It allows you to create content that can be scrolled both vertically and horizontally.

Features

  • Two-dimensional (vertical and horizontal) scrollable grid layout
  • Customizable vertical spacing between items
  • Custom ScrollPhysics for both vertical and horizontal scrolling
  • Customizable padding support

Demo

xy-scroll.webm

Getting Started

  1. Add dependency to pubspec.yaml:
dependencies:
  xy_scroll: ^1.0.0
  1. Install the package:
flutter pub get
  1. Import the package:
import 'package:xy_scroll/xy_scroll.dart';

Usage

Basic example:

XyScroll(
  items: [
    [
      Container(width: 100, height: 100, color: Colors.red),
      Container(width: 100, height: 100, color: Colors.blue),
      Container(width: 100, height: 100, color: Colors.green),
    ],
    [
      Container(width: 100, height: 100, color: Colors.yellow),
      Container(width: 100, height: 100, color: Colors.purple),
      Container(width: 100, height: 100, color: Colors.orange),
    ],
  ],
  verticalSpacing: 16.0,
  padding: EdgeInsets.all(16.0),
)

Applying custom scroll physics:

XyScroll(
  items: itemsList,
  verticalPhysics: BouncingScrollPhysics(),
  horizontalPhysics: ClampingScrollPhysics(),
)

Parameters

Parameter Type Description
items List<List> 2D list of widgets to display
verticalSpacing double Spacing between vertical items (default: 20.0)
verticalPhysics ScrollPhysics? Physics for vertical scrolling
horizontalPhysics ScrollPhysics? Physics for horizontal scrolling
padding EdgeInsetsGeometry? Padding around the entire scroll view

Additional Information

  • Please report bugs and feature requests on the [Issues page]
  • Pull requests are welcome

License

This project is released under the MIT License.

About

A Flutter package that provides two-dimensional scrolling functionality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published