initFlutter method
Initializes Hive with the path from getApplicationDocumentsDirectory.
You can provide a subDir where the boxes should be stored.
Implementation
Future<void> initFlutter([String? subDir]) async {
WidgetsFlutterBinding.ensureInitialized();
if (kIsWeb) return;
var appDir = await getApplicationDocumentsDirectory();
init(p.join(appDir.path, subDir));
}