Comments (2)
Its implementation is totally correct! Are you experiencing any problems with this or just want to confirm that you are doing everything right? Everything seems to be ok for me, and even following good practices.
Personally use SchedulerBinding.instance instead of WidgetsBinding.instance, because it allows you to listen to the end of the build method outside a Stateful and create a "SplashScreen" screen (similar to your authentication screen) to be more user friendly and display a loading, and put all authentication logic in my class's controller.
I also use modular, and my approach is no more correct than yours, maybe it's a different, but equivalent standard, and your logic is correct.
Even though you were a beginner, you managed to do everything correctly. I just wouldn't use SystemNavigator.pop();
because I’ve already had apps rejected on the AppleStore for "unexpected app exit". Test this first on iOS, and see that there is backGesture, and if it makes the app exit, if so, change your code to:
if (! Get.key.currentState.canPop () && GetPlatform.isAndroid) {
SystemNavigator.pop();
}
In android this behavior is expected, but in iOS it goes against human guidelines, and you can face problems.
If your application is only android, there is no need to follow this tip.
If your application has a web/PWA version, don't use Flutter's Platform.isAndroid, it imports Dart: io which is incompatible with the WEB (I had to create GetPlatform precisely to give full web support, and I left this Get API exposed for those who need to use it).
from getx.
Thanks for your feedback, I'll take a look in this SchedulerBinding documentatio - I was trying to find something like that, but WidgetBinding was looking too much as ViewLayer stuff to put in the Controller/ViewModel
And yes, i just wanted to confirm if this approach is correct using your library.
I have to add this SystemNavigator.pop() because after user press back from /home it's redirect to this empty screen, that shouldn't be visible in this time being considering /home /login as the first item of the navigation stack, I just wanted to close the app when reach this point.
Tried to handle with RouteObserver instead of listening a Future, but for some reason it wasn't been called when I get back to / path, was trying to read the source code, but haven't found the reason yet.
Edit: Acabei de ver que voce tem um repositorio em portugues.
Muito obrigado pelas dicas e por esta biblioteca :)
from getx.
Related Issues (20)
- Instance "GetLifeCycleBase?" is not registered.
- Drawer Menu disappear after changing app locale in drawer
- when I use Get.dialog() to show a dialog, then I use Get.back() back dialog, at the same time ,the page widget's getxController operator onClose(), how to solve this problem. HOT 3
- Get.dilog().adaptive()
- Create a Getx organization HOT 3
- GetX update.
- hello please add material design 3 to this package , thank for persue. HOT 1
- [GETX] "AddWorkerController" deleted from memory but actually not deleted HOT 1
- Displaying a Snackbar that is does not use the full width makes buttons on that height unclickable.
- [Flutter 3.16.5][GetX-5_RC5] PopScope issue HOT 12
- Error: Undefined name 'required'.
- Memory leaks HOT 1
- Can get.to specify context? HOT 1
- RxList in Getx bindStream, but Obx keep get old data emmited
- Nested GetRouterOutlet not working as expected HOT 2
- UI Not Updating with Switch/Toggle in ListView using GetX Controller
- Back button in browser don't behave the same as Get.back()
- Reactive variable observation issues HOT 2
- 是否可以在 GetMiddleware 中拿到正确的 arguments 值
- The GetxController is not automatically deleted if it is the first child of GetMaterialApp HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getx.