Skip to content

Commit

Permalink
Merge pull request #652 from CyBear-Jinni/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
guyluz11 authored Apr 22, 2023
2 parents 631ca1e + 3cc5bc7 commit 0140a86
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions lib/infrastructure/isar_local_db/isar_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:cybear_jinni/utils.dart';
import 'package:dartz/dartz.dart';
import 'package:injectable/injectable.dart';
import 'package:isar/isar.dart';
import 'package:path_provider/path_provider.dart';

@LazySingleton(as: ILocalDbRepository)
class IsarRepository extends ILocalDbRepository {
Expand All @@ -17,11 +18,15 @@ class IsarRepository extends ILocalDbRepository {
late Isar isar;

Future<void> asyncConstractor() async {
isar = await Isar.open([
RemotePipesIsarModelSchema,
HubEntityIsarModelSchema,
HomeEntityIsarModelSchema,
]);
final dir = await getApplicationDocumentsDirectory();
isar = await Isar.open(
[
RemotePipesIsarModelSchema,
HubEntityIsarModelSchema,
HomeEntityIsarModelSchema,
],
directory: dir.path,
);
}

@override
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ dependencies:
# Allow you to have a screen at launcher for example
introduction_screen: ^3.1.7
# Extremely fast, easy to use, and fully async NoSQL database for Flutter.
isar: ^3.0.5
isar: ^3.1.0
# Isar Core binaries for the Isar Database. Needs to be included for Flutter apps.
isar_flutter_libs: ^3.0.5
isar_flutter_libs: ^3.1.0
# Defines the annotations used by json_serializable to create code for JSON serialization and deserialization.
json_annotation: ^4.8.0
# Dart Build System builders for handling JSON.
Expand Down Expand Up @@ -164,7 +164,7 @@ dev_dependencies:
# Convenient code generator for get_it.
injectable_generator: ^2.1.4
# Code generator for the Isar Database. Finds classes annotated with @Collection.
isar_generator: ^3.0.5
isar_generator: ^3.1.0
# Collection of lint rules for Dart and Flutter projects.
lint: ^2.0.1
# # Mock framework with APIs for Fakes, Mocks, behavior verification, and stubbing.
Expand Down

0 comments on commit 0140a86

Please sign in to comment.