import 'package:hive/hive.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;
extension on HiveInterface {
/// Get a name list of existing boxes
FutureOr<List<String>> getNamesOfBoxes() async {
final appDir = await getApplicationDocumentsDirectory();
var files = appDir.listSync();
if (file.statSync().type == FileSystemEntityType.file
&& p.extension(file.path).toLowerCase() == '.hive') {
_list.add(p.basenameWithoutExtension(file.path));
print('Current boxes: $_list');