Skip to content

Commit

Permalink
Convert to hive_ce
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Jul 13, 2024
1 parent b0b2542 commit 0195bab
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 122 deletions.
2 changes: 1 addition & 1 deletion lib/hive/chart_widget_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:hds_overlay/hive/data_type.dart';
import 'package:hds_overlay/hive/json_converters.dart/color_converter.dart';
import 'package:hds_overlay/hive/tuple2_double.dart';
import 'package:hds_overlay/model/data_source.dart';
import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';
import 'package:json_annotation/json_annotation.dart';

part 'chart_widget_properties.g.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/hive/data_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/widgets.dart';
import 'package:hds_overlay/view/widgets/data/data_widget.dart';
import 'package:hds_overlay/view/widgets/data/heart_rate_widget.dart';
import 'package:hds_overlay/view/widgets/data/text_widget.dart';
import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';

part 'data_type.g.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/hive/data_widget_properties.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:hds_overlay/hive/json_converters.dart/font_weight_converter.dart
import 'package:hds_overlay/hive/json_converters.dart/uint8_list_converter.dart';
import 'package:hds_overlay/hive/tuple2_double.dart';
import 'package:hds_overlay/model/data_source.dart';
import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';
import 'package:json_annotation/json_annotation.dart';

import 'package:hds_overlay/hive/data_type.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/hive/firebase_config.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:math';

import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';

part 'firebase_config.g.dart';

Expand Down
12 changes: 3 additions & 9 deletions lib/hive/hive_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import 'package:hds_overlay/hive/firebase_config.dart';
import 'package:hds_overlay/hive/overlay_profile.dart';
import 'package:hds_overlay/hive/settings.dart';
import 'package:hds_overlay/hive/tuple2_double.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:hds_overlay/hive_registrar.g.dart';
import 'package:hive_ce_flutter/hive_flutter.dart';
import 'package:tuple/tuple.dart';

import 'package:hds_overlay/hive/chart_widget_properties.dart';
Expand All @@ -36,14 +37,7 @@ class HiveUtils {

Future<void> init() async {
await Hive.initFlutter('Health Data Server');

Hive.registerAdapter(Tuple2DoubleAdapter());
Hive.registerAdapter(DataTypeAdapter());
Hive.registerAdapter(DataWidgetPropertiesAdapter());
Hive.registerAdapter(SettingsAdapter());
Hive.registerAdapter(OverlayProfileAdapter());
Hive.registerAdapter(FirebaseConfigAdapter());
Hive.registerAdapter(ChartWidgetPropertiesAdapter());
Hive.registerAdapters();

// Delete the boxes to prevent crashes while developing
// if (kDebugMode) {
Expand Down
2 changes: 1 addition & 1 deletion lib/hive/overlay_profile.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:hds_overlay/hive/chart_widget_properties.dart';
import 'package:hds_overlay/hive/data_widget_properties.dart';
import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';
import 'package:json_annotation/json_annotation.dart';

part 'overlay_profile.g.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/hive/settings.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';

part 'settings.g.dart';

Expand Down
2 changes: 1 addition & 1 deletion lib/hive/tuple2_double.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore_for_file: overridden_fields

import 'package:hive/hive.dart';
import 'package:hive_ce/hive.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:tuple/tuple.dart';

Expand Down
20 changes: 20 additions & 0 deletions lib/hive_registrar.g.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:hive_ce/hive.dart';
import 'package:hds_overlay/hive/data_widget_properties.dart';
import 'package:hds_overlay/hive/tuple2_double.dart';
import 'package:hds_overlay/hive/overlay_profile.dart';
import 'package:hds_overlay/hive/firebase_config.dart';
import 'package:hds_overlay/hive/chart_widget_properties.dart';
import 'package:hds_overlay/hive/data_type.dart';
import 'package:hds_overlay/hive/settings.dart';

extension HiveRegistrar on HiveInterface {
void registerAdapters() {
registerAdapter(DataWidgetPropertiesAdapter());
registerAdapter(Tuple2DoubleAdapter());
registerAdapter(OverlayProfileAdapter());
registerAdapter(FirebaseConfigAdapter());
registerAdapter(ChartWidgetPropertiesAdapter());
registerAdapter(DataTypeAdapter());
registerAdapter(SettingsAdapter());
}
}
Loading

0 comments on commit 0195bab

Please sign in to comment.