You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to implement floor database in my project. I did all the steps and still has errors while trying to run
flutter packages pub run build_runner build
My console:
[INFO] Creating build script snapshot......
[WARNING] stderr: /C:/Users/xxxx/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/floor_generator-1.0.0/lib/misc/type_utils.dart:49:31: Error: A value of type 'DartObject?' can't be returned from a function with return type
'DartObject' because 'DartObject?' is nullable and 'DartObject' isn't.
[WARNING] stderr: - 'DartObject' is from 'package:analyzer/dart/constant/value.dart' ('/C:/Users/Roman-Alisa/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/analyzer-1.2.0/lib/dart/constant/value.dart').
[WARNING] stderr: return _typeChecker(type).firstAnnotationOfExact(this);
[WARNING] stderr: ^
[INFO] Creating build script snapshot... completed, took 12.7s
[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
There seems to be a problem in source_gen, version 1.0.0 uses null safety, but the floor_generator code is not adapted for this #504. As a quick workaround, we need to use a version of source_gen below 1.0.0.
I am trying to implement floor database in my project. I did all the steps and still has errors while trying to run
flutter packages pub run build_runner build
My console:
[INFO] Creating build script snapshot......
[WARNING] stderr: /C:/Users/xxxx/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/floor_generator-1.0.0/lib/misc/type_utils.dart:49:31: Error: A value of type 'DartObject?' can't be returned from a function with return type
'DartObject' because 'DartObject?' is nullable and 'DartObject' isn't.
[WARNING] stderr: - 'DartObject' is from 'package:analyzer/dart/constant/value.dart' ('/C:/Users/Roman-Alisa/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/analyzer-1.2.0/lib/dart/constant/value.dart').
[WARNING] stderr: return _typeChecker(type).firstAnnotationOfExact(this);
[WARNING] stderr: ^
[INFO] Creating build script snapshot... completed, took 12.7s
[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
my dart classes
@dao
abstract class NoteDao {
@query('SELECT * FROM '+ noteTableName)
Future<List> getList();
@insert
Future insertNote(NoteModel note);
@update
Future updateNote(NoteModel note);
@delete
Future deleteNote(NoteModel note);
@delete
Future deleteNotes(List notes);
}
@database(version: 1, entities: [NoteModel])
abstract class AppDatabase extends FloorDatabase {
NoteDao getnoteDao;
}
my yaml file
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
just_audio: ^0.7.0
audio_service: ^0.17.0-nullsafety.0
http: ^0.13.0
floor: ^1.0.0
firebase_core: ^1.0.1
firebase_auth: ^1.0.1
flutter_bloc: ^7.0.0-nullsafety.5
cloud_firestore: ^1.0.1
provider: ^5.0.0
cached_network_image: ^3.0.0-nullsafety
nuts_activity_indicator: ^0.1.1
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter
floor_generator: ^1.0.0
build_runner: ^1.12.2
/build:
dart:
dependency_overrides:
sqflite: ^2.0.0+3
rxdart: ^0.26.0
audio_session: ^0.1.0
floor_generator: ^1.0.0
uuid: ^3.0.1
build: ^2.0.0
source_gen: ^1.0.0
when I add @query('SELECT * FROM '+ noteTableName)
Future<List> getList();
it all falls apart. Could someone please help?
Thanks.
The text was updated successfully, but these errors were encountered: