Closed gOzaru closed 2 years ago
No need. I found the solution. I copied the library into my project and removed all navigateAfterFuture variable and all of its assertions. I only used the navigateAfterSeconds, changed its variable into Widget? and only allowed for Widget?, not for route name. I also used Getx Route Management for easier use and added symbol ! to the variable of navigateAfterSeconds.
I declared the variable as:
late Widget? navOne = null;
on initState():
if (widget.navigateAfterSeconds != null) {
code = 1;
navOne = widget.navigateAfterSeconds;
}
inside Widget build(BuildContext context):
Timer(Duration(seconds: widget.seconds!), () => {Get.offAll(() => navOne!)});
Now, my splashscreen is running as I want it to be. Thanks to God who helped me out in this problem. I needed to figure this out at least in 12 hours. We need to add the symbol ! to related variable to change the whole package into completely Null Safety. Since I can't change the online library, I copied it into my project and now all is perfect. Thank you to whoever made this package. God bless you in health and wealth.
Note: Once I get succeed in the future, I promise that I will give 10% of a total $1,000,000 to all authors whom created any package inside the project I have been working on. You guys made this for free, and I think all of you deserve the money I will earn later. Keep working to make Flutter easier to work on for newbies like me. God bless you all in health and wealth. Cheers.
Describe the bug I have been using the latest package of Null Safety since 4 months ago and so far, I have no error. Today, I got errors:
on this line of codes in splashscreen.dart:
This is my lines of code:
To Reproduce Steps to reproduce the behavior:
Expected behavior There should be no error at all since I have been using it since 4 months ago until today, and yet it gets error suddenly. Maybe that is because I used the latest package of flutter_screenutil.
Desktop
Smartphone