What Are The Consequences of Using "Deprecated Code" In Flutter?

1,528

Solution 1

Basically this code will be deleted in future releases of flutter/flutter packages. Most of the time, api's get deprecated when a bug that requires a completely new implementation that will break compatibility or a better implementation that will break compatibility.

Therefore, you can use deprecated code but you should be very careful as they are not maintained and might stop working or deleted in the future. So as long as you are not updating versions you should be fine but it is highly unadvisable.

Solution 2

The problem is that your code will be updated and the flutter will no longer support this widget.

But flutter 2.0 has a tool to help with that. Run the command on your terminal to see what has been depreciated and needs to be updated.

dart fix --dry-run

And execute this other command for fix the depreciated items.

dart fix --apply

For more details about fix, click here

Share:
1,528
Caleb Robinson
Author by

Caleb Robinson

Updated on December 28, 2022

Comments

  • Caleb Robinson
    Caleb Robinson over 1 year

    I recently upgraded to Flutter 2.0. I have dozens of Flatbuttons that are now deprecated. It's going to take me a few days to fix them all. What are the consequences of shipping an update before then with deprecation warnings? The app still builds and runs fine.