title: Deleting database with sqlflite in flutter doesn't seem to be working
body: <p>For my app I'm loading in a pre-populated database with some starter/default data for the user following this tutorial: <a href="https://github.com/tekartik/sqflite/blob/master/doc/opening_asset_db.md" rel="noreferrer">https://github.com/tekartik/sqflite/blob/master/doc/opening_asset_db.md</a>
  While debugging I'm going to be adding/deleting a bunch of test data and don't want to have to manually reset things every time I want to reload the app, so I have it load a fresh copy from the database every time. </p>
  
  <p>For some reason however it isn't loading a new copy from the asset but rather still opening the existing modified database. I've checked the asset file and it's not been modified and the block that opens the existing database on the machine without deleting the previous version is not reached. </p>
  
  <p>I'm not getting any errors in the console either.</p>
  
  <p>Here's the code for initializing the database:</p>
  
  <pre><code>static Database _db;
  
    Future&lt;Database&gt; get db async {
      if(_db != null)
        return _db;
      _db = await initDb();
      return _db;
    }
  
    bool get isInDebugMode {
      bool inDebugMode = false;
      assert(inDebugMode = true);
      return inDebugMode;
    }
  
    //load database from existing db or copy pre-loaded db from assets
    initDb() async {
      //if in debug mode always load from asset file
      //done to reload from asset when default values added to database asset
      //and get rid of testing data
      //since it would be annoying to have to delete the file on the emulator every time
  
      debugPrint("initializing the db connection");
      var databasesPath = await getDatabasesPath();
      var path = join(databasesPath, "myDatabase.db");
  
      if(isInDebugMode){
        // delete existing if any
        await deleteDatabase(path);
  
        // Copy from asset
        ByteData data = await rootBundle.load(join("assets", "assetDB.db"));
        List&lt;int&gt; bytes = data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
        await new File(path).writeAsBytes(bytes);
  
        // open the database
        var db = await openDatabase(path, readOnly: false);
        return db;
  
      } else {
        // try opening (will work if it exists)
        Database db;
        try {
          db = await openDatabase(path, readOnly: false);
        } catch (e) {
          print("Error $e");
        }
  
        if (db == null) {
          // Should happen only the first time you launch your application
          print("Creating new copy from asset");
  
          // Copy from asset
          ByteData data = await rootBundle.load(join("assets", "assetDB.db"));
          List&lt;int&gt; bytes =
          data.buffer.asUint8List(data.offsetInBytes, data.lengthInBytes);
          await new File(path).writeAsBytes(bytes);
  
          //debugPrint(bytes.length.toString());
  
          // open the database
          db = await openDatabase(path, readOnly: true);
        } else {
          print("Opening existing database");
        }
  
        return db;
      }
  
    }
  </code></pre>
  
  <p>I should mention I'm not doing a hot reload when I load these changes and the block that initializes the new database from the asset for when in debug mode is reached.</p>
  
  <p>Thanks for your help!</p>