I have a listView.builder inside my Language screen, and i want to save preferences when the language is selected, a checkmark will appear next to.
Language localization work perfectly and also the listView with a radio button checkmark. but when i close the page and come back, the checkmark go back to default language even the current language is still the what user choose.
So, should i load the current language everytime the Language screen is open or should I use Shared preferences to store the checkmark position?
You can use two options:
Save it in Shared preferences.
Save it in your database.
This option is very good in the situation when you have a mobile app and web.
Because it saves profile parameters globally.
Another option that I like is to simply use system locale parameters.
If a user has English language on his phone my application is the same.
But this option is not for web only for mobile applications.
Related
I'm trying to add a favorites feature with flutter. If you activate it by clicking the Favorites button inside the page, you need to implement it so that the Favorites page marked as Favorite appears in the page selection window. getx was too complex to implement, so I gave up on it. Are there any other attractions or advice pages?
I've seen shared_preferences: ^2.0.7, but it's my first time developing an app, so it's difficult to develop because there are no examples.
You could have a statefull widget on Page selection where you read from preferences in init state and give that value to the favorite icon (e.g. true icon color is red, false -> white). And pass a function such as (setState(() {favorite = !favorite});) to the second page. Then if user click on the favorite button on page 2 and navigates back, the color will change. Also don't forget to save it on prefs when you click the iconButton.
You might want to have a look to this flutter cookbook. While this will not teach you about shared preferences, it will basically implement the other functionalities you want. It's actually a great way to start learning Flutter which new Flutter users.
Once you understand this cookbook and feel confident, you might want to have a look at this flutter tutorial on shared preferences which is beginner friendly as well.
If you would take an advice, I would urge you to start with as little dependencies as you can and use them only when you need them. If you are new to flutter, and for a simple app, GetX is not needed and will disturb you more than help you.
I am developing a iphone app in different language and now i have to change the key panel layout.
Image is given below
I want to change the return button text in different language . This can be possible? If it is, then give me some advice for that.
The language of the keyboard is the user's choice. If he's from Germany he probably set the OS and the keyboard to German too. Try going to the Settings app and change the keyboard.
I'm developing an iphone app and want to have the option to programmatically change the language. For example the user can change the language for spell checking and auto-correction by tapping on the world icon on the iphone keyboard, but the problem is that my app has a custom keyboard so I dont have that key.
Is there a way to create a functionality similar to that world icon key so that I could offer language choices available on the device and the user could select one?
I think Milad isn't asking how to change the language per se, but how to change the keyboard type. If so, then I don't think this is possible.
Don't forget that a certain keyboard doesn't necessarily lock into a specific language, like how I can type English using Japanese keyboard. And that certain languages have several keyboard types (Chinese has 3 or 4).
At runtime for the app, I want the user to be able to select the keypad language. And when the app is finished for it to switch back.
Thanks
You could not do it programmatically but there is one option is available in keyboard itself.
Go through the following post, will helpful for you
Change Your Keyboard or Display Language in iOS
Setting the iPhone keyboard language
I don't think that there is a programmatic way to enforce this. You can inplemet your own custom input if you want.
In the Preferences app, Safari's settings page contains buttons labeled "Clear History" or "Clear Cache". The Mail App's settings page contains a big red "Delete Account" button.
Is there a way to create such a settings page with buttons for my app? I checked Apple's documentation and didn't find an element type for such buttons.
Sadly I think you're out of luck - unless you jailbreak. To create the Settings page for your app you create a plist rather than actually coding the view itself. This brings certain restrictions such as the inability to add a button. The one core thing you can't do is to execute any code from the Settings app - all you can do is change a set of preferences.
The closest you can get is to add a switch with the label "Clear History on next starup" and check whether the user has set this whenever you start the app. Then set the settings so that the switch is set to Off.
AppStore apps — You can't. Even if you can add a button, no code can be run, making this useless.
Jailbroken apps — Use a PreferenceBundle and create a PSButtonCell specifier. See http://www.iphonedevwiki.net/index.php?title=Preferences_specifier_plist.