From 93f043590f2b66e406126b25caf9dc3fbd024020 Mon Sep 17 00:00:00 2001 From: rydmike Date: Wed, 27 Nov 2024 16:13:17 +0200 Subject: [PATCH] Remove: Hive WASM workaround hack --- .../shared/services/theme_service_hive.dart | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/example/lib/shared/services/theme_service_hive.dart b/example/lib/shared/services/theme_service_hive.dart index 2526f8c7..88b99a59 100644 --- a/example/lib/shared/services/theme_service_hive.dart +++ b/example/lib/shared/services/theme_service_hive.dart @@ -1,7 +1,6 @@ import 'package:flutter/foundation.dart'; import 'package:hive_ce/hive.dart'; -import '../const/app.dart'; import '../utils/app_data_dir/app_data_dir.dart'; import 'theme_service.dart'; import 'theme_service_hive_adapters.dart'; @@ -113,23 +112,8 @@ class ThemeServiceHive implements ThemeService { debugPrint(' Type loaded : $key as ${gotValue.runtimeType}'); debugPrint(' Value loaded : $gotValue'); } - // Add workaround for hive WASM returning double instead of int, when - // values saved were int. - // See issue: https://github.com/IO-Design-Team/hive_ce/issues/46 - if (App.isRunningWithWasm && - gotValue != null && - (gotValue is double) && - (defaultValue is int || defaultValue is int?)) { - final T loaded = gotValue.round() as T; - if (_debug) { - debugPrint(' WASM Error : Expected int got double, ' - 'returning as int: $loaded'); - } - return loaded; - } else { - final T loaded = gotValue as T; - return loaded; - } + final T loaded = gotValue as T; + return loaded; } catch (e) { debugPrint('Hive load (get) ERROR'); debugPrint(' Error message ...... : $e');