23 lines
703 B
Dart
23 lines
703 B
Dart
import 'package:digiplug/utils/enums.dart';
|
|
|
|
// Kelas untuk merepresentasikan data sebuah perangkat
|
|
class Device {
|
|
// Properti-properti yang dimiliki oleh sebuah perangkat
|
|
late String id; // ID unik perangkat
|
|
late String name; // Nama yang diberikan pengguna
|
|
late DeviceType type; // Jenis perangkat (e.g., Lampu, AC)
|
|
late bool active; // Status ON/OFF
|
|
late String room; // Nama ruangan tempat perangkat berada
|
|
late bool isFavorite; // Apakah perangkat ini favorit atau tidak
|
|
|
|
// Constructor untuk membuat objek Device
|
|
Device({
|
|
required this.id,
|
|
required this.name,
|
|
required this.type,
|
|
required this.room,
|
|
required this.active,
|
|
this.isFavorite = false,
|
|
});
|
|
}
|