question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reload not performed on save, even without any issue

See original GitHub issue

Steps to Reproduce

The following code makes reloading on save not working: contactWrapper.contact.displayName?[0] ?? ''

Reload not performed

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: Dart Analysis

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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
alexander-doroshkocommented, Mar 29, 2021

I confirm it’s an issue in the Dart plugin. Here’s an issue to track progress: https://youtrack.jetbrains.com/issue/WEB-50212

2reactions
stevemessickcommented, Mar 17, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Hot reload on save" not working on my Android Studio 3.5.3
Press ctrl + s to save. Then press r for hot reload, in order to have changes reflect on the emulator. In Flutter,...
Read more >
VSCode Hot Reload Not Working Upon Saving #29096 - GitHub
Just press Ctrl+F5 once. When the tools got enabled, every Ctrl+s or save results in triggering the hot reload. Its fixed.
Read more >
Visual Studio Hot Reload for code changes not working
I am having an issue with Hot Reload not working with C# code changes with Android project, even though it is enabled for...
Read more >
Flutter Hot Reload doesn't re-run code - Medium
The Flutter.io Using Hot Reload page says “ if the modified code won't be re-executed as a result of rebuilding the widget tree,...
Read more >
Hot reload not working in only changes mode
Developer Community · Create a new Forms app. If Hot Reload works on it (it probably will) then it means the issue is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found