Skip to content

A Dart package for creating and managing grid layouts effortlessly. Simplify your UI design process with customization, responsive grid systems for Flutter apps

License

Notifications You must be signed in to change notification settings

alphabetic100/gridify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gridify

A Flutter package to create a dynamic staggered grid layout with custom item heights, padding, scaling, and more. Gridify is designed to simplify creating visually appealing layouts for your Flutter applications.


Features

  • Dynamic staggered grid layout.
  • Customizable item heights.
  • Padding, scaling, and color customization.
  • Easy-to-use builder pattern for generating items.

Demo

To see Gridify in action, view the demo image below:

Demo

Installation

Add gridify to your pubspec.yaml:

dependencies:
  gridify: ^1.0.0

Then run:

flutter pub get

Usage

Here's a simple example of using Gridify:

import 'package:flutter/material.dart';
import 'package:gridify/gridify.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Gridify(
          itemCount: 10,
          builder: (context, index) => Center(
            child: Text(
              "Item $index",
              style: const TextStyle(fontSize: 18, color: Colors.white),
            ),
          ),
          padding: const EdgeInsets.all(8),
          borderRadius: BorderRadius.circular(12),
          color: Colors.blue,
          scale: 0.8,
          ontap: () {
            debugPrint('Item tapped!');
          },
        ),
      ),
    );
  }
}

API Reference

Gridify Constructor

Gridify({
  required int itemCount,
  required Widget Function(BuildContext, int) builder,
  EdgeInsetsGeometry? padding,
  double? scale,
  Color? color,
  BorderRadiusGeometry? borderRadius,
  required VoidCallback ontap,
})

Parameters

  • itemCount: The total number of items in the grid.
  • builder: A function to build each item.
  • padding: Optional padding around each grid item.
  • scale: Optional scaling factor for item heights.
  • color: Background color of grid items.
  • borderRadius: Border radius for each grid item.
  • ontap: Callback when an item is tapped.

Contributing

Feel free to contribute by submitting issues or pull requests on GitHub.

License

This package is open-sourced under the MIT License.

About

A Dart package for creating and managing grid layouts effortlessly. Simplify your UI design process with customization, responsive grid systems for Flutter apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages