How to use Navigator 2.0 with Page Controller in Flutter? - flutter

I'm developing a flutter application where if the user is logged in, he'll see a page with 5 different pages (using Page Controller). I'm trying to use flutter navigator to kind of develop the navigation for the app. This is what I'm trying to achieve: Let's say there are 5 pages on the landing page: a-page, b-page ,c-page, d-page, e-page. The user initially lands on the c-page, at this point, the path should be "/c-page" and whenever the user switches the page, the path should change accordingly. For instance, currently the path is "/c-page", if the user switches to the b-page, the path should be "b-page". So basically the b-page path should replace the c-page path in this case. I tried replacing the path but wasn't completely successful. How can I achieve this?
Thank you in advance.

Related

flutter- getx nested routes with tab

I am going to build flutter app with Getx.
I followed nested navigator from
https://github.com/jonataslaw/getx/issues/799#issuecomment-730719165
at this example, only shows 1 step sub routes like "/browse".
I need to make another sub routes like "/browse/tabX" and "/browse/tabY"
when click browse button from BottomNavigationBar, It shows tabs (tabX and tabY) on the top. and tabX is default selected.
for the body, it shows automatically their pages.
Also using Get.Named('/browse/tabY') can access to open their page(select second tab and show their body).
Can you help me?
Oh Now I got the answer!
What I make a mistake is I did not use "sub-name".
for example, at initialRoute,
I used '/home/browser' but it should be '/browser' if it is sub-route.
Because the concept is route to subrouter's root and handle by subrouter.
so "initialRoute from root" route to /home first.
and "initialRoute from subroute" route to /browser again!
I use classed variable instead just string so I did not figure this difference out.

Ionic 3 - Lost form data when when I use pop function

I have a questionnaire App with more than three pages .. I use NavCtrl to go to next page >> but when I go back using back to the previous page using NavCtrl the page displays all forms blank and the data is lost.
Please Help Me :(
There are multiple ways to implement that. Full documentation: https://ionicframework.com/docs/api/navigation/NavController/
Using navCtrl.push(page) to navigate is one option. In that case you have a root page, that is set up in your app.component.ts.
When you return from pushed page by using the back button or closing the view, the root page should be the same.
Note: You need to differentiate between root pages and push pages. The root page is your active page, when you then push pages, the root pages does not change. But when you change the root page, by using setRoot, Lifecycle Events, constructor, ... are called.

overriding setResponsePage() to build breadcrumb

I 'm trying to build my own simple breadcrumb component that pushes a PageRefence onto a List for each and every Link in the application.
Unfortunately, setResponsePage() is final (I use wicket 6).
The only other option that comes to my mind is to add a parameter to my base page constructor. But this would require me to change every link in the app..
Are there any other options?
Since you already have a base page, it's easier to override onBeforeRender() in your base page to update the breadcrumbs list that you'd store in your Session object.
Or am I missing something?
To answer my own question:
In the end I realized, that I do not want to have the breadcrumb updated on each new page.
Therefore I created an object that holds a List of Pagereferences. When I navigate to a new Page, I take the list of the current page, make a copy of it an add the current page. The resulting list is pased onto the new page.
All this is handeld in the base page.
Keeping it in the page, avoids problems with multiple tabs / windows.
Thanks for the help.

Discover which (if any) route will match a given URL from within Controller in ASP.NET MVC2 app

In my master page I have a placeholder where a Html.RenderPartial() will render a collection of (bread)crumbs which are effectively a list of links I build up using action, controller names and RouteValueDictionary's.
I have an action that is called from multiple places to view a short-list and so when building the list of breadcrumbs for this actions view to display. Ideally I'd like to use Request.UrlReferer as the penultimate crumb.
Before unconditionally using this URL I want to check that it will actually match at least 1 route so I can be sure if the user clicks it they will get a view from my app and if they don't I will simply use the home page instead.
Any suggestions how I would go about this?
Take a look at this post http://haacked.com/archive/2007/12/17/testing-routes-in-asp.net-mvc.aspx

joomla : set session from javascript

i have a persistent bar in my website and this bar can be slide in and out using mootool.. but i have problem with the user navigating to other page. it always load the default bar which is slide out...Example,if the user had click to slide in the bar, and when he navigate to other page, the bar will goes to default state which is slide out.
how can I tackle this issue?
I am using Joomla 1.5 and the mod_php module that allow me to enter all HTML, PHP and Javascript in one module.
YOu can exploit the window.name property to keep a persistent variable, however the best way to do it is either store session information in the database in a cookie.
* EDIT *
Just noticed you are using Mootools. Mootools has a built in cookie object you can use to store the state of the bar. Here is the documentation -
http://mootools.net/docs/core/Utilities/Cookie