Hive (Flutter Tutorial) - Lightweight & Fast NoSQL Database in Pure Dart

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

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

  • @simonleier502
    @simonleier502 5 ปีที่แล้ว +58

    Great video and very well written tutorial. Good job! I added your video to the documentation.

    • @ResoCoder
      @ResoCoder  5 ปีที่แล้ว +6

      Thanks for the library again, Simon!

    • @rebarius
      @rebarius 4 ปีที่แล้ว +7

      @Simon Leier oh yes wanna thank you also sooo much for thie great package 👏🏼 Greatest feature for me is the possibility to save whole dart objects :)

    • @HarshSingh-hk8fe
      @HarshSingh-hk8fe 3 ปีที่แล้ว

      hi sir, can i store my shopping app cart list in hive thank you :D

  • @FilledStacks
    @FilledStacks 5 ปีที่แล้ว +78

    Awesome. Hive looks like a much more viable option than SQLite to me in terms of simplicity and ease of setup and use. Thanks for the tutorial.

    • @rossthemusicandguitarteacher
      @rossthemusicandguitarteacher 4 ปีที่แล้ว +10

      The two best coding channels for me at the moment. Much love and thanks for all the help.

    • @FilledStacks
      @FilledStacks 4 ปีที่แล้ว +9

      @@rossthemusicandguitarteacher Thanks Ross! I love myself some ResoCoder too :)

  • @Hypothermia1337
    @Hypothermia1337 4 ปีที่แล้ว +4

    Most underrated flutter-tutor on youtube! Love your work, it's keeping us folks on coding with flutter! Props to you mate!

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

    You're really important to the community, Reso! Thanks!

  • @Klausi-uq4xq
    @Klausi-uq4xq 3 ปีที่แล้ว

    I started today with hive...at the beginning hard to unterstand things like typeadapter and so..i fumbeld round about 2 hours with generating of the .g.dart File..because Null Safety Problems from Others dependencies..but now hive is very fast and very nice to handle, Not Like sqlite3 or so. Thank you for this tutorial which i found just a hour later after i solved much of the shown ways alone or by Stack Overflow 🤣

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

    Thanks, very well made tutorial and useful. I was considering to switch to Hive earlier already for storing app settings. After this I am convinced and with a good and easy to follow guide.

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

      I'm glad you found this useful, Mike!

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

    Very helpful video, much better then documentations for doing it first time.

  • @dan3f
    @dan3f 4 ปีที่แล้ว

    Basic question: What would be the difference if instead of using:
    > final contact = contactsBox.get(index) as Contact;
    I used this:
    > Contact contact = contactsBox.get(index);

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

    Best channels for learning flutter....thankyou

  • @wSRV
    @wSRV 5 ปีที่แล้ว +4

    Great tutorial. And the same for the others on your channel. Keep up the great work, yours is definitely a really good channel to learn Flutter and various libraries!

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

      Thank you!

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

    I solved that analyzer stuff by just using pubspec assist and providing analyzer package that was 2 versions down. That way, when the issue is fixed all i need to do is make the package version empty then run pub upgrade

  • @mostafafahimi4588
    @mostafafahimi4588 3 ปีที่แล้ว

    Every second of this video was useful for me. Thanks.

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

    Great tutorial. Is there a flutter hive client/data visualiser to inspect boxes?

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

    Thank you. What do you think about Hive + Firestore implementation?

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

    The build runner failed until I modified the @HiveType annotation to read @HiveType(typeId:0). I am using build_runner version ^1.11.1. I am really enjoying this process. Thanks.

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

    Thank you very much for this wonderful tutorial!!

  • @saicharansigiri2964
    @saicharansigiri2964 4 ปีที่แล้ว +4

    when you said "AUTOINCREMENT" at 18:00 when deleted a contact will it " AUTO DECREAMENT" i mean the KEY

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

      don't think so. That's now how Auto Increment works

  • @Baraka0369
    @Baraka0369 4 ปีที่แล้ว

    Nice design dock and window btw ! What did u use ? Rainmeter ? And which package ?

  • @MrHimanshun
    @MrHimanshun 3 ปีที่แล้ว

    Great tutorial, very clear and concise. I had question though, Is there a way to implement search with hive??

  • @ManOnTheMoon2131
    @ManOnTheMoon2131 4 ปีที่แล้ว

    This was incredibly helpful. Thank you! Subscribed!

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

    Great walk through of Hive, but outdated. Lots of updates in current version 2.0.4 not covered in your tutorial. Would be great to see an updated version. E.g. typeId is required to generate type adapter now and when registering an adapter, typeId cannot be passed as shown in video. I'm sure it's a pain to stay current with updates on packages. Problem is you make tutorials that are too good so we expect you'll keep them current with every minor version update of any package. :)

  • @gmc254quads6
    @gmc254quads6 5 ปีที่แล้ว

    Nice tutorial and thanks for clarifying some stuff for me. On the build _runner/Dart analyzer thing. I shared the same experience but while creating a generator/build library. I almost went mad.

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

      I feel you 😰

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

    WatchBoxBuilder got depricated! Now its used ValueListenableBuilder.

  • @aytunch
    @aytunch 4 ปีที่แล้ว

    Superb. Matej, I have somewhat of an unrelated question to Hive. It occurred after you used compact() inside of dispose override. I guess compact() is a sync method. However for the sake of argument, what if it was an async method. Can we use an async call inside of dispose()? I could not find any info on SO. Thanks man.

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

    Hello
    Ahmed from Egypt
    I enjoyed a lot of explanation of flutter
    I would like you to help me think
    I started creating an app to create merchant accounts
    I will use an internal database
    I would collect a column and use the sum again
    Do I use sqflite with flutter
    Or use a package from no sql database packages

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

    Great content.. Thanks!
    One suggestion, @13:19 wouldn't returning "Center > CircularProgressIndicator" be better UX? than showing blank white screen

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

      Absolutely! There goes my UX prowess, I guess 😅

  • @andrewjackson1833
    @andrewjackson1833 4 ปีที่แล้ว +4

    Getting issues with typeId, had to add typeId to the generator and remove from registerAdapter, eg: Hive.registerAdapter(ContactAdapter()); @HiveType(typeId: 0) using hive: ^1.3.0, hive_flutter^0.3.0+1, hive_generator: ^0.7.0

    • @verryondrums
      @verryondrums 4 ปีที่แล้ว

      Thanks, ran into that as well :)!

    • @alexandrufilipescu1301
      @alexandrufilipescu1301 4 ปีที่แล้ว

      I am not sure why I can't add a typeId:0 to registerAdapter()....

  • @easazade
    @easazade 4 ปีที่แล้ว

    hi, what kind of database do you use for your projects? hive? moor? etc? any recommendations?

  • @GabrielCosta-xr5vr
    @GabrielCosta-xr5vr 4 ปีที่แล้ว

    Is Hive better than Sembast? Sembast has queries so I was wondering if Hive can outperform Sembast even without queries for now..

  • @kartikshrivastava1500
    @kartikshrivastava1500 3 ปีที่แล้ว

    What is the search performance of hive? In case of millions of entries, is it suitable?

  • @ahmadfarhat1014
    @ahmadfarhat1014 4 ปีที่แล้ว

    what vscode extension are you using to get tree-like parent-child , looks beautiful

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

    Where are we defining box name as contacts ?

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

    Compact is a deep english word, it couldve been better if you shown an animation of how it works under the hood(like showing a real world example). I really did not understand seeing the `compactStrategy` and cant image how it works under the hood. However it is a good tutorial tho. I just do not get the use of the `compactStrategy`.

  • @43_arshadsaiyed78
    @43_arshadsaiyed78 3 ปีที่แล้ว

    Which plugin you are using for brackets?

  • @vinayp-20
    @vinayp-20 4 ปีที่แล้ว +2

    I might be asking a dumb question. Can Hive be used as a statemanagement as well? By creating different box

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

      Technically, yes. But provider is just as good, simple and optimized as it gets, so it's probably better solution

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

    Does anyone else have issues with the part file not being created after running the build runner? :( It is building successfully for me but I don't get a part file..
    Edit: figured it out, the part name needs to match your file name, not the class name.

    • @el4040
      @el4040 3 ปีที่แล้ว

      thank you

  • @marbenvillaflor6236
    @marbenvillaflor6236 4 ปีที่แล้ว

    I'm having the same problem here.
    I'm a beginner in flutter, I'm wondering why it is still error, I already follow about what should be the remedy. If I remove the carat notation and type flutter clean, and flutter pub get or just flutter pub get, it gives me this error.
    Because every version of flutter_test from sdk depends on path 1.8.0-nullsafety and hive >=0.4.1 =1.6.0 =0.4.1

  • @HarshSingh-hk8fe
    @HarshSingh-hk8fe 3 ปีที่แล้ว

    ​ @Reso Coder hi sir can i store my shopping app cart with hive ??

  • @migoivn
    @migoivn 4 ปีที่แล้ว

    Great video! Thank you so much.

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

    How can we make sure that the application doesn't load data from firestore every time it starts ? Only fetch when some changes is done in the database.

    • @EverisXD
      @EverisXD 4 ปีที่แล้ว

      wdym firestore lmao

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

    it has been 2 years you should update codes!

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

    Love your content Sir.....

  • @ruslanssmolonskis9170
    @ruslanssmolonskis9170 5 ปีที่แล้ว

    Hello. I have a problem to find way how to make Flutter app which uses pre-populated database with some tables. Do you have any tutorial for that?

  • @PaulMcKillop
    @PaulMcKillop 3 ปีที่แล้ว

    The build fails reporting that the abstract class ContactAdapter is missing implementation of members. Did I miss something?

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

    Does Hive.openbox('contacts') will not be called every time build() is called? The doc (api.flutter.dev/flutter/widgets/FutureBuilder-class.html) says: "If the future is created at the same time as the FutureBuilder, then every time the FutureBuilder's parent is rebuilt, the asynchronous task will be restarted."

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

    Does it support windows? And can I back up my data and load it on another platform?

  • @MindzGroupTech
    @MindzGroupTech 4 ปีที่แล้ว

    Ok you got my subscription ... You are being so awesome

  • @rvng6
    @rvng6 3 ปีที่แล้ว

    Is it one key for one value ??
    I mean lets say i want to save a user data
    Means everytime new user i need new key or it will be overwrite ?

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

    how i can get the same box value on other page but within same project

  • @kopianan
    @kopianan 5 ปีที่แล้ว

    i got the problem for my error
    void main() async{
    WidgetsFlutterBinding.ensureInitialized();
    var appDocumentDir = await path_provider.getApplicationDocumentsDirectory();
    Hive.init(appDocumentDir.path);
    runApp(MyApp());
    }
    add this WidgetsFlutterBinding.ensureInitialized();
    before you get the path

  • @AshishGupta16
    @AshishGupta16 4 ปีที่แล้ว

    best hive video out there!! thanks :)

  • @armagan_gok
    @armagan_gok 3 ปีที่แล้ว

    where is the starter project link? please type it down I could not find it

  • @oldmen2544
    @oldmen2544 3 ปีที่แล้ว

    Hey my question is do I need to ask for permission from user something like internal storage permission etc, or I can simply use it without permission as it is and in what file format it stores your data and where 🙄🙄 please help me out

  • @SkShofiul
    @SkShofiul 5 ปีที่แล้ว

    finally new lightweight database !

  • @4funrc11
    @4funrc11 5 ปีที่แล้ว

    WOW! Impressed... Thx!

  • @MoAdel92
    @MoAdel92 3 ปีที่แล้ว

    what is the vscode extension that tracing draw lines e.g between return and build?

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

    Hey bro, hydrated_bloc or hive for ecommerce shopping cart for unregistred users? Thank you

  • @lainhathoang
    @lainhathoang 3 ปีที่แล้ว

    Can you give me the name of the theme u used for your vscode?

  • @oblakus
    @oblakus 4 ปีที่แล้ว

    Great tutorial 👍

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

    I m getting 'type 'String' is not a subtype of type 'Contact' in type cast' error on this line 'final contact = contactsBox.get(index) as Contact;' Thank you

    • @JeremyWestAU
      @JeremyWestAU 3 ปีที่แล้ว

      Did you ever manage to resolve this? I have the same issue and literally can not find a solution.

    • @RNMERIA
      @RNMERIA 3 ปีที่แล้ว

      @@JeremyWestAU sorry cant recall it nw

  • @gourav7315
    @gourav7315 4 ปีที่แล้ว

    Please make more Hive Flutter Video

  • @radouaneelayachi4878
    @radouaneelayachi4878 4 ปีที่แล้ว

    Is there anyway that you can do search in db with Hive ??
    there is No Where clause !!!!

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

    Is hive able to handle millions of items, is there a limit?

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

    Your content saved my day.... ❤️❤️❤️❤️ Great content...... Keep posting bro you are amazing.....

  • @igorbondarenko9854
    @igorbondarenko9854 5 ปีที่แล้ว

    Thanks for your work, what about floor?

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

      I'd rather go with Moor if you want SQL.

  • @himanshudhakecha1789
    @himanshudhakecha1789 4 ปีที่แล้ว

    helpful, Thanks for sharing

  • @nicolasdupere
    @nicolasdupere 4 ปีที่แล้ว

    You are so good.

  • @brianmanuputty4412
    @brianmanuputty4412 5 ปีที่แล้ว

    very useful, thank you

  • @DKSTechnology
    @DKSTechnology 3 ปีที่แล้ว

    In Flutter can we create a copy of hive cluster as a backup 🙄

  • @usefulteam
    @usefulteam 4 ปีที่แล้ว

    Hi @Reso Coder,
    What line identation guide extension do you use (the highlighted lines of method/ properties)?
    E.g: Scaffold has highlighted lines for appBar and body and their childs.
    I've searched through vscode extensions but couldn't find it.

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

      It's actually part of the flutter/dart extension. just add "dart.previewFlutterUiGuides": true, to your settings!

  • @wickedgummybear3104
    @wickedgummybear3104 4 ปีที่แล้ว

    Is it possible for you to update this? I'm trying to get this to work with the new Flutter version etc but it seems to keep crashing..

  • @gokulakrishnan1977
    @gokulakrishnan1977 4 ปีที่แล้ว

    Please tell me list if extension used by You.

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

    Is there any possibility to see the data stored in the boxes?

  • @etiennetheodore
    @etiennetheodore 5 ปีที่แล้ว

    Thanks like always.

  • @Hypothermia1337
    @Hypothermia1337 4 ปีที่แล้ว

    After adding items to my box and reopening the app, im getting an error:
    Unhandled Exception: RangeError: Not enough bytes available.
    I can't find a proper solution for this.
    Anyone know's what to do?

  • @yemenpoint_com
    @yemenpoint_com 4 ปีที่แล้ว

    Thanks boooy your the best

  • @ravichudgar
    @ravichudgar 4 ปีที่แล้ว

    can we give the primary key in hive ???

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

    Just in case someone else is stuck at the same point as me where he talks about the WatchBoxBuilder. Down below in the comments is the solution which I modified a little:
    Widget _buildListView() {
    final contactsBox = Hive.box('contacts');
    return ValueListenableBuilder(
    valueListenable: Hive.box('contacts').listenable(),
    builder: (context, contactsBox, _) {
    return ListView.builder(
    itemCount: contactsBox.length,
    itemBuilder: (context, index) {
    final contact = contactsBox.getAt(index) as Contact;
    return ListTile(
    title: Text(contact.name),
    subtitle: Text(contact.age.toString()),
    );
    },
    );
    },
    );
    }
    }

  • @haviforg
    @haviforg 4 ปีที่แล้ว

    only local database or we can use it on server and how?

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

    Firebase set do hive ?

  • @adriano_souza
    @adriano_souza 3 ปีที่แล้ว

    How I implements this in TDD?

  • @edhooksjr
    @edhooksjr 4 ปีที่แล้ว

    Matt, Is there a TypeAdapter solution for Android Studio? (i see pubspec assist is VS Code plugin) - Manual create TypeAdapter?

    • @edhooksjr
      @edhooksjr 4 ปีที่แล้ว

      Found it... Change #Lock file by Adding to pubspec.yaml dependency as any other package #analyzer: 0.38.2

    • @edhooksjr
      @edhooksjr 4 ปีที่แล้ว

      TypeGen still results this>[SEVERE] hive_generator:hive_generator on lib/models/contacts.dart:
      Error running TypeAdapterGenerator
      You have to provide a non-null typeId.

  • @bjorn6017
    @bjorn6017 5 ปีที่แล้ว

    are there any async methods to add or get data from hive? saving stuff on ui thread will probably freeze ui when data gets larger

    • @simonleier502
      @simonleier502 5 ปีที่แล้ว +3

      Every write operation is actually async. You just don't have to await them. By default the contents of a box are cached so read operations don't access the disk. If you don't want the values to be cached, you can use "Lazy Boxes" which have async get, getAt etc.

  • @glmvnhermawan3062
    @glmvnhermawan3062 5 ปีที่แล้ว

    How about angel dart ? Work's in progress? I'm really can't wait

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

      Backend tutorials are heavily WIP, but I can assure you that they're coming!

  • @nazar.kk1
    @nazar.kk1 4 ปีที่แล้ว

    May anybody tells me, why is it bad practice to expose offline data directly to the UI? 30:55 of the video

  • @kopianan
    @kopianan 5 ปีที่แล้ว

    i got error when get path in void main(). wht should i do ?

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

      WidgetsFlutterBinding.ensureInitialized();
      add this at the first line in main function

  • @dearvivekkumar
    @dearvivekkumar 3 ปีที่แล้ว

    What path we should give for flutter web?

    • @varadgauthankar
      @varadgauthankar 3 ปีที่แล้ว

      i guess web doesnt require a path

  • @billmellis7796
    @billmellis7796 4 ปีที่แล้ว

    What linux distro is that?

  • @oliverbytes
    @oliverbytes 4 ปีที่แล้ว

    What's next for Hive? :(

  • @kasandrop
    @kasandrop 4 ปีที่แล้ว

    when you use clean architecture the entities will get polluted with these annotations. It looks terrible and at the end entities will depend on these annotations.

  • @tahirdevlog2047
    @tahirdevlog2047 4 ปีที่แล้ว

    thankss

  • @juanmanueljaramillohenao654
    @juanmanueljaramillohenao654 4 ปีที่แล้ว

    gracias papi

  • @shubhamtariyal439
    @shubhamtariyal439 3 ปีที่แล้ว +6

    For those who get this error for build_runner:
    [INFO] Generating build script...
    [INFO] Generating build script completed, took 613ms
    [INFO] Creating build script snapshot......
    [INFO] Creating build script snapshot... completed, took 25.4s
    [INFO] Initializing inputs
    [INFO] Building new asset graph...
    [INFO] Building new asset graph completed, took 1.3s
    [INFO] Checking for unexpected pre-existing outputs....
    [INFO] Checking for unexpected pre-existing outputs. completed, took 3ms
    [INFO] Running build...
    [INFO] 1.1s elapsed, 9/10 actions completed.
    [INFO] 4.3s elapsed, 9/10 actions completed.
    [SEVERE] hive_generator:hive_generator on lib/modals/contact.dart:
    You have to provide a non-null typeId.

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

    Can Hive be used for state management? Is it an anti-pattern? What will be the disadvantages?

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

      Hive is a local database package, i.e. it saves data to and reads data from a database file hosted on the device itself (and provides various convenience methods to more easily do so), and that's it. It has nothing to do with managing the state of the app, and is sort of nonsensical to ask if it does. You can use it in conjunction with a state management package for storing persistent state, but that's as far as its involvement with state management goes.

    • @d34dsouI
      @d34dsouI 5 ปีที่แล้ว

      @@Abion47 I know what Hive is. I am asking what if we try to use it for state management. Here is the answer of the Hive author:
      github.com/hivedb/hive/issues/58

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

      @@d34dsouI I was of course talking of persisting state. Don't confuse Hive with a replacement for Provider or Bloc.

    • @joeng7424
      @joeng7424 5 ปีที่แล้ว

      Using persistent write to disk for state management is absolutely overkill, but of course you could do that anyway.

    • @simonleier502
      @simonleier502 5 ปีที่แล้ว

      @@joeng7424 Yes of course. Hive can be used to persist for example the current position in the app. When the user comes back, he can continue right where he left. It would be a terrible idea to persist the state management.

  • @pradeep422
    @pradeep422 5 ปีที่แล้ว

    lol I was just thinkin f this, Reso might upload today or tommorrow about Hive...

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

      I hope I didn't disappoint 😄

  • @luix138
    @luix138 4 ปีที่แล้ว

    Sadly It seems hive isn't maintained anymore. Also, I couldn't install the dependency for incompatibility with Flutter SDK. The only way it worked was by removing flutter_test from dev_dependencies.

    • @wickedgummybear3104
      @wickedgummybear3104 4 ปีที่แล้ว

      I had the same problem. It helps to use dependency_overrides: dartx: ^0.4.2 ... but honestly I'm having trouble getting any Hive example thing to run properly. Overriding stuff does not make me too happy. Thinking of just trying Moor now..

    • @luix138
      @luix138 4 ปีที่แล้ว

      @@wickedgummybear3104
      in pubspec.yaml add:
      hive_flutter:
      git:
      url: github.com/hivedb/hive.git
      path: hive_flutter
      Because this video is a bit old and Hive was modified I had to follow the docs to see what changed
      docs.hivedb.dev
      PS: don't use Hive.initFlutter()
      but do use: import 'package:hive_flutter/hive_flutter.dart';

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

    please use the latest packages , there are some issue with the version mentioned in this tutorial .

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

    spent 2h debugging the problems caused by updates.. FFS ! this is like node, nothing works as expected afer a year or so..

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

    new code of listview is
    ValueListenableBuilder(
    valueListenable: contacts.listenable(),
    builder: (context, box, child) {
    return ListView.builder(
    itemCount: contacts.length,
    itemBuilder: (context, index) {
    final contact = contacts.get(index) as Contact;
    return ListTile(
    title: Text(contact.name),
    subtitle: Text(contact.age.toString()),
    );
    });
    })

  • @imransefat8770
    @imransefat8770 4 ปีที่แล้ว

    WatchBoxBuilder is deprecated

    • @imransefat8770
      @imransefat8770 4 ปีที่แล้ว

      just use Hive.box(' YOUR BOX NAME ').listenable();