1

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
  }
}
yusufpats
  • 778
  • 4
  • 12
  • I think this can be useful: [Sqlite in Flutter](https://stackoverflow.com/questions/51384175/sqlite-in-flutter-how-database-assets-work/51387985#51387985) – Khashayar Motarjemi Nov 04 '20 at 12:21

0 Answers0