Skip to content

Commit 93f0435

Browse files
committed
Remove: Hive WASM workaround hack
1 parent fbca083 commit 93f0435

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

example/lib/shared/services/theme_service_hive.dart

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flutter/foundation.dart';
22
import 'package:hive_ce/hive.dart';
33

4-
import '../const/app.dart';
54
import '../utils/app_data_dir/app_data_dir.dart';
65
import 'theme_service.dart';
76
import 'theme_service_hive_adapters.dart';
@@ -113,23 +112,8 @@ class ThemeServiceHive implements ThemeService {
113112
debugPrint(' Type loaded : $key as ${gotValue.runtimeType}');
114113
debugPrint(' Value loaded : $gotValue');
115114
}
116-
// Add workaround for hive WASM returning double instead of int, when
117-
// values saved were int.
118-
// See issue: https://github.com/IO-Design-Team/hive_ce/issues/46
119-
if (App.isRunningWithWasm &&
120-
gotValue != null &&
121-
(gotValue is double) &&
122-
(defaultValue is int || defaultValue is int?)) {
123-
final T loaded = gotValue.round() as T;
124-
if (_debug) {
125-
debugPrint(' WASM Error : Expected int got double, '
126-
'returning as int: $loaded');
127-
}
128-
return loaded;
129-
} else {
130-
final T loaded = gotValue as T;
131-
return loaded;
132-
}
115+
final T loaded = gotValue as T;
116+
return loaded;
133117
} catch (e) {
134118
debugPrint('Hive load (get) ERROR');
135119
debugPrint(' Error message ...... : $e');

0 commit comments

Comments
 (0)