-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,560 additions
and
428 deletions.
There are no files selected for viewing
Submodule assets
updated
from 1111b9 to 52574f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extensions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import 'package:hive_flutter/hive_flutter.dart'; | ||
|
||
part 'favorite_model.g.dart'; | ||
|
||
@HiveType(typeId: 1) | ||
class FavoriteModel extends HiveObject { | ||
@HiveField(0) | ||
late final String id; | ||
|
||
@HiveField(1) | ||
late final String name; | ||
|
||
@HiveField(2) | ||
late final String image; | ||
|
||
@HiveField(3) | ||
late final String type; | ||
|
||
FavoriteModel(this.id, this.name, this.image, this.type); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:hive_flutter/hive_flutter.dart'; | ||
import '/hive/favorite_model.dart'; | ||
|
||
class FavoriteModelBoxAdapter extends TypeAdapter<FavoriteModel> { | ||
@override | ||
final typeId = 1; | ||
|
||
@override | ||
FavoriteModel read(BinaryReader reader) { | ||
return FavoriteModel( | ||
// id | ||
reader.readString(), | ||
// name | ||
reader.readString(), | ||
// image | ||
reader.readString(), | ||
// type | ||
reader.readString(), | ||
); | ||
} | ||
|
||
@override | ||
void write(BinaryWriter writer, FavoriteModel obj) { | ||
writer.writeString(obj.id); | ||
writer.writeString(obj.name); | ||
writer.writeString(obj.image); | ||
writer.writeString(obj.type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.