diff options
author | Malik Talha <talhamalik727x@gmail.com> | 2023-10-23 02:00:01 +0500 |
---|---|---|
committer | Malik Talha <talhamalik727x@gmail.com> | 2023-10-26 21:36:57 +0500 |
commit | 8417e9daeecbdb3847de401b0fcc6304d246a787 (patch) | |
tree | a9dafba232ee7e458358861d1356636c079a12da /lib/utils | |
parent | 8d38450e46ff3854ade4005c4132edfb1aabb9b4 (diff) |
Add flutter voice assistant app
A flutter based gRPC client Voice Assistant made specifically
to communicate with the Voice Agent service.
SPEC-4906
Signed-off-by: Malik Talha <talhamalik727x@gmail.com>
Change-Id: Ic4a382c1cdb78f1a79f985e3d37ce2fb06c53203
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/app_config.dart | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/utils/app_config.dart b/lib/utils/app_config.dart new file mode 100644 index 0000000..8f5c566 --- /dev/null +++ b/lib/utils/app_config.dart @@ -0,0 +1,26 @@ +import 'dart:convert'; +import 'dart:async'; +import 'package:flutter/services.dart'; + +class AppConfig { + late String grpcHost; + late int grpcPort; + + AppConfig({required this.grpcHost, required this.grpcPort}); + + factory AppConfig.fromAsset() { + return AppConfig._(); + } + + AppConfig._(); + + static Future<AppConfig> loadFromAsset() async { + final configString = await rootBundle.loadString('assets/config.json'); + final jsonMap = json.decode(configString); + + return AppConfig( + grpcHost: jsonMap['grpc_host'], + grpcPort: jsonMap['grpc_port'], + ); + } +} |