Saad Mansoor
Saad Mansoor

Reputation: 365

Flutter Hive - Dead Lock ! code needs an Adapter class to run. but that Adapter class will be creatd after i run the code succesfully, in terminal

im new to programming, and english is my 2nd language, so please bypass any mistakes.

The instructor ran the build command in Terminal of IDE:

  1. flutter packages pub run build_runner build or if in above fails, he usually runs below command:
  2. flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs web

but when i do the same error messages are generated.

error message: This builder requires Dart inputs without syntax errors. A function body must be provided.

Error Message in Terminal

E:\android\meter_switch>flutter packages pub run build_runner build

[INFO] Generating build script...
[INFO] Generating build script completed, took 711ms

[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 124ms

[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.1s

[INFO] Running build...
[SEVERE] hive_generator:hive_generator on lib/bank_account.dart:

This builder requires Dart inputs without syntax errors.
However, package:meter_switch/bank_account.dart (or an existing part) contains the following errors.
bank_account.dart:8:3: A function body must be provided.

Try fixing the errors and re-running the build.

[INFO] Running build completed, took 1.4s

[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 91ms

[SEVERE] Failed after 1.5s
pub finished with exit code 1

1. before terminal command image1

2. my code - after terminal - RUN section showed this error

3. my code - after terminal command image2

Upvotes: 1

Views: 338

Answers (1)

Saad Mansoor
Saad Mansoor

Reputation: 365

Ok issue solved. its same issue as : A function body must be provided. Try adding a function body

the issue was "A function body must be provided." I just had to put a semi-collan at the end, after writing out the constructor of a class.

the base of whole issue was that I was just Too sure that the issue would not be in that specific file. And the surity that i would never forget a semicolan meade me fall into this abyss of ignorance. I had looked at the stackOverflow page (link given above), but i never tried it out.

Upvotes: 0

Related Questions