I am creating a web application that utilizes a grid view to display items in a grid format. However, I am facing an issue where the height of the grid increases excessively. I have attempted to address this by setting an aspect ratio of 1.7, which works well at a specific screen size. Nevertheless, when the screen size changes, the height also adjusts accordingly, which is not my intended outcome. I am seeking a solution to maintain a fixed height for the grid regardless of the screen size. Below is the relevant code snippet for reference.
Expanded(
child:
// GridView.builder(
// gridDelegate:
// const SliverGridDelegateWithFixedCrossAxisCount(
// childAspectRatio: 1.7, crossAxisCount: 2),
// itemBuilder: (context, index) {
// return Padding(
// padding: const EdgeInsets.only(
// left: 16, right: 16, top: 16),
// child: DoctorProfileCard(
// doctorName: '',
// category: 'category',
// concultancyTiming: 'concultancyTiming',
// description: 'description',
// imageUrl: 'imageUrl',
// onClick: () {}),
// );
// },
// ),
GridView.custom(
gridDelegate: SliverWovenGridDelegate.count(
crossAxisCount: 2,
pattern: const [
WovenGridTile(1.7),
],
),
childrenDelegate: SliverChildBuilderDelegate(
(context, index) => Padding(
padding: const EdgeInsets.only(
left: 16, right: 16, top: 16),
child: DoctorProfileCard(
doctorName: '',
category: 'category',
concultancyTiming: 'concultancyTiming',
description: 'description',
imageUrl: 'imageUrl',
onClick: () {}),
),
),
),
)