Steps to Reproduce
Follow todo example.
@HiveType()
class Todo extends HiveObject {
@HiveField(0)
String name;
@HiveField(1)
DateTime createDate;
@HiveField(2)
bool done = false;
}
Result:
I got message and there is no file todo.g.dart
(base)iMac:location user$ flutter packages pub run build_runner build --delete-conflicting-outputs
[INFO] Generating build script...
[INFO] Generating build script completed, took 561ms
[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 15.4s
[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 969ms
[INFO] Checking for unexpected pre-existing outputs....
[INFO] Deleting 1 declared outputs which already existed on disk.
[INFO] Checking for unexpected pre-existing outputs. completed, took 6ms
[INFO] Running build...
[INFO] Generating SDK summary...
[INFO] 4.4s elapsed, 0/16 actions completed.
[INFO] Generating SDK summary completed, took 4.4s
[INFO] 5.5s elapsed, 1/17 actions completed.
[INFO] 6.5s elapsed, 3/19 actions completed.
[INFO] 7.7s elapsed, 3/19 actions completed.
[INFO] 8.9s elapsed, 3/19 actions completed.
[INFO] 9.9s elapsed, 3/19 actions completed.
[INFO] 11.0s elapsed, 3/19 actions completed.
[INFO] 12.1s elapsed, 3/19 actions completed.
[INFO] 13.2s elapsed, 3/19 actions completed.
[INFO] 19.9s elapsed, 4/19 actions completed.
[INFO] 21.0s elapsed, 4/20 actions completed.
[WARNING] hive_generator:hive_generator on lib/features/storage/Hive/todo.dart:
Missing "part 'todo.g.dart';".
[INFO] 22.8s elapsed, 19/21 actions completed.
[INFO] Running build completed, took 22.9s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 64ms
[INFO] Succeeded after 23.0s with 0 outputs (42 actions)
Code sample
Provide a few simple lines of code to show your problem.
Version
You need to add part 'todo.g.dart' at the beginning of your todo.dart file.
Thanks a lot, it my fail not follow carefully guide.
Thanks a lot, it my fail not follow carefully guide.
Hi, what's the issue you have? I have same issue but I dont know what Im missing.
Thanks a lot, it my fail not follow carefully guide.
Hi, what's the issue you have? I have same issue but I dont know what Im missing.
Could you share your code?
Add this to pubspec.yml:
dev_dependencies:
hive_generator:
Most helpful comment
You need to add
part 'todo.g.dart'at the beginning of yourtodo.dartfile.