Skip to content

App Freeze When Not Providing The 'itemCount' of AlignedGridView.count #360

@00Adnan00

Description

@00Adnan00

When using AlignedGridView.count without specifying the itemCount parameter, the Flutter app freezes completely.

This is minimal code to reproduce the issue:

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: AlignedGridView.count(
          crossAxisCount: 2,
          itemBuilder: (_, index) => Text('Item $index'),
        ),
      ),
    );
  }
}

flutter doctor:
[✓] Flutter (Channel stable, 3.32.5, on macOS 15.5 24F74 darwin-arm64, locale
en-LY)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Community Edition (version 2024.3.5)
[✓] VS Code (version 1.99.3)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions