flutter_staggered_grid_view icon indicating copy to clipboard operation
flutter_staggered_grid_view copied to clipboard

Error - LateInitializationError: Field '_children@25042623' has not been initialized.

Open aseem-heg opened this issue 2 years ago • 2 comments

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

class Widget1 extends StatelessWidget {
  const Widget1({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return StaggeredGrid.count(
      crossAxisCount: 4,
      mainAxisSpacing: 4,
      crossAxisSpacing: 4,
      children: const [
        StaggeredGridTile.count(
          crossAxisCellCount: 2,
          mainAxisCellCount: 2,
          child: Text('alpha'),
        ),
        StaggeredGridTile.count(
          crossAxisCellCount: 2,
          mainAxisCellCount: 1,
          child: Text('alpha'),
        ),
        StaggeredGridTile.count(
          crossAxisCellCount: 1,
          mainAxisCellCount: 1,
          child: Text('alpha'),
        ),
        StaggeredGridTile.count(
          crossAxisCellCount: 1,
          mainAxisCellCount: 1,
          child: Text('alpha'),
        ),
        StaggeredGridTile.count(
          crossAxisCellCount: 4,
          mainAxisCellCount: 2,
          child: Text('alpha'),
        ),
      ],
    );
  }
}

Screenshot from 2023-03-14 14-59-55

aseem-heg avatar Mar 14 '23 20:03 aseem-heg

You can find a possible solution in the issue #285.

jlnrrg avatar Mar 15 '23 09:03 jlnrrg

On which version of Flutter?

letsar avatar Apr 14 '23 19:04 letsar