@@EasyApproach No. I didn't mean so. :D But better in men's category, specially as a teacher. so that students can understand easily. At least no issue with voice.
If I'm understanding correctly, the enum for incomplete is now not being used. Because you're negating the iscomplete enum instead of specifying the enum in the else block..
Hi Maaz! Very nice explanation! But I wanted to clear a doubt I am having about type adapters. In this video you used only one model class. If there are more than one model class (i.e. more than one type adapters) and there are more than one boxes of HIVE, then what is the proper way of registering these type adapters to different boxes in HIVE?
You can use as much adapters as you want; Future main() async { Hive.registerAdapter(AAdapter()); Hive.registerAdapter(BAdapter()); Hive.registerAdapter(CAdapter()); ... ... Hive.registerAdapter(nAdapter()); await Hive.initFlutter(); await Hive.openBox('boxA'); await Hive.openBox('boxB'); await Hive.openBox('boxC'); ... ... await Hive.openBox('boxn'); runApp(MyApp()); }
Hi. Thankyou for this amazing tutorial! I do have a question though. What if I have another model class I need to save within the fields of my Hive Box? So for example, I have a class *Cart* which will have the fields: *String* customerName ; *Integer* customerId ; *List* items And another class *Item* which will have the fields: *Integer* productId ; *String* productName ; *Integer* quantity I could make two TypeAdapters for the model classes but how can I store the Item class inside the Cart Box? Since Hive only stores primitive data types.
@@EasyApproach dude can you make video how can we backup this hive data on cloud like firebase or our own cloud??? btw your teaching is so simple and understandable thank you!!
Flutter build runner not working properly i yry deleaying conflicted files its not genrating anything running uptodate on stable channel how can i write adapter class manually
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
*"Unhandled Exception: HiveError: Cannot write, unknown type: ItemModel. Did you forget to register an adapter?"* But I already registered the adapter. What's going on????
@@B21-q8k While storing data locally in a Flutter app, You can use either Hive or sqflite or SharedPreferences. It mostly does the same thing but there are different perks to each package.
Thank you for this awsome tutorial and i had try to delete the hive data but it wont work. Try this code👇 Inside onpressed(){ final key = _title.text; todoBox.delete(key); Navigator.pop(context) } Is anything wrong there please help me out! Again thank you and stay healthy.
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
Thanks for the video. Your voice is very clear.
Usually men's voice is heavy (I think because of low frequency), so not cleared to understand.
hahhaha! You mean I have girlish voice :D?
@@EasyApproach No. I didn't mean so. :D
But better in men's category, specially as a teacher. so that students can understand easily. At least no issue with voice.
Haha ok just jocking!
Really appreciate your work man.
I appreciate that!
Very COOL! Flutter & Firebase Functions will be grate!
I think so too!
The most awaited video for me. And you did great again. Thanks a lot bro. 💚💚💚
I made this for you :)
That's my honour 😊
i had to admit, that was a great intro.
I am from Brazil, thanks this is helped me.
Thank you. Please subscribe the channel.
Thanks Alot, great work and easy explanation
thank you brother, it helped me a lot.
Thanks. Please subscribe the channel
If I'm understanding correctly, the enum for incomplete is now not being used. Because you're negating the iscomplete enum instead of specifying the enum in the else block..
Please help! I got this error 'the method 'listenable' isn't defined for the type 'Box'' when trying to get value from the box. Thanks
You need to import flutter_hive.dart in the file you are using listenable
Thank you. Please subscribe the channel.
Thank you!
Hi Maaz! Very nice explanation! But I wanted to clear a doubt I am having about type adapters. In this video you used only one model class. If there are more than one model class (i.e. more than one type adapters) and there are more than one boxes of HIVE, then what is the proper way of registering these type adapters to different boxes in HIVE?
You can use as much adapters as you want;
Future main() async {
Hive.registerAdapter(AAdapter());
Hive.registerAdapter(BAdapter());
Hive.registerAdapter(CAdapter());
...
...
Hive.registerAdapter(nAdapter());
await Hive.initFlutter();
await Hive.openBox('boxA');
await Hive.openBox('boxB');
await Hive.openBox('boxC');
...
...
await Hive.openBox('boxn');
runApp(MyApp());
}
Hi. Thankyou for this amazing tutorial!
I do have a question though. What if I have another model class I need to save within the fields of my Hive Box? So for example,
I have a class *Cart*
which will have the fields: *String* customerName ; *Integer* customerId ; *List* items
And another class *Item*
which will have the fields: *Integer* productId ; *String* productName ; *Integer* quantity
I could make two TypeAdapters for the model classes but how can I store the Item class inside the Cart Box? Since Hive only stores primitive data types.
I tried and sucessfully made it.
first, you create 2 file for each model ( @HiveType(typeId: 0) for item_model.dart and @HiveType(typeId: 1) for cart_model.dart)
then generate 2 files.
then init 2 adapter in void main()
after,
floatingActionButton: FloatingActionButton(
onPressed: () {
ItemModel item1 =
ItemModel(productId: 5, productName: "Water", quantity: 5);
ItemModel item2 =
ItemModel(productId: 2, productName: "Bread", quantity: 12);
List itemList = [item1, item2];
CartModel cart = CartModel(
customerName: "Hieu Le", customerId: 1, items: itemList);
cartBox.add(cart);
then for display on UI:
body: ValueListenableBuilder(
valueListenable: cartBox.listenable(),
builder: (context, Box carts, _) {
List keys = carts.keys.cast().toList();
return ListView.separated(
itemBuilder: (context, index) {
final int key = keys[index];
CartModel? cart = carts.get(key);
ItemModel? item = cart!.items[1];
return ListTile(
title: Text(
cart.customerName,
style: const TextStyle(
fontWeight: FontWeight.bold, fontSize: 15),
),
subtitle: Text(item.productName + item.quantity.toString()),
);
},
separatorBuilder: (context, index) => const Divider(),
itemCount: carts.keys.toList().length);
},
),
hope it helps you.
@@LuminousAsianBeauties Thanks. I will try it out :)
Small request. Can you update the Flutter playlist with the latest videos.
Sure. Thank you for suggestion 😊
if anyone got error at typeId just change hive dependency to 1.2.0 without ^ carrot
Thanks
@@EasyApproach dude can you make video how can we backup this hive data on cloud like firebase or our own cloud??? btw your teaching is so simple and understandable thank you!!
Flutter build runner not working properly i yry deleaying conflicted files its not genrating anything running uptodate on stable channel how can i write adapter class manually
May be you didn't include g.dart file. Double check it
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
this is not working with tabs when i swipe tabs i get error : forgot to open box and box already opened
great tutorial, thanks
Thank you. Please subscribe the channel.
hey bro it's showing the generation process in the terminal but the file is not generating and i have part g.dart line too any help?
Can you show me the console
it has to be the same name then append ".g.dart " at the end
@@king4053 thnx it worked...can I ask you again if I get in any trouble here?
I just recently started using this too. I may not be that much of a help but I'll answer if I know.
Why not using todo.save() method instead of box.put() ?
You can use that too.
thanks. this is very good..
the data is not storing inside the app after closing and reopening it
*"Unhandled Exception: HiveError: Cannot write, unknown type: ItemModel. Did you forget to register an adapter?"* But I already registered the adapter. What's going on????
does each box represent a table? right?
For analogy we can say
@@EasyApproach Thanks
Thanks a lot.
Welcome. Please subscribe the channel.
After generating type adapter it show error in generated file "missing concrete implement of 'getter TypeAdapter.typeid' "
Before every type you must specify type id
pub finished with exit code 1. Changing versions of sdk or hive didn't help
Can you tell me what is written over there in error?
hello you can create tutorial for creating mysql database offline in local project in app?
Sure
@@EasyApproach Nice, can sql use hive?
@@B21-q8k While storing data locally in a Flutter app, You can use either Hive or sqflite or SharedPreferences. It mostly does the same thing but there are different perks to each package.
How can we edit the note or delete it! And thank u
We have delete function in the box for deleting and for editing you need to overwrite data on the existing id.
funny start;-)
hehe! Please subscribe the channel!
Please sir make a tutorial how to edit the tast list
todo todo todo tdooooooooooooooodoooooooooooodoooooooooooo
Thank you for this awsome tutorial and i had try to delete the hive data but it wont work.
Try this code👇
Inside onpressed(){
final key = _title.text;
todoBox.delete(key);
Navigator.pop(context)
}
Is anything wrong there please help me out!
Again thank you and stay healthy.
Thanks
3:23 6:49
To much complicated
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