Skip to content

Commit b607abd

Browse files
Merge branch 'main' into camera-bugs
2 parents f6d50d2 + 6e8ec8d commit b607abd

File tree

23 files changed

+111
-78
lines changed

23 files changed

+111
-78
lines changed

CHANGELOG.md

+44
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,50 @@
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-03-03
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.30`](#ensemble---v1130)
19+
- [`ensemble_chat` - `v0.0.1+1`](#ensemble_chat---v0011)
20+
- [`ensemble_auth` - `v1.0.1`](#ensemble_auth---v101)
21+
- [`ensemble_camera` - `v0.0.1+1`](#ensemble_camera---v0011)
22+
- [`ensemble_location` - `v0.0.1+1`](#ensemble_location---v0011)
23+
- [`ensemble_file_manager` - `v0.0.1+1`](#ensemble_file_manager---v0011)
24+
- [`ensemble_bluetooth` - `v0.0.1+1`](#ensemble_bluetooth---v0011)
25+
- [`ensemble_connect` - `v0.0.1+1`](#ensemble_connect---v0011)
26+
- [`ensemble_deeplink` - `v0.0.1+1`](#ensemble_deeplink---v0011)
27+
- [`ensemble_network_info` - `v0.0.1+1`](#ensemble_network_info---v0011)
28+
- [`ensemble_contacts` - `v0.0.1+1`](#ensemble_contacts---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_camera` - `v0.0.1+1`
37+
- `ensemble_location` - `v0.0.1+1`
38+
- `ensemble_file_manager` - `v0.0.1+1`
39+
- `ensemble_bluetooth` - `v0.0.1+1`
40+
- `ensemble_connect` - `v0.0.1+1`
41+
- `ensemble_deeplink` - `v0.0.1+1`
42+
- `ensemble_network_info` - `v0.0.1+1`
43+
- `ensemble_contacts` - `v0.0.1+1`
44+
45+
---
46+
47+
#### `ensemble` - `v1.1.30`
48+
49+
650
## 2025-03-03
751

852
### Changes

modules/auth/pubspec.yaml

+1-1
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.29
31+
ref: ensemble-v1.1.30
3232
path: modules/ensemble
3333

3434
ensemble_ts_interpreter:

modules/bracket/pubspec.yaml

+1-1
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.29
17+
ref: ensemble-v1.1.30
1818
path: modules/ensemble
1919

2020
dev_dependencies:

modules/camera/lib/camera.dart

+6
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ class CameraState extends EWidgetState<Camera> with WidgetsBindingObserver {
351351
}
352352

