flutgrid 0.0.5
flutgrid: ^0.0.5 copied to clipboard
A Flutter package for building responsive grid layouts with ease.
import 'package:flutter/material.dart';
import 'package:flutgrid/flutgrid.dart';
void main() {
runApp(const FlutGridExampleApp());
}
class FlutGridExampleApp extends StatelessWidget {
const FlutGridExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'FlutGrid Example',
theme: ThemeData(primarySwatch: Colors.blue),
home: Scaffold(
appBar: AppBar(title: const Text('FlutGrid Example')),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: FlutGrid(
children: [
FlutGridItem(
xs: 12,
sm: 6,
md: 4,
child: Container(
height: 100,
color: Colors.red,
child: const Center(child: Text('Item 1')),
),
),
FlutGridItem(
xs: 12,
sm: 6,
md: 4,
child: Container(
height: 100,
color: Colors.green,
child: const Center(child: Text('Item 2')),
),
),
FlutGridItem(
xs: 12,
sm: 6,
md: 4,
child: Container(
height: 100,
color: Colors.blue,
child: const Center(child: Text('Item 3')),
),
),
],
),
),
),
);
}
}