Ứng dụng điều khiển đèn thông minh được phát triển bằng Flutter, tích hợp Firebase Realtime Database để quản lý và giám sát hệ thống chiếu sáng từ xa.
- Bật/Tắt đèn: Điều khiển nguồn đèn từ xa
- Điều chỉnh độ sáng: Slider tùy chỉnh độ sáng theo ý muốn
- Chế độ tự động: Tự động điều chỉnh độ sáng theo môi trường
- Thay đổi màu sắc: Chuyển đổi giữa ánh sáng vàng và trắng
- Tích hợp timer Pomodoro: Hỗ trợ phương pháp học tập/làm việc hiệu quả
- Tùy chỉnh thời gian: Cài đặt thời gian work và break
- Tự động điều khiển đèn: Đèn thay đổi theo chu kỳ Pomodoro
- Biểu đồ sử dụng: Theo dõi mức độ sử dụng đèn theo thời gian
- Lịch sử hoạt động: Xem lại các thao tác đã thực hiện
- Material Design 3: Giao diện hiện đại, thân thiện
- Dark/Light Theme: Tự động thích ứng theo theme hệ thống
- Flutter 3.8+: Framework phát triển ứng dụng đa nền tảng
- Riverpod: State management hiện đại và hiệu quả
- Firebase Realtime Database: Cơ sở dữ liệu thời gian thực
- Firebase Messaging: Dịch vụ push notification
- Local Notifications: Thông báo local cho Pomodoro
- Material Design 3: Design system của Google
- Number Picker: Widget chọn số cho timer
- Custom Widgets: Slider, cards, và controls tùy chỉnh
- Flutter SDK 3.8.1 hoặc cao hơn
- Dart SDK 3.0+
- Android Studio / VS Code
- Firebase account
- Clone repository
git clone https://github.com/yourusername/flutter_smartlight.git
cd flutter_smartlight- Cài đặt dependencies
flutter pub get- Cấu hình Firebase
# Tạo project Firebase mới tại https://console.firebase.google.com
# Tải file google-services.json và đặt vào android/app/
# Tạo file lib/firebase_options.dart với cấu hình Firebase- Chạy ứng dụng
flutter run-
Tạo Firebase Project
- Truy cập Firebase Console
- Tạo project mới
- Kích hoạt Realtime Database và Firebase Messaging
-
Cấu hình Android
# Thêm google-services.json vào android/app/ # Cập nhật android/build.gradle và android/app/build.gradle
-
Cấu hình iOS (optional)
# Thêm GoogleService-Info.plist vào ios/Runner/ # Cập nhật ios/Runner/Info.plist
lib/
├── main.dart # Entry point
├── firebase_options.dart # Firebase configuration
├── core/
│ └── service/
│ └── firebase_service.dart # Firebase services
└── features/
└── smart_light/
├── application/
│ └── led_controller_provider.dart # State management
├── domain/
│ └── models/ # Data models
└── presentation/
├── home_screen.dart # Main screen
└── widgets/
├── brightness_slider.dart
├── control_card.dart
└── chart_card.dart
Tạo file .env trong thư mục root:
FIREBASE_API_KEY=your_api_key
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_MESSAGING_SENDER_ID=your_sender_id{
"LED_CONTROL": {
"control": {
"nutNguon": "1", // 0: OFF, 1: ON
"nutDoiMau": "0", // 0: White, 1: Yellow
"nutTuDongSang": "0", // 0: Manual, 1: Auto
"doSangCuaDen": "50", // 0-100
"nutTuDongSang": "0" // 0-1
},
"promodoro": {
"isNotifiOn": "0", // 0: OFF, 1: ON
"timeWork": "25", // Work time in minutes
"timeBreak": "5" // Break time in minutes
},
"timeUse": {
"2025-08-30": "45",
"2025-08-29": "25",
}
}
}- Fork project
- Tạo feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Tạo Pull Request
Nếu bạn gặp lỗi, vui lòng tạo issue với:
- Mô tả chi tiết lỗi
- Steps để reproduce
- Screenshots (nếu có)
- Device/OS information
- Flutter Team - Framework tuyệt vời
- Firebase - Backend as a Service
- Material Design - Design system
- Riverpod - State management solution
⭐ Nếu project này hữu ích, hãy cho một star nhé! ⭐
