Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
- package:flutter_swiper
- package:flutter_page_indicator
- package:transformer_page_view
To use the swiper function, I called swiper in pubspec.yaml and tried to use it, but an error occurred.
Null safety literally means writing null-safe program code. A caveat here is that the term null safety is not meant to eliminate nulls (null is one of the great data types). The problem we should pay attention to is not the null itself, but the function that doesn't match the unexpected null .
When developing a program, many null reference errors occur at runtime, that is, during application execution. Null safety addresses this issue by allowing the compiler to catch those bugs before the code is executed, so you can be prepared for unexpected situations. This type check allows you to immediately know if there is an error, so you can quickly respond to the error. Like Kotlin and Swift, Dart, which is now the backbone of Flutter, supports null safety.
To summarize, take action to respond to unexpected nulls. Use a package with these measures in place. The swiper I used above does not have this measure.
So, in pub.dev, null safety, then the solution is to use the processed package.
example
Solution : In pub.dev, you can find the package with null safety as above and use it.
0 Comments