Skip to content

Commit

Permalink
Merge pull request #325 from guyluz11/dev
Browse files Browse the repository at this point in the history
Removed the use of injectable package
  • Loading branch information
guyluz11 committed Nov 8, 2023
2 parents 6d5101d + 70f39f8 commit ef1f4d9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 52 deletions.
11 changes: 6 additions & 5 deletions bin/cbj_hub.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:cbj_hub/application/boot_up/boot_up.dart';
import 'package:cbj_hub/infrastructure/cbj_web_server/cbj_web_server_repository.dart';
import 'package:cbj_hub/infrastructure/mqtt_server/mqtt_server_repository.dart';
Expand All @@ -12,19 +14,18 @@ import 'package:cbj_integrations_controller/infrastructure/shared_variables.dart
import 'package:cbj_integrations_controller/infrastructure/system_commands/system_commands_manager_d.dart';
import 'package:cbj_integrations_controller/initialize_integrations_controller.dart';
import 'package:cbj_integrations_controller/injection.dart';
import 'package:network_tools/network_tools.dart' as network;

Future<void> main(List<String> arguments) async {
setInstancesOfRepos();
setInstancesOfRepos(arguments.firstOrNull ?? Directory.current.path);
// arguments[0] is the location of the project
network.configureNetworkTools('network_tools_db');
// network.configureNetworkTools('network_tools_db');
await initializeIntegrationsController(arguments: arguments, env: Env.devPc);

await BootUp.setup();
}

/// All instances of Repos
void setInstancesOfRepos() {
void setInstancesOfRepos(String projectRootDirectoryPath) {
SystemCommandsManager();
MqttServerRepository();
CbjWebServerRepository();
Expand All @@ -35,5 +36,5 @@ void setInstancesOfRepos() {
NodeRedRepository();
BindingCbjRepository();
SceneCbjRepository();
SharedVariables();
SharedVariables(projectRootDirectoryPath);
}
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,3 @@ class HubRequestsToApp {
static BehaviorSubject<dynamic> streamRequestsToApp =
BehaviorSubject<dynamic>();
}

/// Requests and updates from app to the hub
class AppRequestsToHub {
/// Stream controller of the requests from the hub
static final appRequestsToHubStreamController =
StreamController<RequestsAndStatusFromHub>();

/// Stream of the requests from the hub
static Stream<RequestsAndStatusFromHub> get appRequestsToHubStream =>
appRequestsToHubStreamController.stream;
}
4 changes: 0 additions & 4 deletions lib/infrastructure/app_communication/hub_app_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import 'package:grpc/service_api.dart';

/// Server to get and send information to the app
class HubAppServer extends CbjHubServiceBase {
/// The app call this method and getting stream of all the changes of the
/// internet devices
Stream<MapEntry<String, String>> streamOfChanges() async* {}

@override
Stream<RequestsAndStatusFromHub> clientTransferEntities(
ServiceCall call,
Expand Down
23 changes: 0 additions & 23 deletions lib/injection.dart

This file was deleted.

10 changes: 1 addition & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ dependencies:
hive: ^2.2.3
# Library for making HTTP requests.
http: ^1.1.0
# Convenient code generator for get_it
injectable: ^2.3.1
# Utility library that checks for an Active Internet connection
internet_connection_checker: ^1.0.0+1
# Extremely fast, easy to use, and fully async NoSQL database.
Expand All @@ -52,18 +50,14 @@ dependencies:
# Service discovery over multicast DNS (mDNS), Bonjour, and Avahi.
multicast_dns: ^0.3.2+4
# Helps you discover open ports, devices on subnet and more.
network_tools: ^4.0.1
network_tools: ^3.2.1
# Provides runtime support for a Dart implementation of protobufs.
protobuf: ^3.1.0
# Extends the capabilities of Dart Streams and StreamControllers.
rxdart: ^0.27.7
# Simple, fast generation of RFC4122 UUIDs.
uuid: ^4.1.0

dependency_overrides:
# Defines the annotations used by json_serializable
get_it: ^7.6.0

dev_dependencies:
# A build system for Dart code generation and modular compilation.
build_runner:
Expand All @@ -73,8 +67,6 @@ dev_dependencies:
freezed: ^2.4.1
# Automatically generates Hive TypeAdapters to store any class
hive_generator: ^2.0.1
# Injectable is a convenient code generator for get _it.
injectable_generator: ^2.4.0
# Code generator for the Isar Database. Finds classes annotated with @Collection.
# isar_generator: ^3.0.5
# Collection of lint rules for Dart and Flutter projects
Expand Down

0 comments on commit ef1f4d9

Please sign in to comment.