dynamic_height_list_view 0.0.2 dynamic_height_list_view: ^0.0.2 copied to clipboard
A Flutter package enabling dynamic height ListView and GridView layouts, perfect for responsive and adaptive interfaces with content of varying sizes.
import 'package:example/grid_view_example.dart';
import 'package:example/list_view_example.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
home: HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({
super.key,
});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Dynamic Height List/Grid View Example'),
),
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
child: const Text("LIST VIEW"),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => ListViewExample()),
);
},
),
const SizedBox(height: 20),
ElevatedButton(
child: const Text("GRID VIEW"),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => GridViewExample()),
);
},
),
],
),
),
);
}
}