Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the use of injectable package #325

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading