text.make() in AlertDialog results in crash
dippa-1 opened this issue · comments
Describe the bug
In content or title inside a AlertDialog, '...'.text.make()
results in an app crash.
Or is it not possible to but .make() inside a function?
To Reproduce
dynamic _showDeleteAlert(BuildContext context) {
return showDialog<String>(
context: context,
builder: (BuildContext context) => AlertDialog(
title: 'Delete '.text.make(), // not working
content: 'Are you sure?'.text.make(), // not working
// title: const Text('AlertDialog Title'), // working
// content: const Text('AlertDialog description'), //working
actions: [
TextButton(
onPressed: () => Navigator.pop(context, 'Cancel'),
child: const Text('Cancel'),
),
TextButton(
onPressed: () => Navigator.pop(context, 'OK'),
child: const Text('OK'),
),
],
),
);
}
Expected behavior
No crash.
Desktop (please complete the following information):
- OS: Windows 10
- Flutter 2.5.3
- VelocityX 3.3.0
Use 'isIntrinsic' prop in case of LayoutBuilder doesn't support intrinsic dimension.
Eg-
title: 'Delete '.text.isIntrinsic.make(),
content: 'Are you sure?'.text.isIntrinsic.make(),
What is the difference between text.make() and Text() exactly?
What is the difference between text.make() and Text() exactly?
Text() is Flutter's function of creating a text element. text.make() is the VelocityX's way of doing it.
What happens under the hood, I don't know.