Problem:#01A

Sounds like you're having a bit of trouble with Flutter's build process. Every time you run your app on an emulator or device, 

you're stuck having to do a full restart through

 "RUN > Flutter Full Restart." 

Otherwise, instead of your latest code, the app keeps loading up an old scaffold body from two weeks ago when you first started working on it.

 Frustrating, right?

here is the current source on pastebin:

children: [ Opacity( opacity: isLoadingVisible ? 1.0 : 0.0, child: Container( padding: const EdgeInsets.all(16.0), // Adjusted padding value child: CircularProgressIndicator( strokeWidth: 4.0, // Adjusted strokeWidth value valueColor: AlwaysStoppedAnimation(Colors.blue), // Adjusted color ), ), ), ],


It seems like Flutter might be hanging onto the old code in its cache and not bothering to replace it with the new stuff, even after we've done a full rebuild. And I'm not entirely sure how their Hot Reload feature is set up. But really, why load up that old cache when we've already hit the reset button?

Solution:

Alright, here's the gist: If you're facing issues like this, kicking off with a 'flutter clean' can often do the trick. It clears out any old stuff hanging around and gives you a fresh start.

But if that doesn't cut it, it might be your IDE or a similar tool acting up. When you run 'flutter run' straight from the command line, it actually creates a totally new APK, no strings attached. So, to test if the problem's there, give it a go with 'flutter run' and then hit 'r' for a quick hot reload or 'R' for a full reload. That way, you're bypassing any potential hiccups from your development setup.

If you're using Android Studio, you can clean your Flutter project by navigating to Tools -> Flutter -> Clean.

You've got three options to tackle this:

1. Use 'flutter clean' to zap the /build folder.

2. Get hands-on and manually delete the /build folder yourself, basically doing what 'flutter clean' does.

3. If things are still acting wonky, give your IDE a reboot. Sometimes it holds onto old error logs, gumming up the works.

You might find it helpful to delete the .pubcache folder within your Flutter SDK directory.

Another Solution:

To fix this, you have two options:

1. Restart Visual Studio Code, which will automatically close the terminals.

2. Stop the terminal where your Flutter project is already running, and then run the 'flutter clean' command.

New Method:

You found a way to automate running the clean before you debug your code. Here's how you can set it up:

1. First, find the Run > Edit Configurations Menu.

2. Click the '+' icon next to External tool under Before launch: External tool, and then select Activate tool window.

3. Set up the Run External Tool configuration as follows:
   - Configure the working directory to be a directory in your project.


Use this command to clean the cache in Flutter:


flutter pub cache clean