lib
βββ core
β βββ common
β β βββ bloc
β β βββ skeletons
β β βββ widgets
β β βββ button.dart
β β βββ input
β β β βββ dropdown.dart
β β β βββ password.dart
β β β βββ textfield.dart
β β βββ iot
β β βββ popup.dart
β β βββ snackbar.dart
β β βββ text_hyperlink.dart
β βββ config
β β βββ config.dart
β βββ constants
β β βββ api_routes.dart
β β βββ app_route_constants.dart
β β βββ logging_constants.dart
β βββ database
β β βββ sqlite_service.dart
β βββ error
β β βββ exceptions.dart
β β βββ failures.dart
β βββ logging
β β βββ custom_logger.dart
β β βββ logging_config.dart
β βββ models
β β βββ device_model.dart
β β βββ fav_devices_model.dart
β β βββ floor_model.dart
β β βββ no_params.dart
β β βββ node_model.dart
β β βββ room_model.dart
β β βββ user_model.dart
β β βββ user_model.g.dart
β β βββ user_session_model.dart
β β βββ user_session_model.g.dart
β βββ network
β β βββ dio_client.dart
β β βββ dio_interceptors.dart
β β βββ http_client.dart
β β βββ network_info.dart
β βββ router
β β βββ app_router.dart
β βββ theme
β β βββ app_colors.dart
β β βββ app_font_sizes.dart
β β βββ app_padding.dart
β β βββ custom_gradient_and_padding_container.dart
β βββ usecase
β β βββ usecase.dart
β βββ utils
β β βββ repository_exceptions_helper.dart
β βββ validators
β β βββ date_validator.dart
β β βββ email_regex_validator.dart
β βββ websocket
β βββ websocket_bloc.dart
β βββ websocket_event.dart
β βββ websocket_messages_models.dart
β βββ websocket_service.dart
β βββ websocket_state.dart
βββ features
β βββ auth
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ auth_local_datasource.dart
β β β β β βββ device_info_local_datasource.dart
β β β β β βββ fcm_token_local_datasource.dart
β β β β βββ remote
β β β β βββ auth_remote_datasource.dart
β β β β βββ fcm_token_remote_datasource.dart
β β β βββ models
β β β β βββ device_info_model.dart
β β β β βββ fcm_token_api_params.dart
β β β β βββ forgot_password_api_parms.dart
β β β β βββ login_api_parms.dart
β β β β βββ otp_verification_api_parms.dart
β β β β βββ signup_api_parms.dart
β β β βββ repositories
β β β βββ auth_abs_class_impl.dart
β β β βββ device_info_abs_class_impl.dart
β β β βββ fcm_token_repo_abs_class_impl.dart
β β βββ domain
β β β βββ repository
β β β β βββ auth_abs_class.dart
β β β β βββ device_info_abs_class.dart
β β β β βββ fcm_token_repo_abs_class.dart
β β β βββ usecases
β β β βββ device_info_usecase.dart
β β β βββ fcm_token_usecase.dart
β β β βββ forgot_password_usecase.dart
β β β βββ login_usecase.dart
β β β βββ otp_verification_usecase.dart
β β β βββ signup_usecase.dart
β β βββ presentation
β β βββ blocs
β β β βββ forgot_password
β β β β βββ forgot_password_email_input_bloc.dart
β β β β βββ forgot_password_email_input_event.dart
β β β β βββ forgot_password_email_input_state.dart
β β β β βββ forgot_password_otp_verification_bloc.dart
β β β β βββ forgot_password_otp_verification_event.dart
β β β β βββ forgot_password_otp_verification_state.dart
β β β β βββ forgot_password_reset_password_bloc.dart
β β β β βββ forgot_password_reset_password_event.dart
β β β β βββ forgot_password_reset_password_state.dart
β β β βββ login
β β β β βββ login_email_input_bloc.dart
β β β β βββ login_email_input_event.dart
β β β β βββ login_email_input_state.dart
β β β β βββ login_otp_verification_bloc.dart
β β β β βββ login_otp_verification_event.dart
β β β β βββ login_otp_verification_state.dart
β β β βββ signup
β β β βββ sign_up_email_input_bloc.dart
β β β βββ sign_up_email_input_event.dart
β β β βββ sign_up_email_input_state.dart
β β β βββ signup_create_new_password_bloc.dart
β β β βββ signup_create_new_password_event.dart
β β β βββ signup_create_new_password_state.dart
β β β βββ signup_details_form_bloc.dart
β β β βββ signup_details_form_event.dart
β β β βββ signup_details_form_state.dart
β β β βββ signup_otp_verification_bloc.dart
β β β βββ signup_otp_verification_event.dart
β β β βββ signup_otp_verification_state.dart
β β βββ pages
β β β βββ forgot_password_email_input.dart
β β β βββ forgot_password_otp_verification.dart
β β β βββ forgot_password_reset_password.dart
β β β βββ login_email_input.dart
β β β βββ login_otp_verification.dart
β β β βββ signup_create_new_password.dart
β β β βββ signup_details_form.dart
β β β βββ signup_email_input.dart
β β β βββ signup_otp_verification.dart
β β βββ widgets
β β βββ otp_input_widget.dart
β βββ common
β β βββ presentation
β β βββ widgets
β β βββ hold_bottom_sheet_widget.dart
β β βββ iot
β β β βββ fan_widget.dart
β β β βββ light_widget.dart
β β β βββ node_widget.dart
β β βββ skeletons
β β βββ iot_device_skel.dart
β β βββ node_skel.dart
β βββ dev
β β βββ data
β β βββ presentation
β β βββ pages
β β β βββ dev_components_test_page.dart
β β β βββ dev_floor_room_sel.dart
β β β βββ dev_test_page.dart
β β β βββ dev_user_details_show.dart
β β β βββ dev_websocket_messages_test.dart
β β βββ widgets
β β βββ websocket_message.dart
β βββ devices
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ devices_local_datasource.dart
β β β β βββ remote
β β β β βββ devices_remote_datasource.dart
β β β βββ models
β β β β βββ create_device_api_param.dart
β β β β βββ delete_device_api_param.dart
β β β β βββ get_devices_api_param.dart
β β β β βββ update_device_api_param.dart
β β β βββ repositories
β β β βββ devices_repository_impl.dart
β β βββ domain
β β β βββ repositories
β β β β βββ devices_repository.dart
β β β βββ usecases
β β β βββ create_device_usecase.dart
β β β βββ delete_device_usecase.dart
β β β βββ get_all_devices_usecase.dart
β β β βββ get_devices_by_node_id_usecase.dart
β β β βββ get_devices_by_room_id_usecase.dart
β β β βββ update_device_usecase.dart
β β βββ presentation
β β βββ pages
β β βββ devices.dart
β βββ fav_devices
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ fav_device_local_datasource.dart
β β β β βββ remote
β β β β βββ fav_device_remote_datasource.dart
β β β βββ models
β β β β βββ create_fav_devices_api_params.dart
β β β β βββ delete_fav_devices_api_params.dart
β β β β βββ get_fav_devices_api_params.dart
β β β βββ repositories
β β β βββ fav_device_repository_impl.dart
β β βββ domain
β β βββ repositories
β β β βββ fav_device_repository.dart
β β βββ usecases
β β βββ create_fav_devices.dart
β β βββ get_fav_devices.dart
β β βββ remove_fav_devices.dart
β βββ floor_room_sel
β β βββ presentation
β β βββ bloc
β β β βββ floor
β β β β βββ floor_bloc.dart
β β β β βββ floor_event.dart
β β β β βββ floor_state.dart
β β β βββ floor_room_sel_bloc.dart
β β β βββ floor_room_sel_event.dart
β β β βββ floor_room_sel_state.dart
β β β βββ room
β β β βββ room_bloc.dart
β β β βββ room_event.dart
β β β βββ room_state.dart
β β βββ skeletons
β β β βββ floor_room_name_skel.dart
β β βββ widgets
β β βββ floor_room_name_button.dart
β β βββ floor_room_sel_widget.dart
β β βββ plus_button.dart
β βββ floors
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ floors_local_datasource.dart
β β β β βββ remote
β β β β βββ floors_remote_datasource.dart
β β β βββ models
β β β β βββ create_floor_api_param.dart
β β β β βββ delete_floor_api_param.dart
β β β β βββ get_floors_api_param.dart
β β β β βββ update_floor_api_param.dart
β β β βββ repositories
β β β βββ floor_repository_impl.dart
β β βββ domain
β β β βββ repository
β β β β βββ floor_repository.dart
β β β βββ usecases
β β β βββ create_floor_usecase.dart
β β β βββ delete_floor_usecase.dart
β β β βββ get_floors_usecase.dart
β β β βββ update_floor_usecase.dart
β β βββ presentation
β β βββ bloc
β β β βββ create_floor_bloc.dart
β β β βββ create_floor_event.dart
β β β βββ create_floor_state.dart
β β β βββ delete_floor_bloc.dart
β β β βββ delete_floor_event.dart
β β β βββ delete_floor_state.dart
β β β βββ edit_floor_bloc.dart
β β β βββ edit_floor_event.dart
β β β βββ edit_floor_state.dart
β β βββ pages
β β β βββ create_floor_page.dart
β β βββ widgets
β β βββ create_floor_widget.dart
β β βββ delete_floor_widget.dart
β β βββ edit_floor_widget.dart
β βββ home
β β βββ presentation
β β βββ pages
β β βββ home.dart
β βββ iot_provisioning
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ ble_local_datasource.dart
β β β β β βββ wifi_local_datasource.dart
β β β β βββ remote
β β β β βββ .gitkeep
β β β βββ models
β β β β βββ node_hw_info.dart
β β β βββ repository
β β β βββ iot_provisioning_repo_imp.dart
β β βββ domain
β β β βββ repository
β β β β βββ iot_provisioning_repo.dart
β β β βββ usecase
β β β βββ iot_provisioning_ble_check_wifi_credentials.dart
β β β βββ iot_provisioning_ble_get_hw_info.dart
β β β βββ iot_provisioning_ble_pair_node.dart
β β β βββ iot_provisioning_ble_upload_config.dart
β β β βββ iot_provisioning_wifi_get_available_nwtworks.dart
β β βββ presentation
β β βββ bloc
β β β βββ iot_provisioning_bloc.dart
β β β βββ iot_provisioning_event.dart
β β β βββ iot_provisioning_state.dart
β β βββ old
β β β βββ enter_wifi_credentials.dart
β β β βββ name_your_node.dart
β β β βββ provisioning.dart
β β β βββ select_node_options.dart
β β β βββ wifi_credentials.dart
β β βββ pages
β β β βββ iot_provisioning.dart
β β βββ widgets
β β βββ enter_wifi_cred.dart
β β βββ name_your_node.dart
β β βββ select_node_location.dart
β βββ navigation
β β βββ data
β β βββ domain
β β βββ presentation
β β βββ blocs
β β β βββ navigation_bloc.dart
β β β βββ navigation_event.dart
β β β βββ navigation_state.dart
β β βββ mixin
β β β βββ keep_alive_mixin.dart
β β β βββ preload_page_view_mixin.dart
β β βββ pages
β β β βββ navigation_screen.dart
β β βββ widgets
β β βββ custom_navigation_bar.dart
β βββ nodes
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ nodes_local_datasource.dart
β β β β βββ remote
β β β β βββ nodes_remote_datasource.dart
β β β βββ models
β β β β βββ complete_node_pairing_api_param.dart
β β β β βββ delete_node_api_param.dart
β β β β βββ get_nodes_by_room_id_api_param.dart
β β β β βββ request_node_pairing_api_param.dart
β β β β βββ update_node_api_param.dart
β β β βββ repositories
β β β βββ node_repository_impl.dart
β β βββ domain
β β β βββ repository
β β β β βββ node_repository.dart
β β β βββ usecases
β β β βββ delete_node_usecase.dart
β β β βββ get_nodes_by_room_id_usecase.dart
β β β βββ pair_node_usecase.dart
β β β βββ update_node_usecase.dart
β β βββ presentation
β β βββ pages
β β βββ nodes.dart
β βββ onboarding
β β βββ data
β β βββ domain
β β βββ presentation
β β βββ bloc
β β βββ pages
β β βββ splash_screen.dart
β βββ rooms
β β βββ data
β β β βββ datasources
β β β β βββ local
β β β β β βββ rooms_local_datasource.dart
β β β β βββ remote
β β β β βββ rooms_remote_datasource.dart
β β β βββ models
β β β β βββ create_room_api_param.dart
β β β β βββ delete_room_api_param.dart
β β β β βββ get_rooms_api_param.dart
β β β β βββ update_room_api_param.dart
β β β βββ repositories
β β β βββ room_repository_impl.dart
β β βββ domain
β β β βββ repository
β β β β βββ room_repository.dart
β β β βββ usecases
β β β βββ create_room_usecase.dart
β β β βββ delete_room_usecase.dart
β β β βββ get_rooms_usecase.dart
β β β βββ update_room_usecase.dart
β β βββ presentation
β β βββ bloc
β β β βββ create_room_bloc.dart
β β β βββ create_room_event.dart
β β β βββ create_room_state.dart
β β β βββ delete_room_bloc.dart
β β β βββ delete_room_event.dart
β β β βββ delete_room_state.dart
β β β βββ edit_room_bloc.dart
β β β βββ edit_room_event.dart
β β β βββ edit_room_state.dart
β β βββ pages
β β β βββ create_room_page.dart
β β βββ widgets
β β βββ create_room_widget.dart
β β βββ delete_room_widget.dart
β β βββ edit_room_widget.dart
β βββ scanner
β β βββ data
β β β βββ models
β β β βββ pair_iot_node_qr_model.dart
β β β βββ pair_tv_qr_model.dart
β β β βββ parse_qr_data_model.dart
β β βββ presentation
β β βββ bloc
β β β βββ qr_scanner_bloc.dart
β β β βββ qr_scanner_event.dart
β β β βββ qr_scanner_state.dart
β β βββ pages
β β β βββ qr_scanner.dart
β β βββ widgets
β β βββ scan_instructions.dart
β β βββ scanner_overlay.dart
β βββ settings
β β βββ data
β β βββ domain
β β βββ presentation
β βββ tv_provisioning
β βββ presentation
β βββ pages
β βββ tv_provisioning.dart
βββ firebase_options.dart
βββ main.dart
βββ service_locator.dart
- Core: Contains code that is used across the entire application.
- Data: Responsible for data retrieval and storage.
- Domain: Contains business logic and defines the core functionality of the app.
- Presentation: Handles UI and user interactions.
- Use camelCase for variable and function names.
- Use PascalCase for class names.
- Add a comment describing each variable at the top of the file.
- Add a function description comment at the start of each function.
- Add a file description comment at the top of each file.
- Use meaningful and descriptive names for variables, functions, and classes.
- Keep functions small and focused on a single responsibility.
- Use const and final keywords where appropriate.
- Follow the DRY (Don't Repeat Yourself) principle.
// File: example_file.dart
// Description: This file contains the ExampleClass which demonstrates...
import 'package:flutter/material.dart';
// Define constants and variables here
const int MAX_RETRY_COUNT = 3; // Maximum number of retry attempts
class ExampleClass {
// Class implementation
}/// Fetches user data from the API
///
/// Parameters:
/// - userId: The unique identifier of the user
///
/// Returns:
/// A Future that resolves to a User object if successful, or null if an error occurs
Future<User?> fetchUserData(String userId) async {
// Function implementation
}