Reload not performed on save, even without any issue
See original GitHub issueSteps to Reproduce
The following code makes reloading on save not working:
contactWrapper.contact.displayName?[0] ?? ''
If I replace the above code with a Container()
, for example, the hot reload works.
Here are the full code:
class ContactItem extends StatelessWidget {
final ContactWrapper contactWrapper;
const ContactItem({
Key? key,
required this.contactWrapper,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return BaseView<ContactCheckModel>(
onModelReady: (model) => model.init(contactWrapper),
builder: (context, model, child) {
return ListTile(
leading: CircleAvatar(
backgroundColor: Theme.of(context).primaryColor,
child: Text(
contactWrapper.contact.displayName?[0] ?? '',
style: TextStyle(color: Colors.white),
),
),
title: Text(
contactWrapper.contact.displayName ?? '',
style: Theme.of(context).textTheme.subtitle1,
),
trailing: Checkbox(
onChanged: (bool? value) {
model.checkContact(contactWrapper, value ?? false);
},
value: contactWrapper.isChecked,
),
);
},
);
}
}
Here is a image of the Dart Analysis not showing any error:
I’ve tried to do a Flutter Clean and restart the Dart Analysis, but the error persist.
Version info
[✓] Flutter (Channel stable, 2.0.1, on Mac OS X 10.13.6 17G66 darwin-x64, locale en-AF) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [!] Xcode - develop for iOS and macOS ✗ Xcode 10.3.0 out of date (12.0.1 is recommended). Download the latest version or update via the Mac App Store. [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] IntelliJ IDEA Community Edition (version 2020.3.1) [✓] Connected device (2 available)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
I confirm it’s an issue in the Dart plugin. Here’s an issue to track progress: https://youtrack.jetbrains.com/issue/WEB-50212
@alexander-doroshko It looks like this is due to a bug in the PSI-based Dart parser.
FlutterReloadManager.hasErrorsInFile()
uses it to check for errors, and it is reporting a problem with the conditional access operator.@vitorhm If no one responds here, you might want to open as issue at youtrack.jetbrains.com since the Dart plugin is a Jetbrains product.