В моем коде было 2 проблемы. Написание этого, чтобы помочь другим сделать ту же ошибку.
1. Отступ в pubspec.yaml
Я делал большую глупую ошибку. Я просто смотрел на
assets:
- assets/mydb.sql
мой файл pubspec был примерно таким
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/mydb.sqlite
Я не заметил, что мои «трепетание» и «активы:» были на одном уровне.
поэтому я изменил его на
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/mydb.sqlite
Обратите внимание на отступ (2 пробела перед 'assets:')
2. файл sql не db
Итак, я получил эту проблему после решения первого. Я получил mydb.sql не является базой данных. Поэтому я экспортировал свою базу данных в виде файла .sqlite из Sqlite Database Browser. & обновил мой файл pubspec & DBHandler.
Спасибо @ Shababb Karim за комментарий за указание на проблему pubspec.yaml.