Skip to content

Commit

Permalink
Merge branch 'main' into 1808-obscureTextWidget-property
Browse files Browse the repository at this point in the history
  • Loading branch information
mehsaandev authored Jan 13, 2025
2 parents 8b6d107 + 10a6a26 commit 120a6ef
Show file tree
Hide file tree
Showing 69 changed files with 4,569 additions and 200 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/starter-commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test Commands in Starter

on:
pull_request:
branches:
- main

jobs:
test-modules:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: starter

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Set up Node.js
uses: actions/setup-node@v2

- name: Install dependencies
run: npm install

- name: Run hasCamera command
run: npm run hasCamera platform="ios,android" cameraDescription="Hello world"
continue-on-error: false

- name: Run hasFileManager command
run: npm run hasFileManager platform="ios,android" photoLibraryDescription="Hello" musicDescription="world"
continue-on-error: false

- name: Run hasContacts command
run: npm run hasContacts contactsDescription="Hello world" platform="ios,android"
continue-on-error: false

- name: Run hasConnect command
run: npm run hasConnect platform="ios,android" cameraDescription="Hello world" contactsDescription="Hello world"
continue-on-error: false

- name: Run hasLocation command
run: npm run hasLocation platform="ios,android" locationDescription="Hello world" alwaysUseLocationDescription="Hello world" inUseLocationDescription="Hello world"
continue-on-error: false
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pubspec_overrides.yaml
/starter/ios/Flutter
starter/ios/Runner.xcodeproj/project.pbxproj
/node_modules
starter/node_modules
starter/package-lock.json

