Skip to content

Underflowing LazyBlock can fail to re-layout #5950

@HansMuller

Description

@HansMuller

The following test demonstrates the problem.

import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/widgets.dart';

void main() {
  testWidgets('Underflowing LazyBlock should relayout for additional children', (WidgetTester tester) async {
    await tester.pumpWidget(new LazyBlock(
      delegate: new LazyBlockChildren(
        children: <Widget>[
          new SizedBox(height: 100.0, child: new Text('100')),
        ]
      )
    ));

    await tester.pumpWidget(new LazyBlock(
      delegate: new LazyBlockChildren(
        children: <Widget>[
          new SizedBox(height: 100.0, child: new Text('100')),
          new SizedBox(height: 200.0, child: new Text('200'))
        ]
      )
    ));

    expect(find.text('200'), findsOneWidget);
  });
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions