shared_preferences (Package of the Week)

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 72

  • @scottgreen3703
    @scottgreen3703 2 ปีที่แล้ว +59

    This is the first plugin i looked for when i started learning flutter

    • @muhammadahmadkhan5046
      @muhammadahmadkhan5046 2 ปีที่แล้ว +3

      Your previous development experience should be android development.

    • @niralnaik16
      @niralnaik16 2 ปีที่แล้ว

      +1

    • @niralnaik16
      @niralnaik16 2 ปีที่แล้ว +1

      @@muhammadahmadkhan5046 that's also true 🥳

    • @merlinchiodo8943
      @merlinchiodo8943 2 ปีที่แล้ว +1

      Why do i see this just now after 3 months of programming haha

  • @Rick-ng3lr
    @Rick-ng3lr 2 ปีที่แล้ว +23

    I didn’t know there’s no guaranteed write with shared_preferences. Good to know. Thx!

    • @HarveyJoness
      @HarveyJoness 2 ปีที่แล้ว +2

      well, it is up to the condition of the storage of your device.

    • @dllizheng
      @dllizheng 2 ปีที่แล้ว +1

      @@HarveyJoness what does that mean?

    • @HarveyJoness
      @HarveyJoness 2 ปีที่แล้ว +2

      @@dllizheng If your storage is full or not working properly for any reason it's not guaranteed to save your data as it is told in the video.

    • @dllizheng
      @dllizheng 2 ปีที่แล้ว

      @@HarveyJoness Doesn't it return an error or throw some exception when saving?

    • @HarveyJoness
      @HarveyJoness 2 ปีที่แล้ว +1

      @@dllizheng Yes it does. But If your storage is broken someway after you saved your data succesfully, there is no chance to save your data back. And obviously no chance to throw an exception.

  • @luchitv1
    @luchitv1 2 ปีที่แล้ว +22

    Flutter dev.. please look into the device default fonts to be used instead of the Flutter default. It is very important. Make the Flutter apps to adapt to the selected default fonts on the device.

    • @keidev7717
      @keidev7717 2 ปีที่แล้ว

      flutter is already implemented this by default

    • @luchitv1
      @luchitv1 2 ปีที่แล้ว

      @@keidev7717 no it doesn't work. The app uses default font of flutter instead of the device selected fonts

    • @mohamedayman5240
      @mohamedayman5240 ปีที่แล้ว

      whats the problem with that .. u will use your custom fonts anyway

  • @MehediHasan-co5qz
    @MehediHasan-co5qz 2 ปีที่แล้ว +2

    Love you Flutter❤️❤️❤️

  • @StemLG
    @StemLG 2 ปีที่แล้ว +3

    get_storage is another cool persistent storage widget

  • @what-tk9cc
    @what-tk9cc 2 ปีที่แล้ว +2

    Hive > sqflite > shared_preferences

  • @kartikgarasia5685
    @kartikgarasia5685 2 ปีที่แล้ว +7

    Alternative to this hive!

  • @Вальдемар-п6г
    @Вальдемар-п6г 2 ปีที่แล้ว +4

    This a package of decade))

  • @crazy-man
    @crazy-man 2 ปีที่แล้ว +12

    also a good package, but get_storage package is more convenient, only I use it now because I don’t need to use async

    • @SethuSenthil
      @SethuSenthil 2 ปีที่แล้ว +1

      This is so true. It often times makes life so much easier too, no need for unnecessary future builders for reading simple values from the disk. Wish I knew this before!

    • @biigsmokee
      @biigsmokee ปีที่แล้ว +1

      Do not use getx-based packages, they are bad

    • @hydernotes
      @hydernotes ปีที่แล้ว

      I'm getting.init() error in get storage. I'm thinking to revert back to the shared preferences.

  • @HarutakaShimizu
    @HarutakaShimizu 3 หลายเดือนก่อน

    This is a legend🔥

  • @umitkirtil
    @umitkirtil 2 ปีที่แล้ว +6

    Auth tokens ? Is it a bad practice to save user token to shared pteferences ?

    • @desther
      @desther 2 ปีที่แล้ว +13

      It would be better IMO to use flutter_secure_storage for this usecase.

    • @umitkirtil
      @umitkirtil 2 ปีที่แล้ว

      @@desther thnk you very much. i will look into it

    • @raglandasir6885
      @raglandasir6885 2 ปีที่แล้ว

      If Flutter uses local storage for the web to store shared_preferences, then it could be a problem

    • @umitkirtil
      @umitkirtil 2 ปีที่แล้ว

      @@raglandasir6885 hi i use flutter for mobile only. but flutter_secure_storage looks more useful

  • @te6989
    @te6989 2 ปีที่แล้ว +1

    For unknown reason, on some iPhone, the shared preference doesn't work
    We tried on two same model of iPhone with the same OS version, but on one it works like a charm but not on the other one

  • @michalstefanak9914
    @michalstefanak9914 2 ปีที่แล้ว +2

    Is there something to save files in the local storage? Like songs in music directory on Android. Or just saving in Download dir.

    • @flutterdev
      @flutterdev  2 ปีที่แล้ว +1

      Hello Michael, we'd recommend checking out the following guide for the shared_preferences Package of the Week: goo.gle/3yWIowo

  • @ChrisHalden007
    @ChrisHalden007 2 ปีที่แล้ว +2

    Great!

  • @AntonioMdrtt
    @AntonioMdrtt 2 ปีที่แล้ว +2

    Nice!

  • @joeng7424
    @joeng7424 2 ปีที่แล้ว +2

    Deja Vu? I thought this package was mentioned long ago?

  • @richardjecooke8036
    @richardjecooke8036 2 ปีที่แล้ว

    So how do we store data across devices in local storage, where we *can* rely on it being written to disk?

    • @Abdullah-vp2tl
      @Abdullah-vp2tl 2 ปีที่แล้ว

      You can use dart:io library but it doesn't support web applications

    • @richardjecooke8036
      @richardjecooke8036 2 ปีที่แล้ว

      @@Abdullah-vp2tl Yeah, there's no way of doing it, I looked at all packages. And then I realised a PWA works on web, mobile, and desktop, so I gave up on Flutter and went back to advanced web dev.

  • @mike2005546
    @mike2005546 2 ปีที่แล้ว +1

    not DataStore in Android???

  • @dammy_tv
    @dammy_tv ปีที่แล้ว

    Is shared preferences secured?🔐

  • @sumanmitraYTC
    @sumanmitraYTC 2 ปีที่แล้ว +1

    anyone using Hive instead of shared_preference?

    • @what-tk9cc
      @what-tk9cc 2 ปีที่แล้ว

      Most would prefer hive over shared_preferences

  • @sharmis5531
    @sharmis5531 4 หลายเดือนก่อน

    can anyone help how to set MODE_PRIVATE in sharedPreferences

  • @PlayingCode
    @PlayingCode 2 ปีที่แล้ว +2

    If this is not reliable then what to use for critical info storage?

    • @noahderebe
      @noahderebe 2 ปีที่แล้ว +1

      sqflite and other persistent storage methods.

  • @PRATAPSINGHSHEKHAWAT
    @PRATAPSINGHSHEKHAWAT 2 ปีที่แล้ว

    Already using.

  • @mrwalkan
    @mrwalkan 2 ปีที่แล้ว +2

    1:46 I think they mean encryption not persistent.

    • @yaqub3567
      @yaqub3567 2 ปีที่แล้ว

      So never ever try to save widgets state with this package

    • @michasengotta2295
      @michasengotta2295 2 ปีที่แล้ว +5

      No they meant "persisted", because preferences may also be stored in temporary memory, for instance if a user uses the incognito mode in their browser.

  • @feruzboymuratov
    @feruzboymuratov 2 ปีที่แล้ว +1

    First like and firs comment. Google wait for me. I'm coming as a developer from Asia

    • @crazy-man
      @crazy-man 2 ปีที่แล้ว +3

      we are all waiting for you)

    • @flutterdev
      @flutterdev  2 ปีที่แล้ว +1

      You got this, Feruz! Happy Developing 🥳🙌

  • @Drasius
    @Drasius 2 ปีที่แล้ว +2

    hive for me

  • @Horizon-tr6iy
    @Horizon-tr6iy 2 ปีที่แล้ว +3

    Hive it's better

  • @naxcall
    @naxcall 2 ปีที่แล้ว

    Get storage for me 😆

  • @navasshareef1990
    @navasshareef1990 2 ปีที่แล้ว

    😍

  • @TheCodeWhisperer0o0
    @TheCodeWhisperer0o0 ปีที่แล้ว

    Yo Yo, she talks so fast! I'm gonna have to download the video and slow it down

  • @amitmondal7427
    @amitmondal7427 2 ปีที่แล้ว

    But shared preferences deprecated.

  • @eraysona
    @eraysona 9 หลายเดือนก่อน

    this is too theoritical we need more code more examples. at least I need

  • @kawhao3757
    @kawhao3757 2 ปีที่แล้ว

    Wow

  • @dadisuperman3472
    @dadisuperman3472 8 วันที่ผ่านมา

    Flutter is a carbon copy of Qt.

  • @subrotoxing8214
    @subrotoxing8214 2 ปีที่แล้ว +10

    skip this... and go hive....

    • @jousis_
      @jousis_ 2 ปีที่แล้ว +1

      Isar ftw !
      (By the same dev)

  • @wafienezi4137
    @wafienezi4137 2 ปีที่แล้ว

    If you make channel with Arabic language plz

    • @flutterdev
      @flutterdev  2 ปีที่แล้ว +1

      Auto-translate is now available on all channels. Click on settings, subtitles and auto-translate to pick the language you would like ✨

  • @werrutkyupnext
    @werrutkyupnext 2 ปีที่แล้ว

    bro I am not willing to take 17,000 hours and 23 tb of storage just to install flutter, I wanted to do this at first now I am uninterested... please make easier to install