File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
example/lib/shared/services Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change 11import 'package:flutter/foundation.dart' ;
22import 'package:hive_ce/hive.dart' ;
33
4- import '../const/app.dart' ;
54import '../utils/app_data_dir/app_data_dir.dart' ;
65import 'theme_service.dart' ;
76import '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 ' );
You can’t perform that action at this time.
0 commit comments