Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed yesterday.
Improve this question
I am trying to make a simple contact app in flutter. In homepage there is + icon(floating Action Button) which will navigate to next screen where you can enter Name and Contact Number of the person.
On homescreen we will be able to see those contacts in listview builder.If i tap on and any card of contact it will navigate to edit screen.
I am trying to make add and edit on same screen. But in case of edit screen TextEditingController should show initial data and in case of add screen it should show hintText.
I don't know how to make both add and edit on same page. Please help me with this.
I first tried making two screens separate which i could do. But now i am looking for way to make both add and edit screen on same page. So that i don't have to write same code again.
Use a flog to check if the screen is to add or edit, if its to add set null to initialValue of TextFormField otherwise provide the value.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Here I have a view in which the user can enter his name, mobile number, visitor age, visitor name and visitor gender in a view that appears on top WHICH IS A CELL...(TopCell).
And below that cell there is another cell which contains another Cell (ButtonCell) which contains 2 buttons named Add Visitor and Submit.
There is another cell named AdditionalCell - which I will tell you what is it used for.
Here what I need is...If the user needs to add more than 1 visitor, the user needs to click on "Add Visitor" Button and the AdditionalCell containing 3 fields named Visitor Name, Age and Gender should appear below.
And each time when the user clicks on add visitor, the last cell's datas should be added into the visitors array.
And when the visitor decides if its enough, the last cell's data should be added to the array when The submit button is also pressed.
This is how my current code looks like
My current code Github link
!
Have you tried creating a temporary array for the additional visitors? Then stepping through them when the button is pressed adding a cell for each? Then once the user submits, a for loop would through the temp array adding them to the visitor array with the rest and then clearing the temp.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
How can i remove the ion-tabs once its loaded
I am working on a chat application which is almost complete. The issue is that when i login to tabspage, then when i try to logout and it takes to the login page, The bottom ion-tabs are still being showed in login page now.
How can i remove the ion-tabs once it loaded ?
I have searched the internet and didn't found any valid resolve to this problem. I really need solution to this fast.
Following are some screeenshot to explain the situation, Thanks.
Before login screenshot
Dashboard with tabs page loaded
AFTER LOGOUT (loginpage), still tabs are visible
You are changing the root of the tab, remember that each tab has its own navigation stack. By default, pages are cached and left in the DOM if they are navigated away from but still in the navigation stack (the exiting page on a push() for example). They are destroyed when removed from the navigation stack (on pop() or setRoot()). To set a full new root outside the tabs, do something like:
this.app.getRootNav().setRoot(Login);
Hope this helps
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm relatively new to programing in general and am currently designing a database project but now I ran into a logic problem which my head cant get straight.
The problem is that I have a view controller that loads in a list of things from the database and than when you click on it it opens a detail, from that detail there is a button that loads in a list like the previous one we came from so I use the same view controller and just request different data. So far, everything is nice and dandy.
But now comes the problem there is a back function so when I now press back once I go back to the detail and than when I press back a second time it loads the last data that I had loaded on that list so it loads the wrong data.
A good example of what I would like to have is the Facebook friend function when I click on my friends it loads a list and than I can click on their friends I see the same list with different data but when I go back two steps it loads in my friends again. I made it work with a very confusing and impractical system of registers but this is very bad because it sometimes throws errors.
So does anyone know how I could achieve what I want?
When you "reuse" this view controller, I would suggest creating a new instance of that view controller each time. This way, (assuming you avoid use of any global variables, but rather only use properties of the class) you're guaranteed that each time you create new instance of the view controller, it won't affect other instances that might exist elsewhere in the navigation controller's stack of previously instantiated view controllers.
I'm currently trying to create a small notepad app, and i'm in need of help. I am using a Tabbed View Application. Say we had a view that has two text fields for Name and short description, and then a button beneath saying "Create Note".
How can I make this button change the view to my editor/notepad view that does not have the tabs at the bottom?
Thanks
If you are using storyboards, which I assume that you are, what you will want to use are triggered movements called segues.
To create one, right-click on the button and drag the line that appears to the second view, and then release.
It should look like this:
Then, when you release, a gray box will appear, with a list of segues. You can find out what each one does online, and as you get more advanced you can develop custom ones.
However, use Modal as a basic one to begin with.
Hope this helps,
Will.
PS. In the future, try and make your questions more specific, and do some research before you ask a question. It's important that you gain a good reputation on Stack Overflow if you want your questions answered properly.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I would like to create a page similar to the one where the user can add a note in the Momento app (screenshot below).
What's the best way to structure the View Controllers for this page? There is a tab-like menu in the center of the page. On the top half of the screen, is a view; and at the bottom-half, you get a keyboard (when entering text).
MY NEED : entering a note which can have three types of text (so three tabs) and a picture -> so four tabs in all.
On some analysis, goggle'ing, and thinking, I can think of these possibilities:
OPTION 1
A TabBarController with 4 tabs (but then I wouldn't be able to place the tab in the middle of the screen like in Momento app & I read (in some Stackoverflow discussions) that Apple guidelines don't recommend changing the tab bar from its natural position either.
OPTION 2
Have a view controller, say MyController. This will have 4 buttons (arranged next to each other in the middle of the screen, so that they appear like tabs).
Have one UIView object for the top-half of the page.
Have another UIView object for the bottom-half of the page.
Based on which of the four buttons is selected, I vary the content displayed in the top & bottom UIView objects.
Option 2 sounds good to me. But, I wanted to get an opinion on if it's correct, or is there some better way to achieve this? Thoughts please?
You should use a UITextView and set it's inputView as a view with those buttons. It should automatically slide with the keyboard just as you want it.
Hope this helps.
Cheers!
OK, here is where I would start. Two issues; the tabBar and handling the keyboard. The rest is just pushing a popping appropriate view controllers.
The TabBar: First Apple has some example code that deals with the Keyboard Accessory component which is probably how Momento renders their tabBarController like thingie. Here is the link. Their example handles the keyboard in a 'one off' way, unique to this particular app.
The Keyboard: As for a more generic approach to handing the keyboard, you may want to look at Michael Tyson's TPKeyboardAvoiding component on github. Here's the link for that one. The TPKeyboardAvoiding is quite nice in that it is a drop in component that handles keyboard issues for UITableView as well as UIScrollView.
One thing I haven't checked is if Mike's stuff is smart enough to handle the extra height on the Keyboard when it has an Accessory attached. (It's pretty smart though...).
Hope this helps.