Closed ramism16 closed 4 years ago
Hello Ramis, I didn't understand your idea tbh but why not fork this repo and make this change then you can submit a pull request I'll review it as fast as possible and if everything is okay we will merge it Thanks
Thanks
https://github.com/KarimMohamed20/SplashScreenFlutterPackage/blob/918502d9f398220e580d3f8c9fc5666700cde236/lib/splashscreen.dart#L89 https://github.com/KarimMohamed20/SplashScreenFlutterPackage/blob/918502d9f398220e580d3f8c9fc5666700cde236/lib/splashscreen.dart#L90 https://github.com/KarimMohamed20/SplashScreenFlutterPackage/blob/918502d9f398220e580d3f8c9fc5666700cde236/lib/splashscreen.dart#L91
I use your splashscreen with navigateAfterSeconds in most of my work and I really appreciate it. I would like if you add a line after line 91 (referred to above) that lets me add a new RouteSetting when I use unnamed routes with navigateAfterSeconds. You can add this as optional parameter(s) in the splashscreen widget and add the line after line 91, for example:
settings: RouteSettings(name: $unnamedRouteParameter)
This will allow me to push a named route on navigation after seconds, in the case that I don't specify named routes, that is the screen after splashscreen so I can later pop it from Navigator stack using pushAndRemoveUntil or popUntil.
Alternatively, I can use pushReplacement when navigating from screens I want to restrict going back to. But resuming the app from a paused state (or from the background) pushes the splashscreen to top which again navigates to the page after it. Maybe adding my suggestion can prevent it, or provide for more scalability.
But anyway, thanks for the contribution and let me know what you think of this.