-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
When using the ListTile widget in a Flutter application on macOS, the app crashes if the window width is reduced and the ListTile contains a leading or trailing widget. This issue is reproducible consistently and seems related to how the widget handles layout constraints during window resizing.
Steps to reproduce
- Create a Flutter app targeting macOS.
- Add a ListTile widget with either a leading or trailing widget.
- Run the app and gradually reduce the width of the window.
- Observe that the app crashes when the window reaches a certain narrow width.
Expected results
The ListTile should adapt gracefully to changing window sizes without crashing, regardless of whether leading or trailing widgets are present.
Actual results
The application crashes as the window width decreases when a ListTile contains leading or trailing widgets. The crash appears to be related to layout constraints.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:portfolio/providers.dart';
class Homepage extends ConsumerWidget {
const Homepage({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final portfolio = ref.watch(portfolioProvider);
return ListView.builder(
shrinkWrap: true,
itemCount: portfolio.length,
itemBuilder: (context, index) {
final stock = portfolio[index];
return ListTile(
title: Text(
stock.name,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
"Qty: ${stock.quantity}",
overflow: TextOverflow.ellipsis,
),
trailing: Text("Price: ${stock.price}"),
);
},
);
}
}
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
_AssertionError._doThrowNew (/Users/ates/development/flutter/bin/cache/pkg/sky_engine/lib/_internal/vm/lib/errors_patch.dart:50)
_AssertionError._throwNew (/Users/ates/development/flutter/bin/cache/pkg/sky_engine/lib/_internal/vm/lib/errors_patch.dart:40)
_RenderListTile._computeSizes (/Users/ates/development/flutter/packages/flutter/lib/src/material/list_tile.dart:1356)
_RenderListTile.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/material/list_tile.dart:1459)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderPadding.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/shifted_box.dart:234)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderPadding.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/shifted_box.dart:234)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderProxyBoxMixin.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:111)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderProxyBoxMixin.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:111)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderProxyBoxMixin.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:111)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderProxyBoxMixin.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:111)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderProxyBoxMixin.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:111)
RenderObject.layout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/object.dart:2608)
RenderProxyBoxMixin.performLayout (/Users/ates/development/flutter/packages/flutter/lib/src/rendering/proxy_box.dart:111)
Flutter Doctor output
Doctor output
[Paste your output here]Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Type
Projects
Status
Done (PR merged)