Skip to content

Commit 647ce0c

Browse files
Make sure that a LinearProgressIndicator doesn't crash in 0x0 environ… (flutter#177553)
This is my attempt to handle flutter#6537 for the LinearProgressIndicator widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent 6a3011b commit 647ce0c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/flutter/test/material/progress_indicator_test.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,15 @@ void main() {
19691969
paints..arc(startAngle: 1.5707963267948966, sweepAngle: 0.001),
19701970
);
19711971
});
1972+
1973+
testWidgets('LinearProgressIndicator does not crash at zero area', (WidgetTester tester) async {
1974+
await tester.pumpWidget(
1975+
const MaterialApp(
1976+
home: Center(child: SizedBox.shrink(child: LinearProgressIndicator())),
1977+
),
1978+
);
1979+
expect(tester.getSize(find.byType(LinearProgressIndicator)), Size.zero);
1980+
});
19721981
}
19731982

19741983
class _RefreshProgressIndicatorGolden extends StatefulWidget {

0 commit comments

Comments
 (0)