Sharedpreferences Questions
Ad
Shared pref return always default value on all activities except SettingsActivity
I'm trying to implement dark mode into my app. i decided to use shared preferences to save the current state of dark mode. the problem is that the
How to save users' last read Page Number
I am building an android app which displaying a specific pdf through
PreferenceManager getDefaultSharedPreferences deprecated in Android Q
Preferencemanager getdefaultsharedpreferences is deprecated in
Unresolved reference: getPreferences
I am trying to store a boolean value which is changed every time a button is clicked. i want to do this using shared preferences, however i keep
SwitchPreference not working properly - why so?
I am using switch preference in my preference activity to change app theme but it is not working properly . i can't figure out what am i doing
Array of custom object model won't save to shared preferences
I am trying to do a module where once i fetched the json from the api and i am loading it into ram memory i immediately load it to shared prefs
Will shared_preferences not persist after the app is killed? (flutter)
I noticed this text in the shared_preferences documentation: "data may be persisted to disk asynchronously, and there is no guarantee
Fetching Shared Preferences String Value in Recyclerview Adapter
I want to fetch string value from shared preferences and show it in recylerview adapter. any help will be appreciated this is my code
SharedPreferences returns wrong value
I'm fairly new to android and java, i'm pulling some data from the internet by clicking on an item in a list view, but i need 2 calls to get the
how to update firestore database value correctly
I am working to build basic shopping functions in my flutter app. i'm new to coding and flutter. when the user clicks the
Ad
LateInitializationError: Field 'displayName' has not been initialized in Flutter's Shared Prefrence?
I am creating an flutter application in which i need to store the user information and for some extent i am able to achieve it with shared
Data isn't showen after fetchig it from sharedpreferences
I save data to sharedpreferences, but when i get the data, it isn't shown at the screen. i can print the correct data in the console log, but i am
How to save a list to shared preferences
I want to save a list to shared preferences, but it doesn't work... the goal is to add data to the variable and save it. this is the
How to display a saved list in Shared preferences in another list in another page(Favorite page)?
Hello community, i'm new to the flutter world and mobile app development and struggling with how to display a saved list in shared
How to allow two or more react native apps to share data with each other?
I am working on a poc where i want to share data between two or more apps on the same device. i have read about shared preferences for android but
How to control storing user data using SharedPreferences when logging in and out?
I'm trying to create an app which uses username and password to login, then stay logged in as long as user didn't logout -or didn't delete app
Android - pass data from fragment to new java class
I am trying to pass an integer from a fragment to another java class however i keep getting an error: attempt to invoke virtual method 'int
flutter/ how to save geopoint using shared preferences
I want to know how to save user's geopoint using shared preferences in my flutter app. it has 2 values(lat, long), but the following code was all
Shared preferences must be initialized error
In flutter i have faced with my below error about non-nullable variable. i am using shared preferences package for storing user info in device. i
How can I get preferences from shared preferences in a method that can't by async in Flutter?
I want to get the bool of a shared pref to decide which widget should get loaded, but the method cant be async or to bool cant get the value
When to use Shared Preferences in flutter?
I'm just curious about when is the perfect time to use shared preferences, i know that it is perfect to use it when we have to save login data for
Ad
Is it okay to use shared preferences for big data objects?
I know there are some topics and posts about this question, but i want to have an individual feedback. so in my app i use one shared preferences
Flutter using SharedPreferences with Json for storing an object
I have to store the last loaded weather information, therefor i use tojson method to get a json-file out of the weather-object:
delete one element in a list in sharedPreferences
I'm trying to delete an element in my favoritelist here but this doesn't seem to be working. i've looked on the web but couldn't find
how to use FutureBuilder with Visibility in a widget flutter
It has been days since i am trying to figure out how to keep hidden posts hidden from the user, who has hidden it. i tried filtering with
Count how many times the app is open using shared preferences
I have a widget who should be shown on home screen after a number of app open events. i know i have to use shared preferences, but i don't know
How to read and use shared preference values in initstate()? I can read and use values in other widgets but not in my API which i call in initstate
I am creating a list of businesses through restapi in initstate. i need to use sharedpreference value as one of its parameter but when i try to
How to Create a Custom SeekBar Preference?
I'm trying to create a custom seekbar preference, but android can't seem to find the element. i get
How to use shared preferences without an async method in dart?
I want to show a text in a child of a container in flutter but first i have to use shared preference to get my value, i tried to use
Flutter - Need help on a proper way to use splash screen + Login data with SharedPreferences checking
I am trying to display a splash screen with 3 seconds timer while getting isloggedin value from
How can I get username and password from SharedPreferences in Android?
I am trying to recover the username and password to be able to start a session. these are the users of the sharedpreferences.
how can i store List<object> in sharedpreferences using provider?
So basically this is my provider, what i want is how can i store the model data coming from provider to a shared preferences, and then how to
Ad
How to change toolbar color according to the radio button selected after the second login using android kotlin
I need to change the toolbar color in the second login time according to the radiobutton selected in the
Why does SharedPreferences need two keys?
I'm trying to build a single object that handles all my sharedpreferences, since they are mostly used in the whole app, and i don't
How can I add item to SharedPreferences with out coding in Flutter?
I am new on flutter. i'm using the sharedpreferences to keeping tokens and etc. it works like below. final prefs = await
SharedPreferences putInt method not working
Private boolean rightreviewtiming() { int insertkitcnt = sharedpreferences.getint("insert_kit_cnt",0); insertkitcnt++;
Get value from SharedPreferences without future builder
I need to get one stored value from shared preferences and put it into text widget. how can i do this without a future builder?
Shared Preferences won't save the data
I'm new to android, and a bit to java (don't ask) i want to use the shared preferences, and till to this day everything worked fine, but
Is it possible to store a data from recyclerview by using only SharedPreferences?
I'm new in android and also new in english sorry my bad english... i have learned android course at the academy. the last class was
What is the alternate of shared preference in flutter
I am developed an app, which is almost complete it is in deployment stage. but, now i am in huge problem, i uninstall the app from emulator and
How can i save data in shared Preferences and receive it to another page in flutter
I tried to save data in shared preferences. when i hit in api, with id and pass it gives me token and id. i saved my token in sharedpreferences
how to retrieve a value from shared preferences instantly? - FLUTTER
I'm trying to show a page as an initial login, this is only displayed when my switch value is set to true. the switch value is stored with shared
LateInitializationError SharedPreferences
I am trying to make a singleton of sharedpreferences, but i get a failure of not initialized (lateerror (lateinitializationerror:
Ad
manage login tokens (flutter)
I'm using shared preference in my flutter app and i want to manage login token. this is my auth class : class auth with
save string and associated icon with shared prefs
I'm currently using the shared preferences to save a string list. every time the page is opened, for every string entry from the list i create a
Chaining multiple Method calls at the same time? Example provided
Simply put, i have an if statement with multiple different outcomes, but a lot of code in common. i want to make sure that the
Flutter : Class 'Future<List<String>>' has no instance getter 'length'
I have a list of string saved on sharedpreference in flutter app, i want to call it inside provider and using it in a widget. provider :
Flutter: Using Shared Preferences and set min and max value for a variable
I am using a variable called "int _progs1 = 0;". this variable i can set with a "if statement" to a max and min value, that it
Another exception was thrown: Null check operator used on a null value
I need to use a future builder to get the value of a radio button form shared preferences. but the error occurs when i open the page of the radio
What are the differences between flutter_secure_storage and shared_prefrences in flutter? Why is flutter_secure_storage more secure?
Actually, i've heard that for saving sensitive data, it's better to save it in flutter_secure_storage; but i found nowhere about how
how can i store multiple data in sharedpreferences?
I am getting user information like the username , profile pic and name .i want to store all that info inside sharedpreferences so
How to use shared preference to save user selected language with bloc approach
I have a bloc cubit to change language from english to arabic and when i click on change button the language change successfully , but when i'm
SharedPreferences return null when retrieving values
I am trying to save some values with sharedpreferences as key-value pairs when the app closes or is destroyed and retrieve them when
Get SharedPreferences inside an intent
My problem is that i need information from my shared preferences in an intent. everytime the intent that a wireless
Ad
Android Firebase Service is not getting SharedPreferences value
I am setting sharedpreferences value on my fragment (kotlin) , then i would like to use this value on my firebasemessagingservice (java). when i
How to save the state of the app with the current theme in flutter?
I'm doing the dark mode and light mode for my app but there is a problem with data persistence because when i restart the app my theme goes back
Where can I find the shared_preferences raw json file when running as a MacOS desktop application?
I'm using the well known package shared_preferences to store data. i'm running my flutter app as a macos desktop application, not on
SharedPreferences not working when app re-opens
I am saving a boolean value to my shared preferences but when i re-open my app it doens't work. here is the code public
How to fectch a value from shared preferences?I have future and await problems
My code here: //get data future<object> sharedgetdata(string key) async{ sharedpreferences prefs=await
When I use sharedPreferences in Flutter ,the console reported bugs like this repeatedly?
Error: missingpluginexception(no implementation found for method getall on channel plugins.flutter.io/shared_preferences) at
How can I satisfy '(int) => void' is not a subtype of type '((num) => void)?' exception?
I'm using pref plugin in my flutter project. i have two slider settings for
I want to use shared preferences in flutter, but "Object" type can not be assigned to "bool"
Codes like this: import 'package:shared_preferences/shared_preferences.dart'; sharedutil(string key,object datatype,object data)
How keep user logged in flutter
I posted yesterday this question but i didn't get any valid answer. my current situation is i can successfully log the user in but when i restart
shared_preferences _CastError
The supplied example works import 'package:flutter/material.dart'; import 'package:shared_preferences/shared_preferences.dart';
How to convert String to Time in Hour, Minute, Second as integer in flutter?
I am making an app in that i want to send a notification to the user with the help of the flutter_local_notification package. i want to send a
Ad
Flutter: MVVM architecture with Shared Preferences & Provider
I am trying to build a reusable function of shared preference & provider using mvvm architecture. however, i not sure how to initialize the
How to save a string in sharedPreferences
I have an application where i need to save a string in a sharedpreferences so that the user has already opened the application once and registered
can i save widgets by using shared prefrence in flutter apps?
Is there a way to (set and get) color data type or a list of widgets data type by using shared preference package i want to save the color
Dynamic List in Flutter using SharedPreferences
hello, i'm trying to make an app where i can store data inputted by the user like this one. my task is to use sharedpreferences to
when I print for debug it shows type-->Instance of 'Future<dynamic>' in Flutter
Simply my task is to give a shared data to the variable "type" , please help me out *this sample code is
How do I add an item to a dynamic-list, using a button, to another screen with the list?
I'm not too familiar with flutter and coding in general yet. i'm also very new here so i apologize for any mistakes i might have done when posting
Trying to change colors with SharedPreferences but it is not getting in the right way
I am trying to change colors of some text and mainactivity from a menu. i have two menus, white color and black color, if i click
arraylist containts duplicate values with Shared Preferences
A very strange situation i noticed… private void savefavarticles() { sharedpreferences pref =
override arraylist on shared preferences
I'm saving an arraylist on shared preferences but when i add something new to this array it deletes the old one and displays only the new one.
Multiple sharedpreference for Multiple users, is it necessary?
I stored a list of data in sharedpreference which is only viewable by a particular user, however when i try to login another account i am still
How to properly save data in text field flutter using SharedPreferences?
I'm trying to get the data from the text field via 'save data' button then show that data in text widget when i click the 'show data' button. i'm
Ad
Flutter - Best way to store a List of Objects every time I close the application?
The situation: i'm very new to flutter and mobile development, thus i don't know much about dart; and i've read some
Android / Java | Navigation Drawer's TextView .setText not working through SharedPreferences
I have a fragment that allows the user to change their username that will be displayed in a textview inside a navigation drawer. the fragment,
How to Inject a SharedPreferences Class as DataManager into app?
I'm getting this error while i'm trying to build/rebuild : error: ir.atlaspio.roshdbookstore.di.components.applicationcomponent
Save multiple color data
I started to create/develop a project but at some point i stuck and i couldnt figure it out. hope you to help! for now i am changing the
trying to do color picker in flutter
I was trying to do a color picker for my app in flutter... i installed the mtaerial color picker package from pub dev... then i
How to use "Image_picker" and "shared_preferences" together in the same project
The application works fine when i remove the "image_picker" dependency.when i add back "shared_preferences" gives an
How do I store an integer correctly in the SharedPrefences in Flutter without getting a null?
I want to save an int which i can reuse in a new class. for this i used sharedpreferences. the problem is when i want to open the int
Flutter app login Exception has occurred. PlatformException error
I have a flutter app but every time i login i get an exception error and i have to press f5 to ensure the process is completed. this is the
How does SharedPreferences handle multiple .apply() calls one after the other?
For a small requirement, i need to clear the sharedpreferences and immediately after that call, i need to save a int value. however, the saving of
i want to convert String into Json string in flutter?
I have decoded my response.body i.e var jsondata = jsondecode(response.body); and its working fine but when i convert
Read data using from the device as soon as an app opens in flutter
I am saving the app's theme to the device using sharedpreferences, in this way: void _serializetheme() async {
Ad
how to update the FutureBuilder text every time the shared-preference is updated
I wanted to keep the time data stored in the mobile localcaly so when ever the app is closed and open backed i want it to be shown. that part
Use Shared Preferences in Flutter to data between differente route?
I have a little problem that make me crazy. i created a first time open section in my flutter app that controlled by a flag in my
Shared Preference in flutter Isolate
I'm new to flutter and i just learned how to use isolates in dart. when i try to access shared preference via an isolate it throws the given below
How to access iOS UserDefaults stored data in Flutter SharedPrefrences
I have an ios app already on store, now planning to replace it with flutter with new version
shared Preferences in flutter stop the app
I'm calling shared prefs in page i made as splash screen void initstate() { super.initstate();
How to enable /disable login page in flutter
Please help me master.. i have an application which there is a secure login feature using a password. every time the user opens the application,
Using Multiple Custom Preferences Messes Up, Layout, Preference Titles And Shared Preference Values
I'd created a custom preference view, that is working perfectly when using a single instance of it in my preference screen, however when inserting
SharedPreferences putting in null values inside ValueEventListener
I am trying find the match of right node in my firebase database and save the values to sharedpreferences. i iterate through each node in firebase
Store List<Obj> to SharedPreferences
I want to store list<workforcearguments> to sharedpreferences. import 'dart:convert'; class
How to define MODE of Shared_Preferences in Flutter
In android, we are defining shared preferences mode like getsharedpreferences(string name, int mode)
user still logged in after logging out
I was making an app using flutter and i have used shared_preferences package, and in auth stage i am facing an issue where when i build app user
Ad
How to pass DatabaseReference to class in android while using intent?
I'm using intent to call a service class which extends some other class (other than intent). i want to pass databasereference while
Best way to store global data in AsyncStorage or redux?
I am developing a feature like a cart of which data i want to use in multiple screens. also, want to manage the view cart and clear cart items but
Ad
Blog Categories
Ad