custom_grid_count_view 1.0.2
custom_grid_count_view: ^1.0.2 copied to clipboard
A flutter package that render dynamic height grid count view with swipe to action feature.
import 'package:custom_grid_count_view/custom_grid_view.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const CustomGridCountViewExample(),
);
}
}
class CustomGridCountViewExample extends StatelessWidget {
const CustomGridCountViewExample({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: CustomGridCountView(
gridViewProps: GridViewProps(
builder: (_, index) {
return Container(
color: Colors.greenAccent,
height: 100 + (index * 2),
);
},
itemCount: 200,
crossAxisCount: 3,
shrinkWrap: false,
),
actionProps: ActionProps(
backgroundColor: Colors.black12,
leftAction: [
ActionModel(
onTap: (index){},
label: "Add",
icon: Icons.add,
)
],
rightAction: [],
),
),
);
}
}