Comments (3)
Remove the '/' from the login. That was my mistake. Adding a / will construct the views based on the deepling protocal so it'll create all views infront of that as well.
So use 'login' instead of '/login'
from flutter-tutorials.
login----> home : login will build
home ---> login : login will build
login build many times, i want login build once
from flutter-tutorials.
Oh you mean that. That's just how Flutter works. It rebuilds for major events like that. Navigation will rebuild, opening the keyboard will rebuild, locking the screen will rebuild, going into background will rebuild, poping a route from navigation will rebuild, etc. Since the UI is a function of state this should be kept in mind because you'll have to write your code to always return the same result giving a state and be able to be executed 100's of times without side effects. Your page will never be rebuilt once ONLY , unless you navigate there, never call set state and never navigate away.
Something you shouldn't do below!!
If you want to do this you can hack the Flutter approach and use a stateless widget for every widget, keep a local widget with your view that's built once and then only construct that when it's null.
Like in this answer. But that is directly fighting against the Flutter patterns. I've never had to do this. Can you tell me the reason you don't want it to rebuild, maybe I can help you solve your root problem
from flutter-tutorials.
Related Issues (20)
- Build a List View with ModelView extending StreamViewModel<T>
- Unable to supply messageText and titleText as showCustomSnackBar arguments HOT 4
- Partial View Building - Rebuilds everything
- Exception on compile time with Flutter 2 HOT 1
- Bottom Sheet Service HOT 1
- Notification service in ios HOT 1
- Shared Preferences injection error using Stacked HOT 2
- Problem firebase messaging in new version flutter HOT 2
- Stream controller providing stale values for onModelReady() HOT 2
- Null Safety HOT 1
- Provider Tutorial example isn't responsive as it's shown on the tutorial (010 and 012) itself HOT 1
- Flutter_Data with Stacked Architecture HOT 1
- Direct Injection and GetX HOT 1
- Navigation Service and null safety HOT 1
- Can not solve the issue in BaseView
- navigationKey.currentState is NULL (Flutter Web Advanced Navigation) HOT 3
- Prevent AppDrawer from reloading
- Shared model
- 001 build error HOT 1
- Is there any way to use viewModel in didUpdateWidget? HOT 1
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 flutter-tutorials.