Merge to main #1
|
|
@ -22,13 +22,13 @@ class AppConstant {
|
|||
static const String dht = 'dht';
|
||||
|
||||
static const String soilTemp = 'soilTemperature';
|
||||
static const String soilMoisture = 'soilMoisture';
|
||||
static const String soilMoisture = 'soilHumidity';
|
||||
static const String airTemp = 'viciTemperature';
|
||||
static const String humidity = 'humidity';
|
||||
static const String lightIntensity = 'lightIntensity';
|
||||
static const String conductivity = 'conductivity';
|
||||
static const String ph = 'ph';
|
||||
static const String nitrogen = 'nitrogen';
|
||||
static const String phosphorus = 'phosphorus';
|
||||
static const String potassium = 'potassium';
|
||||
static const String humidity = 'viciHumidity';
|
||||
static const String lightIntensity = 'viciluminosity';
|
||||
static const String conductivity = 'soilConductivity';
|
||||
static const String ph = 'soilPh';
|
||||
static const String nitrogen = 'soilNitrogen';
|
||||
static const String phosphorus = 'soilPhosphorus';
|
||||
static const String potassium = 'soilPotassium';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -17,8 +18,8 @@ class ConductivityProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: 'soilConductivity');
|
||||
final result = await AppService()
|
||||
.getGraphicDataNpk1(metric: AppConstant.conductivity);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -27,7 +28,7 @@ class ConductivityProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Conductivity Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
@ -38,8 +39,8 @@ class ConductivityProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: 'soilConductivity');
|
||||
final result = await AppService()
|
||||
.getGraphicDataNpk2(metric: AppConstant.conductivity);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -48,7 +49,7 @@ class ConductivityProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Conductivity Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -16,7 +17,7 @@ class HumidityProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGrafikDataDht(metric: 'viciHumidity');
|
||||
await AppService().getGrafikDataDht(metric: AppConstant.humidity);
|
||||
if (result.data == null || result.data!.dht!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -15,8 +16,8 @@ class LumProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGrafikDataDht(metric: 'viciluminosity');
|
||||
final result = await AppService()
|
||||
.getGrafikDataDht(metric: AppConstant.lightIntensity);
|
||||
if (result.data == null || result.data!.dht!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -18,7 +19,7 @@ class NitrogenProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: 'soilNitrogen');
|
||||
await AppService().getGraphicDataNpk1(metric: AppConstant.nitrogen);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -39,7 +40,7 @@ class NitrogenProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: 'soilNitrogen');
|
||||
await AppService().getGraphicDataNpk2(metric: AppConstant.nitrogen);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -17,7 +18,8 @@ class PhProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result = await AppService().getGraphicDataNpk1(metric: 'soilPh');
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: AppConstant.ph);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -26,7 +28,7 @@ class PhProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Soil pH Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
@ -37,7 +39,8 @@ class PhProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result = await AppService().getGraphicDataNpk2(metric: 'soilPh');
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: AppConstant.ph);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -46,7 +49,7 @@ class PhProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Soil pH Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -18,7 +19,7 @@ class PhosporusProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: 'soilPhosphorus');
|
||||
await AppService().getGraphicDataNpk1(metric: AppConstant.phosphorus);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -27,7 +28,7 @@ class PhosporusProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Phosphor Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
@ -39,7 +40,7 @@ class PhosporusProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: 'soilPhosphorus');
|
||||
await AppService().getGraphicDataNpk2(metric: AppConstant.phosphorus);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -48,7 +49,7 @@ class PhosporusProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Phosphor Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -18,7 +19,7 @@ class PotassiumProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: 'soilPotassium');
|
||||
await AppService().getGraphicDataNpk1(metric: AppConstant.potassium);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -27,7 +28,7 @@ class PotassiumProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Potassium Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
@ -39,7 +40,7 @@ class PotassiumProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: 'soilPotassium');
|
||||
await AppService().getGraphicDataNpk2(metric: AppConstant.potassium);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -48,7 +49,7 @@ class PotassiumProvider extends ChangeNotifier {
|
|||
}
|
||||
} catch (e) {
|
||||
if (kDebugMode) {
|
||||
print('Get Grafik Soil Temp Error: $e');
|
||||
print('Get Grafik Potassium Error: $e');
|
||||
}
|
||||
dataState = ResultState.error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -17,8 +18,8 @@ class SoilMoistureProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: 'soilhumidity');
|
||||
final result = await AppService()
|
||||
.getGraphicDataNpk1(metric: AppConstant.soilMoisture);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -38,8 +39,8 @@ class SoilMoistureProvider extends ChangeNotifier {
|
|||
dataState = ResultState.loading;
|
||||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: 'soilhumidity');
|
||||
final result = await AppService()
|
||||
.getGraphicDataNpk2(metric: AppConstant.soilMoisture);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:agrilink_vocpro/core/constant/app_constant.dart';
|
||||
import 'package:agrilink_vocpro/core/state/result_state.dart';
|
||||
import 'package:agrilink_vocpro/data/model/latest_data_response.dart';
|
||||
import 'package:agrilink_vocpro/domain/service/app_service.dart';
|
||||
|
|
@ -18,7 +19,7 @@ class SoilTempProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk1(metric: 'soilTemperature');
|
||||
await AppService().getGraphicDataNpk1(metric: AppConstant.soilTemp);
|
||||
if (result.data == null || result.data!.npk1!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
@ -39,7 +40,7 @@ class SoilTempProvider extends ChangeNotifier {
|
|||
notifyListeners();
|
||||
try {
|
||||
final result =
|
||||
await AppService().getGraphicDataNpk2(metric: 'soilTemperature');
|
||||
await AppService().getGraphicDataNpk2(metric: AppConstant.soilTemp);
|
||||
if (result.data == null || result.data!.npk2!.isEmpty) {
|
||||
dataState = ResultState.noData;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user