How to make custom spinner in flutter? - flutter

So, I want to make a custom spinner as you can show in the image.
Basically, a List of data will display and the mid one shows highlighted.
This design is for blood group selection. Mid data will be automatically stored in some variable.
like String selectedBg = B+;

The one you're looking for is called the Picker, and you can look at Flutter's documentation about it.
Cupertino Picker

Related

show and hide tabs dynamically in touch ui -AEM

I have a requirement, where I need to show few tabs on selection of a value from a drop down.
I have done this in classic UI. But not sure how to proceed for Touch UI. I know that we can use JQuery, Can anyone let me know the approach I can use.
Its fairly simple, look at the OOTB List Component /libs/foundation/components/list. The selection dropdown is defined - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom, look at property class and cq-dialog-dropdown-showhide-target these are used to manage hide and show.
Now from here look at the dropdown values under - /libs/foundation/components/list/cq:dialog/content/items/column/items/listFrom/items these values trigger the hide and show mapping to property showhidetargetvalue as in /libs/foundation/components/list/cq:dialog/content/items/column/items/setDescendants

iOS: Search Options UI

I am building an iPhone app for a library and I want to give few options to the user to search books by. A user can search a book by title, author, topics, or date of publication.
What I want to know what's the best way to display these search options to the user? In terms of HTML, it would be easy - either use a drop down list or radio buttons. I tried using UIPickerView but honestly, that looks terribly ugly and destroys the aesthetics of the view of my app.
The other option I was thnking was using segmented control, but is it possible to have a vertical segment control in stead of horizontal one? The selection texts can be too long.
Any ideas?
If you want a vertical segmented control, you'll have to make it yourself. Create a textured image with dividers. I would export each section as a PNG separately. Then create a picture of each section with the "pressed down" gradient and export each segment as a separate PNG again.
I would then make a new class. If there is a specific number of objects in your segmented control or this is a one time thing, the class may not even be necessary. If not, then in the class constructor pass an array with the titles of the segments in your segmented control. For the first and last objects, use the pictures you made with rounded corners. For the objects in between, use the standard pictures. Then put the titles on top. When a segment is tapped (perhaps use hidden UIButtons), you can use a delegate method to tell the main search class which one was tapped, and then the class can replace the normal picture of that segment with the pressed down one.
Thanks for the options.
I ended up creating a simple table to show my choices.
User clicks on "search by", which opens up the table with options and then when you select any option, you return back to main view with the chosen search option.

GWT Celltable column with label and image

I am looking to add a label and image to a CellTable column, with following requisites:
- Label should be followed by an image.
- Click on the column (anywhere on label or image), toggles the image.
I am thinking of creating a custom widget containing an HorizontalPanel. Which in itself contains the Label and Image. Before putting substantial time on the same, just want an confirmation whether this approach is proper ?
No, you cannot put a widget in a CellTable. You will have to make a custom cell (extend AbstractCell) and generate HTML directly.
Take a look at GWT's implementation of different cells to see how they achieve clicking, etc. There are no nice ClickEvents, for example - you have to respond to the browser events directly.
To toggle an image you will have to re-draw the entire table, or use crazy javascript that you don't want to use.

Scrollable view with text and ability to do something when specific phrase is tapped

I am trying to implement a view which will load text from sqlite database (every sentence in a text will have unique tag in database) and will allow to execute some code while sentence is clicked (on-click executed method should then scroll clicked sentence to the center of the screen and change it's color/background color/font size to emphasize it)
Is it possible without using webview and js/js-native bridge? Which approach should be taken to implement such a view? Any help and comments highly appreciated!
Hmm, you could also considering using NSAttributedString together the Core Text Framework and attribute each sentence and attach some extra info about. Next you lookup the attribute below the tap position of the view. Once you have that you can retrieve the extra info again and do whatever you want with the tap.
After the tap you could then alter the properties of that part of the text. E.g. different font colour etc.
This tutorial on the internet looked interesting:
http://www.raywenderlich.com/4147/how-to-create-a-simple-magazine-app-with-core-text

Alternatives for picker in iphone/iOS app?

I am showing a form the user fills in my iPhone app. One of the fields is a set of 2 or 3 dates from which the user has to pick one. Putting a picker, or bringing up a table view just for this takes up too much space, leaving no room for the other fields. Is there any simpler way to do this?
To do this you can put two or three arrowed label with text like "Select Date" upon click of it you can show one view that allow user to select the date; once selected you can back to the original view. You can do this for all three (or two) dates and get those date on form view.
I am giving you idea of how you can design apps; if you want code i can assist that too but from your question it seems you want design ideas.
You can go for your custom drop down/combo box, but their is no inbuilt functionality present for this.
Also following is mentioned in apple HIG guideline, you need to consider those as well-
(http://developer.apple.com/library/IOs/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html)
Guidelines
Use a picker to make it easy for people to choose from a set of values. It’s often best to use a picker when people are familiar with the entire set of values. This is because many, if not most, of the values are hidden when the wheel is stationary. If you need to provide a large set of choices that aren’t well known to your users, a picker might not be the appropriate control.
Consider using a table view, instead of a picker, if you need to display a very large number of values. This is because the greater height of a table view makes scrolling faster.
Use the translucent selection bar to display contextual information, such as a unit of measurement. Do not display such labels above the picker or on the wheel itself.
On iPad, present a picker only within a popover. A picker is not suitable for the main screen.