Unverified Commit 72f15e9b authored by Miguel Beltran's avatar Miguel Beltran Committed by GitHub

Fix for issue #75518 - ListTile.divideTiles throws error if empty list is...

Fix for issue #75518 - ListTile.divideTiles throws error if empty list is passed when null-safety enabled (#75522)
parent 44d7bd35
......@@ -982,6 +982,9 @@ class ListTile extends StatelessWidget {
assert(tiles != null);
assert(color != null || context != null);
if (tiles.isEmpty)
return;
final Iterator<Widget> iterator = tiles.iterator;
final bool isNotEmpty = iterator.moveNext();
......
......@@ -252,6 +252,11 @@ void main() {
expect(find.text('third'), findsOneWidget);
});
testWidgets('ListTile.divideTiles with empty list', (WidgetTester tester) async {
final Iterable<Widget> output = ListTile.divideTiles(tiles: <Widget>[], color: Colors.grey);
expect(output, isEmpty);
});
testWidgets('ListTileTheme', (WidgetTester tester) async {
final Key titleKey = UniqueKey();
final Key subtitleKey = UniqueKey();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment