-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Failed assertion in widgets library apparently caused by tooltip: RenderBox was not laid out #169126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Triage ReportI was able to reproduce the issue on iOS using the provided code sample with the However, I could not reproduce it on the It works as expected on Android, macOS, and Web. @zetches, this does appear to be a duplicate of #167722. Could you please confirm if the issue is resolved on the latest master?
Code Sample (Same as OP)import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) =>
MaterialApp(title: 'Dialog push bug', home: const HomePage());
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const Text('Home')),
body: Center(
child: ElevatedButton(
onPressed: () => _openPicker(context),
child: const Text('Open picker'),
),
),
);
void _openPicker(BuildContext context) {
showDialog(
context: context,
builder: (ctx) {
String? selected = 'a';
return StatefulBuilder(
builder:
(ctx, setState) => AlertDialog(
title: const Text('Choose library'),
content: ListTileTheme(
dense: true,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
RadioListTile<String>(
value: 'a',
groupValue: selected,
title: const Text('Custom list A'),
onChanged: (v) => setState(() => selected = v),
secondary: IconButton(
icon: const Icon(Icons.edit),
tooltip:
'Edit', // NOTE: removing this line seems to fix it
onPressed: () {
Navigator.pop(ctx);
Navigator.push(
ctx,
MaterialPageRoute(
builder: (_) => const DummyPage(),
),
);
},
),
),
],
),
),
),
);
},
);
}
}
class DummyPage extends StatelessWidget {
const DummyPage({super.key});
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(title: const Text('Edit page')),
body: const Center(child: Text('Hello')),
);
} stable (3.29.3) - flutter doctor -v
master (3.33.0-1.0.pre.138) - flutter doctor -v
|
I tested on master now and I couldn't reproduce either. So it seems to be fixed, thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Hi. I have encountered a failed assertion error, and the error message asked me to file a bug report. I searched around a bit but couldn't find an obvious duplicate, hence this issue. (Edit: on some more searching, it may be a duplicate of #167722 ?)
Here's some minimal code that will reproduce it on my setup quite consistently:
To reproduce, run the above code, tap “Open picker”, and in the dialog, click or double-click the pencil icon next to the only list item. The assertion error is thrown relatively often when the icon is single-clicked. It happens almost every time if you double-click the icon.
I worked around it by removing the tooltip (as I noticed the occurrence of "tooltip" in the stack trace, so figured that might have something to do with it). That appears to fix it, so it is not blocking me.
Hope this helps!
The text was updated successfully, but these errors were encountered: