Skip to content

Commit dce850a

Browse files
committed
Rebase: onto develop resolved conflicts...
...according to the latest dynamic env. Added: default type in json files Fixed: timeout_limit in json files - 20000 + 20 Fixed: static modifier in the LocalStorage abstract class
1 parent 124e187 commit dce850a

File tree

8 files changed

+29
-9
lines changed

8 files changed

+29
-9
lines changed

assets/env/develop.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"backend_url": "",
88
"api_url": "",
99
"firebase_id": null,
10-
"timeout_limit": 20000,
10+
"timeout_limit": 20,
1111
"enable_local_logs": false,
1212
"enable_cloud_logs": false,
1313
"enable_api_log_interceptor": false,
@@ -17,5 +17,6 @@
1717
"one_signal_config": null,
1818
"pusher_config": null,
1919
"show_debug_panel": true,
20+
"local_storage_type": "none",
2021
"debug_panel_color": 3422552064
21-
}
22+
}

assets/env/production.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"backend_url": "",
88
"api_url": "",
99
"firebase_id": null,
10-
"timeout_limit": 20000,
10+
"timeout_limit": 20,
1111
"enable_local_logs": false,
1212
"enable_cloud_logs": false,
1313
"enable_api_log_interceptor": false,
@@ -17,5 +17,6 @@
1717
"one_signal_config": null,
1818
"pusher_config": null,
1919
"show_debug_panel": false,
20+
"local_storage_type": "none",
2021
"debug_panel_color": 3422552064
21-
}
22+
}

assets/env/staging.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"backend_url": "",
88
"api_url": "",
99
"firebase_id": null,
10-
"timeout_limit": 20000,
10+
"timeout_limit": 20,
1111
"enable_local_logs": false,
1212
"enable_cloud_logs": false,
1313
"enable_api_log_interceptor": false,
@@ -17,5 +17,6 @@
1717
"one_signal_config": null,
1818
"pusher_config": null,
1919
"show_debug_panel": true,
20+
"local_storage_type": "none",
2021
"debug_panel_color": 3422552064
21-
}
22+
}

lib/vaahextendflutter/base/base_controller.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:sentry_flutter/sentry_flutter.dart';
1111

1212
import '../app_theme.dart';
1313
import '../env/env.dart';
14+
import '../env/storage.dart';
1415
import '../services/api.dart';
1516
import '../services/dynamic_links.dart';
1617
import '../services/notification/internal/notification.dart';

lib/vaahextendflutter/env/env.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:json_annotation/json_annotation.dart';
99
import '../services/logging_library/logging_library.dart';
1010
import 'logging.dart';
1111
import 'notification.dart';
12+
import 'storage.dart';
1213

1314
part 'env.g.dart';
1415

@@ -58,6 +59,7 @@ class EnvironmentConfig {
5859
this.oneSignalConfig,
5960
this.pusherConfig,
6061
required this.showDebugPanel,
62+
required this.localStorageType,
6163
required this.debugPanelColor,
6264
});
6365

@@ -78,6 +80,7 @@ class EnvironmentConfig {
7880
final OneSignalConfig? oneSignalConfig;
7981
final PusherConfig? pusherConfig;
8082
final bool showDebugPanel;
83+
final LocalStorageType localStorageType;
8184
@JsonKey(fromJson: _colorFromJson, toJson: _colorToJson)
8285
final Color debugPanelColor;
8386

@@ -119,6 +122,7 @@ class EnvironmentConfig {
119122
pushNotificationsServiceType: PushNotificationsServiceType.none,
120123
internalNotificationsServiceType: InternalNotificationsServiceType.none,
121124
showDebugPanel: true,
125+
localStorageType: LocalStorageType.none,
122126
debugPanelColor: Colors.black.withOpacity(0.8),
123127
);
124128
}

lib/vaahextendflutter/env/env.g.dart

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enum LocalStorageType { hive, flutterSecureStorage, none }

lib/vaahextendflutter/services/storage/local/storage.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import '../../../env.dart';
1+
import '../../../env/env.dart';
2+
import '../../../env/storage.dart';
23
import 'services/base_service.dart';
34
import 'services/flutter_secure_storage.dart';
45
import 'services/hive.dart';
56
import 'services/no_op_storage.dart';
67

78
LocalStorageService get instanceLocal {
8-
final EnvironmentConfig envConfig = EnvironmentConfig.getEnvConfig();
9+
final EnvironmentConfig envConfig = EnvironmentConfig.getConfig;
910
switch (envConfig.localStorageType) {
1011
case LocalStorageType.hive:
1112
return LocalStorageWithHive();
@@ -31,7 +32,7 @@ abstract class LocalStorage {
3132
/// LocalStorage.add('posts');
3233
/// //used only with Hive
3334
/// ```
34-
void add(String collectionName) {
35+
static void add(String collectionName) {
3536
return _instanceLocal.add(collectionName);
3637
}
3738

0 commit comments

Comments
 (0)