Skip to content

Commit

Permalink
refactor: moved DBEncryption to a separate class
Browse files Browse the repository at this point in the history
  • Loading branch information
Desu Sai Venkat committed Aug 29, 2023
1 parent 8dfabc7 commit e2bc7ee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions packages/plugins/rudder_plugin_interface/lib/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ library rudder_sdk_flutter_platform_interface;
export 'src/constants.dart';
export 'src/enums.dart';
export 'src/rudder_logger.dart';
export 'src/models/db_encryption.dart';
export 'src/models/rudder_config.dart';
export 'src/models/rudder_web_config.dart';
export 'src/models/rudder_mobile_config.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class DBEncryption {
// @param whether the SDK should encrypt the DB
final bool _enabled;

// @param key to be used for encryption
final String _key;

DBEncryption(enabled, key)
: _enabled = enabled,
_key = key;

bool get enabled => _enabled;
String get key => _key;

Map getMap() {
return {"enabled": _enabled, "key": _key};
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'db_encryption.dart';
import '../constants.dart';

///Configurations to be used for mobile and mobile only. Any values set here
Expand Down Expand Up @@ -53,22 +54,3 @@ class MobileConfig {

DBEncryption? get dbEncryption => _dbEncryption;
}

class DBEncryption {
// @param whether the SDK should encrypt the DB
final bool _enabled;

// @param key to be used for encryption
final String _key;

DBEncryption(enabled, key)
: _enabled = enabled,
_key = key;

bool get enabled => _enabled;
String get key => _key;

Map getMap() {
return {"enabled": _enabled, "key": _key};
}
}

0 comments on commit e2bc7ee

Please sign in to comment.