buildDatabaseFactory function

DatabaseFactory buildDatabaseFactory({
  1. String? tag,
  2. required Future invokeMethod(
    1. String method, [
    2. Object? arguments
    ]),
})

Build a database factory invoking the invoke method instead of going through flutter services.

To use to enable running without flutter plugins (unit test)

tag is an optional debug

Implementation

DatabaseFactory buildDatabaseFactory({
  String? tag,
  required Future<dynamic> Function(String method, [Object? arguments])
  invokeMethod,
}) {
  final DatabaseFactory impl = _SqfliteDatabaseFactoryImpl(
    invokeMethod,
    tag: tag,
  );
  return impl;
}