آخرین سوالاتجلسه دیتابیس sqlite
rezaaminilb 10 ماه قبل

سلام استاد خسته نباشید این دفعه روی ویندوز امتحان کردم با دیوایس واقعی امتحان کردم متاسفانه ارور داد

Performing hot restart…
Syncing files to device M2004J19C…
Restarted application in 5,591ms.
E/flutter (23963): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Null check operator used on a null value
E/flutter (23963): #0 MethodChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:142:86)
E/flutter (23963): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:148:36)
E/flutter (23963): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:331:12)
E/flutter (23963): #3 invokeMethod (package:sqflite/src/sqflite_impl.dart:17:13)
E/flutter (23963): #4 SqfliteDatabaseFactoryImpl.invokeMethod (package:sqflite/src/factory_impl.dart:82:7)
E/flutter (23963): #5 SqfliteDatabaseFactoryMixin.safeInvokeMethod. (package:sqflite_common/src/factory_mixin.dart:41:38)
E/flutter (23963): #6 wrapDatabaseException (package:sqflite/src/exception_impl.dart:7:32)
E/flutter (23963): #7 SqfliteDatabaseFactoryImpl.wrapDatabaseException (package:sqflite/src/factory_impl.dart:78:7)
E/flutter (23963): #8 SqfliteDatabaseFactoryMixin.safeInvokeMethod (package:sqflite_common/src/factory_mixin.dart:41:7)
E/flutter (23963): #9 SqfliteDatabaseFactoryMixin.getDatabasesPath (package:sqflite_common/src/factory_mixin.dart:152:26)
E/flutter (23963): #10 getDatabasesPath (package:sqflite/sqflite.dart:161:54)
E/flutter (23963): #11 MyDB.initDb (package:first_and_stu/database.dart:24:24)
E/flutter (23963): #12 MyDB.db (package:first_and_stu/database.dart:19:16)
E/flutter (23963): #13 MyDB.insert (package:first_and_stu/database.dart:35:26)
E/flutter (23963): #14 main (package:first_and_stu/main.dart:9:19)
E/flutter (23963): #15 _runMainZoned.. (dart:ui/hooks.dart:142:25)
E/flutter (23963): #16 _rootRun (dart:async/zone.dart:1354:13)
E/flutter (23963): #17 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (23963): #18 _runZoned (dart:async/zone.dart:1789:10)
E/flutter (23963): #19 runZonedGuarded (dart:async/zone.dart:1777:12)
E/flutter (23963): #20 _runMainZoned. (dart:ui/hooks.dart:138:5)
E/flutter (23963): #21 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:283:19)
E/flutter (23963): #22 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
E/flutter (23963):
E/flutter (23963): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: type ‘Future’ is not a subtype of type ‘Database?’
E/flutter (23963): #0 MyDB.db (package:first_and_stu/database.dart:19:5)
E/flutter (23963): #1 MyDB.insert (package:first_and_stu/database.dart:35:26)
E/flutter (23963): #2 main (package:first_and_stu/main.dart:9:19)
E/flutter (23963): #3 _runMainZoned.. (dart:ui/hooks.dart:142:25)
E/flutter (23963): #4 _rootRun (dart:async/zone.dart:1354:13)
E/flutter (23963): #5 _CustomZone.run (dart:async/zone.dart:1258:19)
E/flutter (23963): #6 _runZoned (dart:async/zone.dart:1789:10)
E/flutter (23963): #7 runZonedGuarded (dart:async/zone.dart:1777:12)
E/flutter (23963): #8 _runMainZoned. (dart:ui/hooks.dart:138:5)
E/flutter (23963): #9 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:283:19)
E/flutter (23963): #10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
E/flutter (23963):

1 پاسخ
Hesam عضو سایت 10 ماه قبل

سلام متدی که نوشتید مشکل داره مقدار Database باید بازگشت داده بشه به جای Future