From ce21ec2ed40e098c0874c8269867d4ebba5dfdea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D1=83=D0=B7=D0=BD=D0=B5=D1=86=D0=BE=D0=B2=20=D0=9D?= =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9?= Date: Tue, 12 Nov 2024 19:23:44 +0300 Subject: [PATCH] fix --- .../datasources/local/hive_datasource.dart | 74 +++++++++---------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/flutter_front/lib/shared/data/datasources/local/hive_datasource.dart b/flutter_front/lib/shared/data/datasources/local/hive_datasource.dart index b93a873..d2defd6 100644 --- a/flutter_front/lib/shared/data/datasources/local/hive_datasource.dart +++ b/flutter_front/lib/shared/data/datasources/local/hive_datasource.dart @@ -2,9 +2,7 @@ import 'package:clean_architecture/features/home/domain/entities/fetch_topics.da import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; -import '../../../../features/charts/data/models/chart_config_model.dart'; import '../../../../features/charts/domain/entities/chart_config.dart'; -import '../../../../features/charts/domain/usecases/save_charts_layout_use_case.dart'; abstract class HiveLocalDataSource { Future initializeUserBox(String username); @@ -38,11 +36,11 @@ abstract class HiveLocalDataSource { Future?> getMultipleChosenEquipment(); Future saveMultipleChosenEquipment(List? equipment); - Future getChartsConfiguration(); - Future saveChartsConfiguration(Map config); - - Future getChartsLayout(); - Future saveChartsLayout(Map data); + // Future getChartsConfiguration(); + // Future saveChartsConfiguration(Map config); + // + // Future getChartsLayout(); + // Future saveChartsLayout(Map data); } class HiveLocalDataSourceImpl implements HiveLocalDataSource { @@ -261,36 +259,36 @@ class HiveLocalDataSourceImpl implements HiveLocalDataSource { await userBox.put("excessPercent", {"value": percent}); } - // Equipment config - - @override - Future getChartsConfiguration() async { - final userBox = await getUserBox; - final config = userBox.get("chartsConfiguration") as Map?; - if(config == null) return null; - return ChartConfigurationModel.fromMap(config).toEntity(); - } - - @override - Future saveChartsConfiguration(Map config) async { - final userBox = await getUserBox; - await userBox.put("chartsConfiguration", config); - } - - // Charts Layout - - @override - Future getChartsLayout() async { - final userBox = await getUserBox; - final layout = userBox.get("chartsLayout") as Map?; - if(layout == null) return null; - return ChartsLayoutData.fromMap(layout); - } - - @override - Future saveChartsLayout(Map data) async { - final userBox = await getUserBox; - await userBox.put("chartsLayout", data); - } + // // Equipment config + // + // @override + // Future getChartsConfiguration() async { + // final userBox = await getUserBox; + // final config = userBox.get("chartsConfiguration") as Map?; + // if(config == null) return null; + // return ChartConfigurationModel.fromMap(config).toEntity(); + // } + // + // @override + // Future saveChartsConfiguration(Map config) async { + // final userBox = await getUserBox; + // await userBox.put("chartsConfiguration", config); + // } + // + // // Charts Layout + // + // @override + // Future getChartsLayout() async { + // final userBox = await getUserBox; + // final layout = userBox.get("chartsLayout") as Map?; + // if(layout == null) return null; + // return ChartsLayoutData.fromMap(layout); + // } + // + // @override + // Future saveChartsLayout(Map data) async { + // final userBox = await getUserBox; + // await userBox.put("chartsLayout", data); + // } } \ No newline at end of file