Skip to content

Commit

Permalink
Initilization bug #11
Browse files Browse the repository at this point in the history
  • Loading branch information
rxmoein committed Jun 29, 2021
1 parent 08edab6 commit 67f00b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/src/models/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Message {
DateTime? ts;
String? from;
bool? cancelled;
dynamic? content;
dynamic content;
String? topicName;
bool? noForwarding;

Expand Down
20 changes: 12 additions & 8 deletions lib/tinode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,18 @@ class Tinode {

/// Register services in dependency injection container
void _registerDependencies(ConnectionOptions options, bool loggerEnabled) {
GetIt.I.registerSingleton<ConfigService>(ConfigService(loggerEnabled));
GetIt.I.registerSingleton<LoggerService>(LoggerService());
GetIt.I.registerSingleton<AuthService>(AuthService());
GetIt.I.registerSingleton<ConnectionService>(ConnectionService(options));
GetIt.I.registerSingleton<FutureManager>(FutureManager());
GetIt.I.registerSingleton<PacketGenerator>(PacketGenerator());
GetIt.I.registerSingleton<CacheManager>(CacheManager());
GetIt.I.registerSingleton<TinodeService>(TinodeService());
var registered = GetIt.I.isRegistered<ConfigService>();

if (!registered) {
GetIt.I.registerSingleton<ConfigService>(ConfigService(loggerEnabled));
GetIt.I.registerSingleton<LoggerService>(LoggerService());
GetIt.I.registerSingleton<AuthService>(AuthService());
GetIt.I.registerSingleton<ConnectionService>(ConnectionService(options));
GetIt.I.registerSingleton<FutureManager>(FutureManager());
GetIt.I.registerSingleton<PacketGenerator>(PacketGenerator());
GetIt.I.registerSingleton<CacheManager>(CacheManager());
GetIt.I.registerSingleton<TinodeService>(TinodeService());
}
}

/// Resolve dependencies from container
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: tinode
description: This SDK implements Tinode client-side protocol for multi platform applications based on dart.
version: 1.0.0-alpha.3
version: 1.0.0-alpha.4
homepage: https://tinode.co/

environment:
Expand Down

0 comments on commit 67f00b8

Please sign in to comment.