xy_scroll 1.0.3
SDKflutter
Platformandroidioswindowslinuxmacosweb
A Flutter package that provides two-dimensional scrolling functionality.
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
Getting Started
- Add dependency to pubspec.yaml:
dependencies:
xy_scroll: ^1.0.0
- Install the package:
flutter pub get
- 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.