Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/faob-dev/flutter_grid_delegate_ext

Flutter SliverGridDelegate extension
https://github.com/faob-dev/flutter_grid_delegate_ext

flutter flutter-package gridview slivergrid

Last synced: about 2 months ago
JSON representation

Flutter SliverGridDelegate extension

Awesome Lists containing this project

README

        

## Simple SliverGridDelegate extension

Simple SliverGridDelegate extension, Height of big cell and small cell can be adjusted, `BigCellHeight >= SmallCellHeight`.

[![pub package](https://img.shields.io/pub/v/flutter_grid_delegate_ext.svg)](https://pub.dartlang.org/packages/flutter_grid_delegate_ext)

### Installation

Add dependency in `pubspec.yaml`:
```yaml
dependencies:
flutter_grid_delegate_ext: "^0.0.2"
```

Import in your project:
```dart
import 'package:flutter_grid_delegate_ext/flutter_grid_delegate_ext.dart';
```

### Basic usage

#### Unequal cells height with first cell small
```
GridView.builder(
gridDelegate: XSliverGridDelegate(
crossAxisCount: 3,
smallCellExtent: 100,
bigCellExtent: 200,
mainAxisSpacing: 5,
crossAxisSpacing: 5,
isFirstCellBig: false
)
)
```

#### Unequal cells height with first cell big
```
GridView.builder(
gridDelegate: XSliverGridDelegate(
crossAxisCount: 3,
smallCellExtent: 100,
bigCellExtent: 200,
mainAxisSpacing: 5,
crossAxisSpacing: 5,
isFirstCellBig: true
)
)
```

#### Equal cells height
```
GridView.builder(
gridDelegate: XSliverGridDelegate(
crossAxisCount: 3,
smallCellExtent: 200,
bigCellExtent: 200,
mainAxisSpacing: 5,
crossAxisSpacing: 5,
)
)
```

### Examples

[example](https://github.com/faob-dev/flutter_grid_delegate_ext/tree/master/example) project contains demo

### Bugs/Requests
Reporting issues and requests for new features are always welcome.