-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.dart
More file actions
29 lines (20 loc) · 811 Bytes
/
example.dart
File metadata and controls
29 lines (20 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import 'package:simple_remote_config/simple_remote_config.dart';
import 'package:version/version.dart';
Future<void> main() async {
final remoteConfig = SimpleRemoteConfig();
const configUrl = "https://dungngminh.github.io/remote_config/test.json";
await remoteConfig.initilize(configUrl: configUrl);
final maxQuota = remoteConfig.getInt("maxQuota");
print("maxQuota: $maxQuota");
final enableLog = remoteConfig.getBool("enableLog");
if (enableLog ?? false) {
print("Log is enabled");
}
final inAppVersion = Version.parse("1.0.0");
final currentVersion = remoteConfig.getString("currentVersion");
if (currentVersion != null && inAppVersion < Version.parse(currentVersion)) {
print("Please update your app");
} else {
print("You are using the latest version");
}
}