Skip to content

Commit b0a180a

Browse files
authored
Merge branch 'main' into BottomNavbar-Eval-1855
2 parents b79558a + ffa9a60 commit b0a180a

File tree

20 files changed

+184
-21
lines changed

20 files changed

+184
-21
lines changed

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,56 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## 2025-02-13
7+
8+
### Changes
9+
10+
---
11+
12+
Packages with breaking changes:
13+
14+
- There are no breaking changes in this release.
15+
16+
Packages with other changes:
17+
18+
- [`ensemble` - `v1.1.22`](#ensemble---v1122)
19+
- [`ensemble_chat` - `v0.0.1+1`](#ensemble_chat---v0011)
20+
- [`ensemble_auth` - `v1.0.1`](#ensemble_auth---v101)
21+
- [`ensemble_location` - `v0.0.1+1`](#ensemble_location---v0011)
22+
- [`ensemble_camera` - `v0.0.1+1`](#ensemble_camera---v0011)
23+
- [`ensemble_contacts` - `v0.0.1+1`](#ensemble_contacts---v0011)
24+
- [`ensemble_file_manager` - `v0.0.1+1`](#ensemble_file_manager---v0011)
25+
- [`ensemble_bluetooth` - `v0.0.1+1`](#ensemble_bluetooth---v0011)
26+
- [`ensemble_connect` - `v0.0.1+1`](#ensemble_connect---v0011)
27+
- [`ensemble_deeplink` - `v0.0.1+1`](#ensemble_deeplink---v0011)
28+
- [`ensemble_network_info` - `v0.0.1+1`](#ensemble_network_info---v0011)
29+
30+
Packages with dependency updates only:
31+
32+
> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
33+
34+
- `ensemble_chat` - `v0.0.1+1`
35+
- `ensemble_auth` - `v1.0.1`
36+
- `ensemble_location` - `v0.0.1+1`
37+
- `ensemble_camera` - `v0.0.1+1`
38+
- `ensemble_contacts` - `v0.0.1+1`
39+
- `ensemble_file_manager` - `v0.0.1+1`
40+
- `ensemble_bluetooth` - `v0.0.1+1`
41+
- `ensemble_connect` - `v0.0.1+1`
42+
- `ensemble_deeplink` - `v0.0.1+1`
43+
- `ensemble_network_info` - `v0.0.1+1`
44+
45+
---
46+
47+
#### `ensemble` - `v1.1.22`
48+
49+
- **REFACTOR**: remove no internet widget. ([e03359b2](https://github.com/ensembleUI/ensemble/commit/e03359b2dd6b1290bea39c71c69e2a3d5ad27c13))
50+
- **REFACTOR**: replace offline widget with error screen for no internet connection. ([b0163a1b](https://github.com/ensembleUI/ensemble/commit/b0163a1ba20eb72c7a459afb3dfa59e1729cf9bf))
51+
- **FIX**: auto complete dropdown selected label. ([80b9c8f5](https://github.com/ensembleUI/ensemble/commit/80b9c8f54c753aca7884fd12ed449c5f019d981b))
52+
- **FEAT**: reinitialize app state when internet connectivity is restored. ([e914e337](https://github.com/ensembleUI/ensemble/commit/e914e337e54bbe539f08aa192b0a50b118708a00))
53+
- **FEAT**: implement internet connectivity check in runtime. ([30204d3b](https://github.com/ensembleUI/ensemble/commit/30204d3bb29324d9ae44380fc919b450cf30cfd0))
54+
55+
656
## 2025-02-07
757

858
### Changes

modules/auth/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies:
2828
ensemble:
2929
git:
3030
url: https://github.com/EnsembleUI/ensemble.git
31-
ref: ensemble-v1.1.21
31+
ref: ensemble-v1.1.22
3232
path: modules/ensemble
3333

3434
ensemble_ts_interpreter:

modules/bracket/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
ensemble:
1515
git:
1616
url: https://github.com/EnsembleUI/ensemble.git
17-
ref: ensemble-v1.1.21
17+
ref: ensemble-v1.1.22
1818
path: modules/ensemble
1919

2020
dev_dependencies:

modules/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
ensemble:
1616
git:
1717
url: https://github.com/EnsembleUI/ensemble.git
18-
ref: ensemble-v1.1.21
18+
ref: ensemble-v1.1.22
1919
path: modules/ensemble
2020
ensemble_ts_interpreter:
2121
git:

modules/chat/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
ensemble:
1414
git:
1515
url: https://github.com/EnsembleUI/ensemble.git
16-
ref: ensemble-v1.1.21
16+
ref: ensemble-v1.1.22
1717
path: modules/ensemble
1818

1919
ensemble_ts_interpreter:

modules/connect/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
ensemble:
1414
git:
1515
url: https://github.com/EnsembleUI/ensemble.git
16-
ref: ensemble-v1.1.21
16+
ref: ensemble-v1.1.22
1717
path: modules/ensemble
1818

1919
plaid_flutter: ^3.1.2

modules/contacts/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
ensemble:
1414
git:
1515
url: https://github.com/EnsembleUI/ensemble.git
16-
ref: ensemble-v1.1.21
16+
ref: ensemble-v1.1.22
1717
path: modules/ensemble
1818

1919
flutter_contacts: ^1.1.7+1

modules/deeplink/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dependencies:
1313
ensemble:
1414
git:
1515
url: https://github.com/EnsembleUI/ensemble.git
16-
ref: ensemble-v1.1.21
16+
ref: ensemble-v1.1.22
1717
path: modules/ensemble
1818

1919
flutter_branch_sdk: ^7.0.1

modules/ensemble/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 1.1.22
2+
3+
- **REFACTOR**: remove no internet widget. ([e03359b2](https://github.com/ensembleUI/ensemble/commit/e03359b2dd6b1290bea39c71c69e2a3d5ad27c13))
4+
- **REFACTOR**: replace offline widget with error screen for no internet connection. ([b0163a1b](https://github.com/ensembleUI/ensemble/commit/b0163a1ba20eb72c7a459afb3dfa59e1729cf9bf))
5+
- **FIX**: auto complete dropdown selected label. ([80b9c8f5](https://github.com/ensembleUI/ensemble/commit/80b9c8f54c753aca7884fd12ed449c5f019d981b))
6+
- **FEAT**: reinitialize app state when internet connectivity is restored. ([e914e337](https://github.com/ensembleUI/ensemble/commit/e914e337e54bbe539f08aa192b0a50b118708a00))
7+
- **FEAT**: implement internet connectivity check in runtime. ([30204d3b](https://github.com/ensembleUI/ensemble/commit/30204d3bb29324d9ae44380fc919b450cf30cfd0))
8+
19
## 1.1.21
210

311
## 1.1.20

modules/ensemble/lib/ensemble_app.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
3030
import 'package:flutter_localized_locales/flutter_localized_locales.dart';
3131
import 'package:workmanager/workmanager.dart';
3232
import 'package:yaml/yaml.dart';
33+
import 'package:connectivity_plus/connectivity_plus.dart';
3334

3435
const String backgroundUploadTask = 'backgroundUploadTask';
3536
const String backgroundBluetoothSubscribeTask = 'backgroundBluetoothSubscribeTask';
@@ -141,11 +142,22 @@ class EnsembleAppState extends State<EnsembleApp> with WidgetsBindingObserver {
141142
// the entire App to reload (e.g. change Locale at runtime)
142143
Key? appKey;
143144

145+
bool _hasInternet = true;
146+
late final StreamSubscription<List<ConnectivityResult>>
147+
_connectivitySubscription;
148+
144149
@override
145150
void initState() {
146151
super.initState();
147152
WidgetsBinding.instance.addObserver(this);
148153
config = initApp();
154+
155+
// Initialize connectivity listener.
156+
_updateConnectivity();
157+
_connectivitySubscription = Connectivity()
158+
.onConnectivityChanged
159+
.listen((_) => _updateConnectivity());
160+
149161
// Initialize native features.
150162
if (!kIsWeb) {
151163
Workmanager().initialize(callbackDispatcher, isInDebugMode: false);
@@ -173,6 +185,23 @@ class EnsembleAppState extends State<EnsembleApp> with WidgetsBindingObserver {
173185
}
174186
}
175187

188+
/// Check the device’s connectivity and update the state.
189+
Future<void> _updateConnectivity() async {
190+
final result = await Connectivity().checkConnectivity();
191+
final hasInternetNow = result.any((r) => r != ConnectivityResult.none);
192+
193+
// If connectivity has been restored, reinitialize the app
194+
if (!_hasInternet && hasInternetNow) {
195+
setState(() {
196+
config = initApp();
197+
});
198+
}
199+
200+
setState(() {
201+
_hasInternet = hasInternetNow;
202+
});
203+
}
204+
176205
@override
177206
void didChangeAppLifecycleState(AppLifecycleState state) async {
178207
super.didChangeAppLifecycleState(state);
@@ -192,6 +221,7 @@ class EnsembleAppState extends State<EnsembleApp> with WidgetsBindingObserver {
192221

193222
@override
194223
void dispose() {
224+
_connectivitySubscription.cancel();
195225
WidgetsBinding.instance.removeObserver(this);
196226
super.dispose();
197227
}

0 commit comments

Comments
 (0)