# FVM Version Cache
.fvm/
.fvm/
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,54 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2025-01-07

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`ensemble` - `v1.1.14`](#ensemble---v1114)
- [`ensemble_auth` - `v1.0.1`](#ensemble_auth---v101)
- [`ensemble_camera` - `v0.0.1+1`](#ensemble_camera---v0011)
- [`ensemble_chat` - `v0.0.1+1`](#ensemble_chat---v0011)
- [`ensemble_connect` - `v0.0.1+1`](#ensemble_connect---v0011)
- [`ensemble_contacts` - `v0.0.1+1`](#ensemble_contacts---v0011)
- [`ensemble_deeplink` - `v0.0.1+1`](#ensemble_deeplink---v0011)
- [`ensemble_bluetooth` - `v0.0.1+1`](#ensemble_bluetooth---v0011)
- [`ensemble_network_info` - `v0.0.1+1`](#ensemble_network_info---v0011)
- [`ensemble_file_manager` - `v0.0.1+1`](#ensemble_file_manager---v0011)
- [`ensemble_location` - `v0.0.1+1`](#ensemble_location---v0011)

Packages with dependency updates only:

> 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.
- `ensemble_auth` - `v1.0.1`
- `ensemble_camera` - `v0.0.1+1`
- `ensemble_chat` - `v0.0.1+1`
- `ensemble_connect` - `v0.0.1+1`
- `ensemble_contacts` - `v0.0.1+1`
- `ensemble_deeplink` - `v0.0.1+1`
- `ensemble_bluetooth` - `v0.0.1+1`
- `ensemble_network_info` - `v0.0.1+1`
- `ensemble_file_manager` - `v0.0.1+1`
- `ensemble_location` - `v0.0.1+1`

---

#### `ensemble` - `v1.1.14`

# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2025-01-03

### Changes
Expand Down
2 changes: 1 addition & 1 deletion modules/auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble

ensemble_ts_interpreter:
Expand Down
2 changes: 1 addition & 1 deletion modules/bracket/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion modules/camera/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble
ensemble_ts_interpreter:
git:
Expand Down
2 changes: 1 addition & 1 deletion modules/chat/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble

ensemble_ts_interpreter:
Expand Down
2 changes: 1 addition & 1 deletion modules/connect/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble

plaid_flutter: ^3.1.2
Expand Down
2 changes: 1 addition & 1 deletion modules/contacts/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble

flutter_contacts: ^1.1.7+1
Expand Down
2 changes: 1 addition & 1 deletion modules/deeplink/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.13
ref: ensemble-v1.1.14
path: modules/ensemble

flutter_branch_sdk: ^7.0.1
Expand Down
2 changes: 2 additions & 0 deletions modules/ensemble/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 1.1.14

## 1.1.13

- Moengage Module Release
Expand Down
53 changes: 24 additions & 29 deletions modules/ensemble/lib/action/Log_event_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import 'package:ensemble/framework/logging/log_manager.dart';
import 'package:ensemble/framework/logging/log_provider.dart' as logging;
import 'package:ensemble/framework/scope.dart';
import 'package:ensemble/screen_controller.dart';
import 'package:ensemble/util/moengage_utils.dart';
import 'package:ensemble/util/utils.dart';
import 'package:ensemble_ts_interpreter/invokables/invokable.dart';
import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:moengage_flutter/moengage_flutter.dart';
// import 'package:moengage_flutter/moengage_flutter.dart';
import 'package:ensemble/framework/stub/moengage_manager.dart';

class LogEvent extends ensembleAction.EnsembleAction {
Expand Down Expand Up @@ -79,7 +80,8 @@ class LogEvent extends ensembleAction.EnsembleAction {

case 'setLocation':
case 'setUserAttributeLocation':
final location = getLocation(value);
case 'locationAttribute':
final location = EnsembleGeoLocation.parse(value);
if (location == null) {
throw LanguageError('Invalid location format');
}
Expand Down Expand Up @@ -126,20 +128,6 @@ class LogEvent extends ensembleAction.EnsembleAction {
return logging.LogLevel.info;
}

static MoEGeoLocation? getLocation(dynamic value) {
if (value is Map) {
final lat = Utils.getDouble(value['latitude'], fallback: 0);
final lng = Utils.getDouble(value['longitude'], fallback: 0);
return MoEGeoLocation(lat, lng);
}

final locationData = Utils.getLatLng(value);
if (locationData != null) {
return MoEGeoLocation(locationData.latitude, locationData.longitude);
}
return null;
}

@override
Future<void> execute(BuildContext context, ScopeManager scopeManager) async {
try {
Expand Down Expand Up @@ -222,14 +210,16 @@ class LogEvent extends ensembleAction.EnsembleAction {
await moEngage.setBirthDate(Utils.getString(value, fallback: ''));
break;
case 'setGender':
await moEngage
.setGender(MoEGender.values.from(value) ?? MoEGender.male);
final ensembleGender = EnsembleGender.fromString(value?.toString());
if (ensembleGender != null) {
await moEngage.setGender(ensembleGender);
}
break;
case 'setAlias':
await moEngage.setAlias(Utils.getString(value, fallback: ''));
break;
case 'setLocation':
final location = getLocation(value);
final location = EnsembleGeoLocation.parse(value);
if (location != null) {
await moEngage.setLocation(location);
}
Expand All @@ -244,7 +234,7 @@ class LogEvent extends ensembleAction.EnsembleAction {
attributeKey!, Utils.getString(value, fallback: ''));
break;
case 'locationAttribute':
final location = getLocation(value);
final location = EnsembleGeoLocation.parse(value);
if (location != null) {
await moEngage.setUserAttributeLocation(attributeKey!, location);
}
Expand All @@ -253,11 +243,11 @@ class LogEvent extends ensembleAction.EnsembleAction {
// Tracking Events
case 'trackEvent':
if (parameters != null) {
final moEProperties = MoEProperties();
final ensembleProps = EnsembleProperties();
parameters.forEach((key, value) {
moEProperties.addAttribute(key, value);
ensembleProps.addAttribute(key, value);
});
await moEngage.trackEvent(eventName!, moEProperties);
await moEngage.trackEvent(eventName!, ensembleProps);
} else {
await moEngage.trackEvent(eventName!);
}
Expand Down Expand Up @@ -295,14 +285,19 @@ class LogEvent extends ensembleAction.EnsembleAction {
await moEngage.disableAdIdTracking();
break;
case 'setAppStatus':
await moEngage.setAppStatus(MoEAppStatus.values.from(value)!);
final status = EnsembleAppStatus.fromString(value?.toString());
if (status != null) {
await moEngage.setAppStatus(status);
}
break;
case 'logout':
await moEngage.logout();
break;
case 'deleteUser':
await moEngage.deleteUser();
break;
final success = await moEngage.deleteUser();
if (!success) {
throw Exception('Failed to delete user');
}

// Push Configuration
case 'registerForPush':
Expand Down Expand Up @@ -335,9 +330,9 @@ class LogEvent extends ensembleAction.EnsembleAction {
await moEngage.showInApp();
break;
case 'showNudge':
await moEngage.showNudge(
position: MoEngageNudgePosition.values.from(value) ??
MoEngageNudgePosition.bottom);
final position = EnsembleNudgePosition.fromString(value?.toString()) ??
EnsembleNudgePosition.bottom;
await moEngage.showNudge(position: position);
break;
case 'setContext':
if (value is List) {
Expand Down
3 changes: 3 additions & 0 deletions modules/ensemble/lib/action/action_invokable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ abstract class ActionInvokable with Invokable {
ActionType.dismissDialog,
ActionType.closeAllDialogs,
ActionType.executeActionGroup,
ActionType.saveFile,
ActionType.controlDeviceBackNavigation,
ActionType.closeApp,
]);
}

Expand Down
24 changes: 24 additions & 0 deletions modules/ensemble/lib/action/close_app.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:ensemble/framework/action.dart';
import 'package:ensemble/framework/scope.dart';
import 'package:ensemble/util/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ensemble_ts_interpreter/invokables/invokable.dart';

class CloseAppAction extends EnsembleAction {
CloseAppAction({
super.initiator,
});

factory CloseAppAction.from({Invokable? initiator, Map? payload}) {
return CloseAppAction(
initiator: initiator,
);
}

@override
Future execute(BuildContext context, ScopeManager scopeManager) {
SystemNavigator.pop();
return Future.value(null);
}
}
Loading

0 comments on commit 120a6ef

Please sign in to comment.