This might help you :) 👉 12 Week Flutter Training from Newbie to Expert: heyflutter.com Source Code: github.com/JohannesMilke/shared_preferences_simple_example
Thanks for all the tips in your videos. You make videos differently than everyone else. You are objective, not so fast, nor so slow and I am really enjoying learning from your knowledge. Very good!
Thanks for this great tutorial, but i got this error Field '_preferences' should be initialized because its type 'SharedPreferences' doesn't allow null. - 'SharedPreferences' is from 'package:shared_preferences/shared_preferences.dart' how to fix this?
Excellent .. Thank you so so so Much.... such a beautiful Explanation... You are an excellent teacher... If I had got you as my teacher in my engineering , I would have become Google Pichai... Now I am working as Gate keeper....
You are that great teacher, I have being looking for, just watched two of your videos in RUclips and I fell so much in love with how you simplify different approaches in step and use a more clear examples. I am definitely buying your lifetime access course!!!
Thank you for this video. I've been searching this content throughout the whole internet but couldn't understand it before. Now I know what to do, thanks to you :)
Hey help me. Now this package got Null Safety. Please Make another video on this or help me solve the problem. static SharedPreferences _preferences; above line shows me error due to null safety. how to solve?
have you tried to print out on console all the value you've stored when you reload (hot reload or turn off and turn on the app) ? I applied it in my project, I stored 3 value (example id, username, and imageURL) when I print out all three on console, it returns three but all three have the same value (not separately like id = 1, username = ABC, imageURL = XYZ but id = 1, username = 1, imageURL = 1).
Thank You Nguyen Van Bao Khuong (K15 HCM)! Follow this link: stackoverflow.com/questions/51215064/flutter-access-stored-sharedpreference-value-from-other-pages I hope you will get your answer 🙂
Johannes, I use shared_prefs on web apps but do you know what can I do to persist data between one and another debug sessions? Because when I stop debug or close the browser, I loose shared info saved and the program starts clear again, so I can't test if it is working or not until I deploy it. Is there a way do do it?
Question Is it possible for me to access a shared preference from another flutter app? For example, I have an app (App 1) with a shared preference that is storing a user 'email' and i would like to get that email from another flutter app (App 2)
Can the value stored in textfield be used on different screen ,and if edit on that screen ,will the changes reflect on both the screens .how can this be used to load initial value in textform field. bcos using initial value and controller gives error.
Thank You Mirza Shahbaz Beg! Follow this link: stackoverflow.com/questions/56416126/how-to-get-value-from-textfield-and-display-in-textfromfield-another-screen I hope you will get your answer 🙂
Hello sir I am stuck in the same type issue. I am using an audio player that plays an audio. what I want to do is I want to store the position of the player and when the user re-navigate to the listening screen I want to resume the audio from where the user left. off course the position is of type Duration. need your help sir. if you have already worked on such issue please provide me the link. thanks in advance.
Hey, @Abdul_Hadi_Maliky 🙂 you can make use of shared preference you can store the milliseconds value and reload the music from that stored millisecond value
Hi, I like your videos a lot and as an absolute beginner in programming they are very helpful. I'm wondering if you could explain how to save a rerouting. What I mean is for example: On your homescreen you have a button leading to the page 'list of car manufacturers of the world'. But on the homescreen you can also select within a drop down list (or similar) a location, e.g. Europe, North America, Asia etc. and safe this resulting that the button on your homescreen leads you to a page with only these car manufacturers in that part of the world. Maybe you already explained something like this in a different video? If yes could you tell me which one. You have quite a lot 😁
What is the Maximum size in. Mb we can save in shared preference ? Or how many key pairs value we can save at least. Thanks in advance. As always you are the best.
Nice tutorial! I tried to create an app with the same concept of this tutorial, I only using string datatypes, and it gives me an error "type 'List' is not a subtype of type 'String?' in type cast". I hope you can help me out :)
Thanks for your Tutorial. Flutter_secure_storage and Shared_preferences and Flutter_Session are save data in local storage. but JWT Token save data in cookies. Which once is better and safe? do we need JWT token when we use Flutter_secure_storage or not?
Super stuff. Just perfect. Sad we don't have an option for Int Lists! I see SystemChrome in the start of your programs... Could you share some link/knowledge about this class too? Thanks
@@HeyFlutter thank you. The Flutter docs should have had more info about such an important class. But you've been a greater help. Will send you an email today. Thanks again!
Great Video!! Like some others, too ;) I implemented the SharedPreferences to save my isDarkMode boolen. I also implememted the DarkMode functionality from your other video. But how can I combine this to things? So I just want to save the boolean of isDark and load it when the app opens. I placed my switch button to a separate page.
Love your videos! One thing has me stumped. It's all very well converting a simple list of strings, but how do you convert a list of objects that have their own sub-properties (strings, dates, double's etc...) If you could provide some guidance on this you'll be saving me from a powerful headache :(
as I can see you are so active here and a good trainer . I need to learn 2 things . I don't know you have to teach me privately. I will honor your time how long you will spend with me. Can you help me pls ?
Great tutorial! what the best way to contact you? I am new to flutter but I have been able to build and login application with flutter and mysql but was wonder how should I go about to save to same user id the user got when registering when wanting to att more user details to register id . could this be done with a shared preference or token the gets saved to mysql. I am really stock and really like learn what steps to tackle the problem.
Hello Johannes, i'm having an issue on how to download pdf file from firebase firestore, can you please create tutorial on how to download pdf file from firebase firestore Thanks.
This might help you :)
👉 12 Week Flutter Training from Newbie to Expert: heyflutter.com
Source Code: github.com/JohannesMilke/shared_preferences_simple_example
Thanks for all the tips in your videos. You make videos differently than everyone else. You are objective, not so fast, nor so slow and I am really enjoying learning from your knowledge. Very good!
@@HeyFlutter i want to ask one question, if you are awake, reply me soon
is it possible to write function in firebase in python language?
Johannes the saviour!! thanks man for all the content you share.
Glad to hear that, You are most welcome Prashant Bhardwaj! 😊
Thanks for this great tutorial, but i got this error Field '_preferences' should be initialized because its type 'SharedPreferences' doesn't allow null.
- 'SharedPreferences' is from 'package:shared_preferences/shared_preferences.dart'
how to fix this?
use "late"!
static late SharedPreferences _preferences;
I used shared preferences for storing theme data. This increased my app starting time.
Excellent .. Thank you so so so Much.... such a beautiful Explanation... You are an excellent teacher...
If I had got you as my teacher in my engineering , I would have become Google Pichai... Now I am working as Gate keeper....
Thank you so much man. I found your channel yesterday and I subbed. I hope you keep up the flutter tutorials.
You are that great teacher, I have being looking for, just watched two of your videos in RUclips and I fell so much in love with how you simplify different approaches in step and use a more clear examples. I am definitely buying your lifetime access course!!!
totally agree with you
i'm afraid of shared preferences & always try to avoid it's use but after watching this video i love shared preferences :)
Thank you for this video. I've been searching this content throughout the whole internet but couldn't understand it before. Now I know what to do, thanks to you :)
That's totally what I look for to handle "favorite list" locally. Thank you again "Johannes the super hero! :))))))
Glad it helped, Gökhan Ersoy! 🙂
Your videos are the best! I've never seen anything like that before!
Thanks, @gheorghepascu4726! 🙂
Thank you very much sir for giving best to us. Learning lot from you 🎉✌️✌️
keep going man, useful videos)
Oh man you are so good instructor, thank you alot
thank you :) this is the tutorial i've been looking for
You ARE A LIFE SAVER
The video I've been waiting for😍
thanks for the tutorials, really learnt a lot from you and very inspiring!!
Great work! Very explanatory tutorial...! Thanks!
On dirait que vous lisez dans mes pensées pour faire vos vidéos ...Love You
@@HeyFlutter Merci beaucoup encore une fois monsieur
Thank you so much! You helped me a lot with your videos :)
Merci pour tes vidéos
Thank youu soooooooooo muchhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
I love you man, I LOVE YOUUUUUUUU
Thanks, for your support, @adamsekerka3428! 🙂
Hey help me. Now this package got Null Safety. Please Make another video on this or help me solve the problem.
static SharedPreferences _preferences;
above line shows me error due to null safety. how to solve?
Thank you so much for the explanation :)
great content Johannes...and well explained
Thank you, Thafseer Ahamed! 🙂
Thank you very much :)
Awesome video. Thanks. Subscribed
Great Job.
Thank you Very much
have you tried to print out on console all the value you've stored when you reload (hot reload or turn off and turn on the app) ?
I applied it in my project, I stored 3 value (example id, username, and imageURL) when I print out all three on console, it returns three but all three have the same value (not separately like id = 1, username = ABC, imageURL = XYZ but id = 1, username = 1, imageURL = 1).
Thank You Nguyen Van Bao Khuong (K15 HCM)! Follow this link: stackoverflow.com/questions/51215064/flutter-access-stored-sharedpreference-value-from-other-pages
I hope you will get your answer 🙂
thank you bae!
Johannes, I use shared_prefs on web apps but do you know what can I do to persist data between one and another debug sessions? Because when I stop debug or close the browser, I loose shared info saved and the program starts clear again, so I can't test if it is working or not until I deploy it. Is there a way do do it?
Great videos always thanks
thanks this is informative!!
You are welcome, @bekzodturgunoff!
Best videos as usual 🙂🙏❤
Hello, is it the thing with the null safety and all the update on Flutter 2 ?
how do use the sharedpref... to make the user see the first page of the app only once please
Question
Is it possible for me to access a shared preference from another flutter app?
For example, I have an app (App 1) with a shared preference that is storing a user 'email' and i would like to get that email from another flutter app (App 2)
@@HeyFlutter Which means I can access it even from another app in the same device?
Thank you very much.
if we use column instead of listView then if i reload after clicking on save then value is not stored , why is that?
Hey, @alishthapa623 🙂 Widget type is nothing to do with shared pref data saving. Please try to follow the tutorial step by step
How can i store list of custom class with shared prefrences instead of list of string ?
Awesome!! Keep it up!! 👍
Very helpful video
Can the value stored in textfield be used on different screen ,and if edit on that screen ,will the changes reflect on both the screens .how can this be used to load initial value in textform field. bcos using initial value and controller gives error.
Thank You Mirza Shahbaz Beg! Follow this link: stackoverflow.com/questions/56416126/how-to-get-value-from-textfield-and-display-in-textfromfield-another-screen
I hope you will get your answer 🙂
Hello sir I am stuck in the same type issue. I am using an audio player that plays an audio. what I want to do is I want to store the position of the player and when the user re-navigate to the listening screen I want to resume the audio from where the user left. off course the position is of type Duration. need your help sir. if you have already worked on such issue please provide me the link. thanks in advance.
Hey, @Abdul_Hadi_Maliky 🙂 you can make use of shared preference you can store the milliseconds value and reload the music from that stored millisecond value
Hi, I like your videos a lot and as an absolute beginner in programming they are very helpful.
I'm wondering if you could explain how to save a rerouting. What I mean is for example:
On your homescreen you have a button leading to the page 'list of car manufacturers of the world'. But on the homescreen you can also select within a drop down list (or similar) a location, e.g. Europe, North America, Asia etc. and safe this resulting that the button on your homescreen leads you to a page with only these car manufacturers in that part of the world.
Maybe you already explained something like this in a different video? If yes could you tell me which one. You have quite a lot 😁
Can you show how to save themedata in sharedpreferences? I cant save my toggleTheme
Thank you!
Cool, could you record a lesson about in_app_purchase without RevenueCat
Please make video about this Only one device login limit we need this sir tanx
Useful video. Can you make one to store checkboxlist array and pass value to next page.
What is the Maximum size in. Mb we can save in shared preference ? Or how many key pairs value we can save at least. Thanks in advance. As always you are the best.
so good
@@HeyFlutter what do you think between package flutter_session and shared_preferences good better?
Nice tutorial!
I tried to create an app with the same concept of this tutorial, I only using string datatypes, and it gives me an error "type 'List' is not a subtype of type 'String?' in type cast". I hope you can help me out :)
Great videos man. Do you have a preferred file structure for projects?
very good
Thanks for your Tutorial.
Flutter_secure_storage and Shared_preferences and Flutter_Session are save data in local storage.
but JWT Token save data in cookies.
Which once is better and safe?
do we need JWT token when we use Flutter_secure_storage or not?
@@HeyFlutter But in back_end we need jwt token to send token to shared preferences.
is that correct?
You're a talented man. but we are beginner, hope w=you will teach us from more scratch.
Where is the information stored? Are any files created in memory?
@@HeyFlutter Thank you so much for the great video and for this further explanation
Super stuff. Just perfect. Sad we don't have an option for Int Lists!
I see SystemChrome in the start of your programs... Could you share some link/knowledge about this class too? Thanks
@@HeyFlutter thank you. The Flutter docs should have had more info about such an important class.
But you've been a greater help. Will send you an email today. Thanks again!
Great Video!! Like some others, too ;)
I implemented the SharedPreferences to save my isDarkMode boolen. I also implememted the DarkMode functionality from your other video. But how can I combine this to things? So I just want to save the boolean of isDark and load it when the app opens. I placed my switch button to a separate page.
Thanks u ! but I got still problem "The non-nullable variable '_preferences' must be initialized.
Try adding an initializer expression."
static SharedPreferences? _preferences; and change all to check if is null
Thanks for the video! I got this message error: lib/main.dart:10:27: Error: The method 'init' isn't defined for the class 'UserPreferences'.
The problem the method 'init' was Static. Result => Future init() async {...
Can you do the same with boolean ?
This does not work in release mode
Hey, can you please do a tutorial for Flutter and Firebase Realtime Database.
Love your videos! One thing has me stumped.
It's all very well converting a simple list of strings, but how do you convert a list of objects that have their own sub-properties (strings, dates, double's etc...)
If you could provide some guidance on this you'll be saving me from a powerful headache :(
@@HeyFlutter thanks so much! You're a superstar
As dart 2.9 supports null-safety, we can write birthday??0 which means if birthday is null return 0.
Thank you. Pushing forward bcz of you.
How to create api with dart?
as I can see you are so active here and a good trainer . I need to learn 2 things . I don't know you have to teach me privately. I will honor your time how long you will spend with me. Can you help me pls ?
Great tutorial! what the best way to contact you? I am new to flutter but I have been able to build and login application with flutter and mysql but was wonder how should I go about to save to same user id the user got when registering when wanting to att more user details to register id . could this be done with a shared preference or token the gets saved to mysql. I am really stock and really like learn what steps to tackle the problem.
@@HeyFlutter Thanks you so much trying to solve the problem with connecting shared preferences to a MySQL database will get back to you!
please can you make this method with provider
Thanks for the idea, Ahmed Nasser! 🙂 I have added it to my list of ideas for future videos!
Hello Johannes, i'm having an issue on how to download pdf file from firebase firestore, can you please create tutorial on how to download pdf file from firebase firestore
Thanks.
@@HeyFlutter thanks, that video based on uploading, how can i download the uploaded file from firebase?
@@HeyFlutter thanks.
please make video or youtube video flutter or other network video player in which we decrease the video quality like youtube. Thanks
cool
this video 2 years later is a whole lotta crap to be honest, though thank you for teaching the basics
You are welcome, @raymondkombo3979 😊
M sending you screenshot on your messenger plz check and reply if you understand what u want to do...
creepy as voice :DD but thanks man, u actually provided me with exactly what i was searching for
why
static SharedPreferences _preferences; is giving error??
@@HeyFlutter ill try some other way… thanx anyways
Hello ! did u get solutions?