Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
fix(database): objectbox failing due to missing data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Nov 2, 2021
1 parent dbc26a1 commit d50e4ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions lib/modules/database/database.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import './objectbox/objectbox.g.dart';
import '../../config/paths.dart';
import '../helpers/logger.dart';
Expand All @@ -11,6 +12,11 @@ abstract class DatabaseManager {
static late Store store;

static Future<void> initialize() async {
final Directory dir = Directory(PathDirs.data);
if (!(await dir.exists())) {
await dir.create(recursive: true);
}

store = await openStore(directory: PathDirs.data);
Logger.of('DataStore').info('Initialized "ObjectBox"');
}
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/pages/home_page/anime_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class _HorizontalEntityList extends StatelessWidget {

@override
Widget build(final BuildContext context) => SizedBox(
height: remToPx(11),
height: remToPx(10),
child: ScrollConfiguration(
behavior: MiceScrollBehavior(),
child: ListView(
Expand Down Expand Up @@ -213,7 +213,7 @@ class _HorizontalEntityList extends StatelessWidget {
ClipRRect(
borderRadius: BorderRadius.circular(remToPx(0.3)),
child: SizedBox(
width: remToPx(8),
width: remToPx(7.1),
child: Stack(
children: <Widget>[
Positioned.fill(
Expand Down
4 changes: 2 additions & 2 deletions packages/utilx/lib/generated/locale.g.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SHA: f5800e351bb4dc722698a4ef2b894b3ff44f773c
// ID: MTYzNTc3OTE0OTExMi4yOTE3LTE2MzU3NzkxNDkxMTIuMjkxNw==
// SHA: 1ad392274e32e2ca9473f404a3974da5ba31bf76
// ID: MTYzNTgzMDA1ODc1Ny45MjA0LTE2MzU4MzAwNTg3NTcuOTIwNA==
// Generated file. Do not edit.

enum LanguageCodes {
Expand Down

0 comments on commit d50e4ce

Please sign in to comment.