Skip to content

Commit

Permalink
Specify Hive directory
Browse files Browse the repository at this point in the history
It defaults to ~/Documents, until it is fixed we specify
~/.local/share/<app>

isar/hive#746
  • Loading branch information
Merrit committed Mar 31, 2022
1 parent 3f587da commit d3f4009
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
4 changes: 3 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_acrylic/flutter_acrylic.dart' hide Window;
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
import 'package:system_tray/system_tray.dart';
import 'package:window_manager/window_manager.dart';

Expand All @@ -18,7 +19,8 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
await windowManager.ensureInitialized();
await Acrylic.initialize();
await Hive.initFlutter();
final applicationSupportDirectory = await getApplicationSupportDirectory();
Hive.init(applicationSupportDirectory.path);

final settingsBox = await Hive.openBox('settings');
final widgetsBox = await Hive.openBox('widgets');
Expand Down
8 changes: 8 additions & 0 deletions linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
window_size
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
)

set(PLUGIN_BUNDLED_LIBRARIES)

foreach(plugin ${FLUTTER_PLUGIN_LIST})
Expand All @@ -17,3 +20,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)

foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ packages:
name: hive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.1.0"
hive_flutter:
dependency: "direct main"
description:
Expand Down Expand Up @@ -162,7 +162,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
Expand All @@ -183,14 +183,14 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
path_provider:
dependency: transitive
dependency: "direct main"
description:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.0.9"
path_provider_android:
dependency: transitive
description:
Expand Down Expand Up @@ -279,7 +279,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -321,7 +321,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
typed_data:
dependency: transitive
description:
Expand All @@ -342,7 +342,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
win32:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ dependencies:
flutter_bloc: ^8.0.1
flutter_localizations:
sdk: flutter
hive: ^2.0.6
hive: ^2.1.0
hive_flutter: ^1.1.0
intl: ^0.17.0
path_provider: ^2.0.9
percent_indicator: ^3.4.0
system_tray: ^0.1.0
uuid: ^3.0.6
Expand Down

0 comments on commit d3f4009

Please sign in to comment.