Caleb Robinson
Caleb Robinson

Reputation: 1120

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

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.

Upvotes: 5

Views: 6335

Answers (2)

Mohammad Kurjieh
Mohammad Kurjieh

Reputation: 1153

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.

Upvotes: 4

Y. Sampaio
Y. Sampaio

Reputation: 78

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

Upvotes: 2

Related Questions