revert: hapus integrasi debit air (water flow/volume) pada frontend

This commit is contained in:
bimabuana 2026-07-06 15:59:52 +07:00
parent ce118a806b
commit ae51f1a835
3 changed files with 5 additions and 60 deletions

View File

@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../core/app_theme.dart';
import '../../../models/monitoring_status.dart';
import '../../auth/auth_notifier.dart';
import '../../auth/auth_state.dart';
import '../providers/monitoring_provider.dart';
@ -213,41 +212,6 @@ class MonitoringPage extends ConsumerWidget {
const SizedBox(height: 16),
// Sensor cards Row 2 (Debit & Volume Air)
Row(
children: [
Expanded(
child: MonitoringCard(
value: (monitoring.latest?.waterFlow ?? 0.0).toStringAsFixed(1),
unit: ' L/m',
subtitle: 'Debit Aliran Air',
status: MonitoringStatus.normal,
gradient: const LinearGradient(
colors: [Color(0xFF0288D1), Color(0xFF005691)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
),
),
const SizedBox(width: 16),
Expanded(
child: MonitoringCard(
value: (monitoring.latest?.waterVolume ?? 0.0).toStringAsFixed(1),
unit: ' L',
subtitle: 'Total Volume Air',
status: MonitoringStatus.normal,
gradient: const LinearGradient(
colors: [Color(0xFF00B0FF), Color(0xFF0091EA)],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
),
),
],
),
const SizedBox(height: 16),
// Info Waktu Penyiraman Terbaik & Rentang Aman
Container(
padding: const EdgeInsets.all(16),

View File

@ -35,16 +35,9 @@ class MonitoringCard extends StatelessWidget {
}
IconData get _bgIcon {
final sub = subtitle.toLowerCase();
if (sub.contains('suhu')) {
return Icons.thermostat;
} else if (sub.contains('debit') || sub.contains('alir')) {
return Icons.waves;
} else if (sub.contains('volume') || sub.contains('total')) {
return Icons.opacity;
} else {
return Icons.water_drop;
}
return subtitle.toLowerCase().contains('suhu')
? Icons.thermostat
: Icons.water_drop;
}
@override

View File

@ -1,9 +1,7 @@
/// Model untuk data sensor IoT (suhu, kelembapan, & debit air).
/// Model untuk data sensor IoT (suhu & kelembapan).
class SensorModel {
final double temperature;
final double humidity;
final double waterFlow;
final double waterVolume;
final bool relayOn;
final String mode;
final DateTime timestamp;
@ -11,8 +9,6 @@ class SensorModel {
const SensorModel({
required this.temperature,
required this.humidity,
this.waterFlow = 0.0,
this.waterVolume = 0.0,
this.relayOn = false,
this.mode = 'auto',
required this.timestamp,
@ -22,8 +18,6 @@ class SensorModel {
return SensorModel(
temperature: (json['temperature'] as num?)?.toDouble() ?? 0.0,
humidity: (json['humidity'] as num?)?.toDouble() ?? 0.0,
waterFlow: (json['water_flow'] as num?)?.toDouble() ?? 0.0,
waterVolume: (json['water_volume'] as num?)?.toDouble() ?? 0.0,
relayOn: json['relay_state'] as bool? ?? false,
mode: json['mode'] as String? ?? 'auto',
timestamp: json['timestamp'] != null
@ -37,8 +31,6 @@ class SensorModel {
Map<String, dynamic> toJson() => {
'temperature': temperature,
'humidity': humidity,
'water_flow': waterFlow,
'water_volume': waterVolume,
'relay_state': relayOn,
'mode': mode,
'timestamp': timestamp.toIso8601String(),
@ -47,8 +39,6 @@ class SensorModel {
SensorModel copyWith({
double? temperature,
double? humidity,
double? waterFlow,
double? waterVolume,
bool? relayOn,
String? mode,
DateTime? timestamp,
@ -56,8 +46,6 @@ class SensorModel {
return SensorModel(
temperature: temperature ?? this.temperature,
humidity: humidity ?? this.humidity,
waterFlow: waterFlow ?? this.waterFlow,
waterVolume: waterVolume ?? this.waterVolume,
relayOn: relayOn ?? this.relayOn,
mode: mode ?? this.mode,
timestamp: timestamp ?? this.timestamp,
@ -66,5 +54,5 @@ class SensorModel {
@override
String toString() =>
'SensorModel(temp: $temperature°C, hum: $humidity%, flow: $waterFlow L/min, vol: $waterVolume L, relay: $relayOn, mode: $mode, ts: $timestamp)';
'SensorModel(temp: $temperature°C, hum: $humidity%, relay: $relayOn, mode: $mode, ts: $timestamp)';
}