I want to import sqlite database file from phone local storage to flutter application storage using button in application?
Here is my code in details:
call _pickFile()
method here
var importDbBtn = ConstrainedBox(
constraints: const BoxConstraints(minWidth: double.infinity),
child: new RaisedButton(
shape: Theme.of(context).buttonTheme.shape,
onPressed: (){
_pickFile();
},
I am using file_picker
plugin
void _pickFile() async {
FilePickerResult result = await FilePicker.platform.pickFiles();
if(result != null) {
File file = File(result.files.single.path);
// what can i write here to pick specific file and put it in application
//files
} else {
// User canceled the picker
}
}