353353
Future<void> setCamera({CameraDescription? cameraDescription}) async {
354+
// If a camera controller has already been initialized, dispose it.
355+
if (widget._controller.cameraController != null) {
356+
await widget._controller.cameraController!.dispose();
357+
widget._controller.cameraController = null;
358+
}
359+
354360
CameraDescription targetCamera = cameraDescription ?? cameras[0];
355361

356362
widget._controller.cameraController = CameraController(

modules/camera/pubspec.yaml

+1-1
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.29
18+
ref: ensemble-v1.1.30
1919
path: modules/ensemble
2020
ensemble_ts_interpreter:
2121
git:

modules/chat/pubspec.yaml

+1-1
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.29
16+
ref: ensemble-v1.1.30
1717
path: modules/ensemble
1818

1919
ensemble_ts_interpreter:

modules/connect/pubspec.yaml

+1-1
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.29
16+
ref: ensemble-v1.1.30
1717
path: modules/ensemble
1818

1919
plaid_flutter: ^3.1.2

modules/contacts/pubspec.yaml

+1-1
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.29
16+
ref: ensemble-v1.1.30
1717
path: modules/ensemble
1818

1919
flutter_contacts: ^1.1.7+1

modules/deeplink/pubspec.yaml

+1-1
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.29
16+
ref: ensemble-v1.1.30
1717
path: modules/ensemble
1818

1919
flutter_branch_sdk: ^7.0.1

modules/ensemble/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.1.30
2+
13
## 1.1.29
24

35
- **FIX**(notification_manager): initialize message handling on startup. ([9ca35acb](https://github.com/ensembleUI/ensemble/commit/9ca35acbd9b868198acb29fa618841b362ac8d19))

modules/ensemble/lib/framework/data_context.dart

+4-8
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,15 @@ class DataContext implements Context {
8888
_contextMap['auth'] = GetIt.instance<AuthContextManager>();
8989
}
9090

91-
_addLegacyDataContext(buildContext);
91+
_addLegacyDataContext();
9292
}
9393

9494

9595
// device is a common name. If user already uses that, don't override it
9696
// This is now in ensemble.device.*
97-
void _addLegacyDataContext(BuildContext? newBuildContext) {
97+
void _addLegacyDataContext() {
9898
if (_contextMap['device'] == null) {
99-
_contextMap['device'] = Device(newBuildContext);
100-
} else {
101-
// If device exists, update its context
102-
final device = _contextMap['device'];
103-
device.updateContext(newBuildContext);
99+
_contextMap['device'] = Device();
104100
}
105101
}
106102

@@ -472,7 +468,7 @@ class NativeInvokable extends ActionInvokable {
472468
'user': () => UserInfo(),
473469
'formatter': () => Formatter(),
474470
'utils': () => _EnsembleUtils(),
475-
'device': () => Device(buildContext),
471+
'device': () => Device(),
476472
'version': () => _cache['version'],
477473
};
478474
}

modules/ensemble/lib/framework/device.dart

+2-41
Original file line numberDiff line numberDiff line change
@@ -27,52 +27,13 @@ class Device
2727
DeviceInfoCapability,
2828
WidgetsBindingObserver {
2929
static final Device _instance = Device._internal();
30-
static late BuildContext context;
3130

32-
Device._internal() {
33-
WidgetsBinding.instance.addObserver(this);
34-
}
31+
Device._internal();
3532

36-
factory Device([BuildContext? buildContext]) {
37-
if (buildContext != null) {
38-
context = buildContext;
39-
}
33+
factory Device() {
4034
return _instance;
4135
}
4236

43-
// method to update context
44-
void updateContext(BuildContext? newContext) {
45-
if (newContext != null) {
46-
context = newContext;
47-
}
48-
}
49-
50-
@override
51-
void didChangeMetrics() {
52-
WidgetsBinding.instance
53-
.addPostFrameCallback((_) => _handleMediaQueryChange());
54-
}
55-
56-
void _handleMediaQueryChange() {
57-
final newData = MediaQuery.of(context);
58-
59-
// Compare with existing static data
60-
if (MediaQueryCapability.data?.orientation != newData.orientation ||
61-
MediaQueryCapability.data?.size != newData.size) {
62-
MediaQueryCapability.data = newData;
63-
64-
// Dispatch individual property changes
65-
ScreenController().dispatchDeviceChanges(context, 'width', screenWidth);
66-
ScreenController().dispatchDeviceChanges(context, 'height', screenHeight);
67-
ScreenController()
68-
.dispatchDeviceChanges(context, 'orientation', screenOrientation);
69-
ScreenController()
70-
.dispatchDeviceChanges(context, 'safeAreaTop', safeAreaTop);
71-
ScreenController()
72-
.dispatchDeviceChanges(context, 'safeAreaBottom', safeAreaBottom);
73-
}
74-
}
75-
7637
@override
7738
Map<String, Function> getters() {
7839
return {

modules/ensemble/lib/framework/view/page.dart

+7-6
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,8 @@ class PageState extends State<Page>
404404
curve: curve,
405405
duration: duration,
406406
backgroundWidget: backgroundWidget,
407-
expandedBarHeight: flexibleMaxHeight,
408-
collapsedBarHeight: flexibleMinHeight,
407+
expandedBarHeight: flexibleMaxHeight?? titleBarHeight,
408+
collapsedBarHeight: flexibleMinHeight?? titleBarHeight,
409409
floating: scrollMode == ScrollMode.floating,
410410
pinned: scrollMode == ScrollMode.pinned,
411411

@@ -919,9 +919,10 @@ class _AnimatedAppBarState extends State<AnimatedAppBar> {
919919
}
920920

921921
void _updateCollapseState() {
922-
bool newState = widget.scrollController.hasClients &&
923-
widget.scrollController.offset >
924-
(widget.expandedBarHeight - widget.collapsedBarHeight);
922+
bool newState = widget.scrollController != null &&
923+
widget.scrollController.hasClients &&
924+
widget.scrollController.offset >
925+
(widget.expandedBarHeight - widget.collapsedBarHeight);
925926

926927
if (newState != isCollapsed) {
927928
setState(() {
@@ -980,8 +981,8 @@ class _AnimatedAppBarState extends State<AnimatedAppBar> {
980981
}
981982

982983
enum ScrollMode {
983-
floating,
984984
pinned,
985+
floating,
985986
}
986987
class ActionResponse {
987988
Map<String, dynamic>? _resultData;

modules/ensemble/lib/layout/data_grid.dart

+23-7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ class DataGrid extends StatefulWidget
8282
controller.dataRowHeight = Utils.optionalDouble(val),
8383
'headingRowHeight': (val) =>
8484
controller.headingRowHeight = Utils.optionalDouble(val),
85+
'scrollbarBehaviour': (val) =>
86+
controller.scrollbarBehaviour =
87+
Utils.getEnum<ScrollbarBehaviour>(val, ScrollbarBehaviour.values),
88+
'thumbThickness': (val) =>
89+
controller.thumbThickness = Utils.optionalDouble(val),
8590
'columnSpacing': (val) =>
8691
controller.columnSpacing = Utils.optionalDouble(val),
8792
'dividerThickness': (val) =>
@@ -184,7 +189,9 @@ class DataGridController extends BoxController {
184189
GenericTextController? headingTextController;
185190
double? dataRowHeight;
186191
double? headingRowHeight;
192+
ScrollbarBehaviour? scrollbarBehaviour;
187193
double? columnSpacing;
194+
double? thumbThickness;
188195
GenericTextController? dataTextController;
189196
double? dividerThickness;
190197
TableBorder border = const TableBorder();
@@ -268,6 +275,7 @@ class DataGridState extends EWidgetState<DataGrid>
268275
@override
269276
Widget buildWidget(BuildContext context) {
270277
ScopeManager? scopeManager = DataScopeWidget.getScope(context);
278+
final ScrollController _scrollController = ScrollController();
271279
if (scopeManager == null) {
272280
throw Exception(
273281
'scopeManager is null in the DataGrid.buildWidget method. This is unexpected. DataGrid.id=${widget.id}');
@@ -311,13 +319,17 @@ class DataGridState extends EWidgetState<DataGrid>
311319
);
312320
return SingleChildScrollView(
313321
scrollDirection: Axis.vertical,
314-
child: SingleChildScrollView(
315-
scrollDirection: Axis.horizontal,
316322

317-
// DataTable requires all children to report their intrinsic height.
318-
// Some widgets don't like that so we expose this so the widgets
319-
// can react accordingly
320-
child: RequiresChildWithIntrinsicDimension(child: grid),
323+
child: RawScrollbar(
324+
thickness: widget.controller.thumbThickness,
325+
controller: _scrollController,
326+
thumbVisibility: widget.controller.scrollbarBehaviour == ScrollbarBehaviour.static,
327+
trackVisibility: widget.controller.scrollbarBehaviour == ScrollbarBehaviour.static,
328+
child: SingleChildScrollView(
329+
scrollDirection: Axis.horizontal,
330+
controller: _scrollController,
331+
child: RequiresChildWithIntrinsicDimension(child: grid),
332+
),
321333
),
322334
);
323335
}
@@ -407,7 +419,7 @@ class DataGridState extends EWidgetState<DataGrid>
407419
if (kDebugMode) {
408420
print(
409421
'Number of DataGrid columns must be equal to the number of cells in each row. Number of DataGrid columns is ${_columns.length} '
410-
'while number of cells in the row is ${cells.length}. We will try to match them to be the same');
422+
'while number of cells in the row is ${cells.length}. We will try to match them to be the same');
411423
}
412424
if (_columns.length > cells.length) {
413425
int diff = _columns.length - cells.length;
@@ -503,3 +515,7 @@ class DataGridState extends EWidgetState<DataGrid>
503515
}
504516
}
505517
}
518+
enum ScrollbarBehaviour{
519+
static,
520+
fade
521+
}

modules/ensemble/lib/widget/helpers/input_wrapper.dart

+8-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,14 @@ class InputWrapper extends StatelessWidget {
7777
Theme.of(context).inputDecorationTheme.labelStyle,
7878
),
7979
),
80-
widget,
80+
// semantics for whatever text input comes through
81+
MergeSemantics(
82+
child: Semantics(
83+
label: controller.label,
84+
child: widget,
85+
),
86+
),
87+
8188
if (shouldShowLabel && controller.description != null)
8289
Container(
8390
margin: const EdgeInsets.only(top: 12.0),

modules/ensemble/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description: Ensemble Runtime
1515
# This version is used _only_ for the Runner app, which is used if you just do
1616
# a `flutter run` or a `flutter make-host-app-editable`. It has no impact
1717
# on any other native host app that you embed your Flutter project into.
18-
version: 1.1.29
18+
version: 1.1.30
1919

2020
environment:
2121
sdk: ">=3.5.0"

modules/ensemble_bluetooth/pubspec.yaml

+1-1
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.29
17+
ref: ensemble-v1.1.30
1818
path: modules/ensemble
1919
ensemble_ts_interpreter:
2020
git:

modules/ensemble_network_info/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
ensemble:
1313
git:
1414
url: https://github.com/EnsembleUI/ensemble.git
15-
ref: ensemble-v1.1.29
15+
ref: ensemble-v1.1.30
1616
path: modules/ensemble
1717

1818
network_info_plus: ^5.0.3

modules/file_manager/pubspec.yaml

+1-1
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.29
17+
ref: ensemble-v1.1.30
1818
path: modules/ensemble
1919
ensemble_ts_interpreter:
2020
git:

modules/firebase_analytics/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dependencies:
4040
ensemble:
4141
git:
4242
url: https://github.com/EnsembleUI/ensemble.git
43-
ref: ensemble-v1.1.29
43+
ref: ensemble-v1.1.30
4444
path: modules/ensemble
4545

4646
dev_dependencies:

modules/location/pubspec.yaml

+1-1
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.29
17+
ref: ensemble-v1.1.30
1818
path: modules/ensemble
1919

2020
ensemble_ts_interpreter:

0 commit comments

Comments
 (0)