Pessoal Boa tarde
Não sei mais o que fazer ao compilar recebo esse erro
Error: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import '../models/contact.dart';
Future<Database> createDatabase(){
return getDatabasesPath().then((dbPath) {
final String path = join(dbPath,'bytebank.db');
return openDatabase(path, onCreate: (db, version) {
db.execute('CREATE TABLE contacts('
'id INTEGER PRIMARY KEY, '
'name TEXT'
'account_number INTEGER');
}, version: 2);
});
}
Future<int> save (Contact contact){
return createDatabase().then((db) {
final Map<String, dynamic> contactMap = Map();
contactMap['id'] = contact.id;
contactMap['name'] = contact.name;
contactMap['account_number'] = contact.accountnumber;
return db.insert('contacts', contactMap, conflictAlgorithm: ConflictAlgorithm.replace);
});
}
Future<List<Contact>> findAll() {
return createDatabase().then((db){
return db.query('contacts').then((maps) {
final List<Contact> contacts = [];
for (Map<String, dynamic> map in maps) {
final Contact contact = Contact(
map['id'],
map['name'],
map['account_numer']
);
contacts.add(contact);
}
return contacts;
});
});
}