diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 06bda76..4dada59 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -22,7 +22,7 @@
> _environmentHosts = {
- Environment.production: [
- 'h5-im.imharry.work',
- ],
- };
-
static List get environmentHosts {
- return _environmentHosts[currentEnvironment] ?? const [];
+ return openim_common.Config.environmentHosts;
}
static String get homeUrl {
diff --git a/openim_common/lib/openim_common.dart b/openim_common/lib/openim_common.dart
new file mode 100644
index 0000000..b6b61a0
--- /dev/null
+++ b/openim_common/lib/openim_common.dart
@@ -0,0 +1,2 @@
+export 'src/config.dart';
+
diff --git a/openim_common/lib/src/config.dart b/openim_common/lib/src/config.dart
new file mode 100644
index 0000000..a60a951
--- /dev/null
+++ b/openim_common/lib/src/config.dart
@@ -0,0 +1,17 @@
+enum Environment {
+ production,
+}
+
+class Config {
+ static const Environment currentEnvironment = Environment.production;
+
+ static final Map> _environmentHosts = {
+ Environment.production: [
+ 'h5-im.imharry.work',
+ ],
+ };
+
+ static List get environmentHosts {
+ return _environmentHosts[currentEnvironment] ?? const [];
+ }
+}
diff --git a/openim_common/pubspec.yaml b/openim_common/pubspec.yaml
new file mode 100644
index 0000000..7ff1d22
--- /dev/null
+++ b/openim_common/pubspec.yaml
@@ -0,0 +1,7 @@
+name: openim_common
+description: Build-server compatible configuration bridge for the H5 shell.
+publish_to: 'none'
+
+environment:
+ sdk: ">=3.6.0 <4.0.0"
+
diff --git a/pubspec.lock b/pubspec.lock
index 27a5ae9..8209563 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -128,6 +128,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.17.0"
+ openim_common:
+ dependency: "direct main"
+ description:
+ path: openim_common
+ relative: true
+ source: path
+ version: "0.0.0"
path:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 8aa8066..f360909 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -36,6 +36,8 @@ dependencies:
webview_flutter: ^4.13.1
webview_flutter_android: ^4.10.5
webview_flutter_wkwebview: ^3.23.1
+ openim_common:
+ path: openim_common
dev_dependencies:
flutter_test: