Make sure that a LinearProgressIndicator doesn't crash in 0x0 environ… (#177553)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
LinearProgressIndicator widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-11-02 22:25:56 +02:00 committed by GitHub
parent 6a3011b4e1
commit 647ce0c00a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1969,6 +1969,15 @@ void main() {
paints..arc(startAngle: 1.5707963267948966, sweepAngle: 0.001),
);
});
testWidgets('LinearProgressIndicator does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Center(child: SizedBox.shrink(child: LinearProgressIndicator())),
),
);
expect(tester.getSize(find.byType(LinearProgressIndicator)), Size.zero);
});
}
class _RefreshProgressIndicatorGolden extends StatefulWidget {