From 700faafe8ef12d6d42a8b8ad769e23dc00dc11a3 Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Fri, 4 Oct 2024 12:59:24 -0700 Subject: [PATCH 01/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- .../device_preview/lib/src/views/theme.dart | 52 +++++++++++++++++-- .../views/tool_panel/sections/section.dart | 2 +- .../views/tool_panel/sections/settings.dart | 4 +- .../sections/subsections/device_model.dart | 2 +- .../lib/src/views/tool_panel/tool_panel.dart | 2 +- modules/ensemble/lib/ensemble_theme.dart | 47 ++++++++--------- modules/ensemble/lib/widget/carousel.dart | 2 +- .../lib/widget/visualization/barchart.dart | 4 +- .../widget/visualization/chart_defaults.dart | 2 +- modules/ensemble/pubspec.yaml | 6 +-- starter/pubspec.yaml | 2 +- 11 files changed, 84 insertions(+), 41 deletions(-) diff --git a/modules/device_preview/lib/src/views/theme.dart b/modules/device_preview/lib/src/views/theme.dart index 837d0121..4f368b38 100644 --- a/modules/device_preview/lib/src/views/theme.dart +++ b/modules/device_preview/lib/src/views/theme.dart @@ -28,7 +28,6 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData { primaryColor: accentColor, primaryColorDark: accentColor, indicatorColor: accentColor, - toggleableActiveColor: accentColor, highlightColor: accentColor.withOpacity(0.1), sliderTheme: base.sliderTheme.copyWith( thumbColor: accentColor, @@ -37,7 +36,30 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData { activeTickMarkColor: accentColor, inactiveTickMarkColor: accentColor, overlayColor: accentColor.withOpacity(0.12), - ), + ), checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + ), radioTheme: RadioThemeData( + fillColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + ), switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + trackColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + ), ); case DevicePreviewToolBarThemeData.light: final base = ThemeData.light(); @@ -51,7 +73,6 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData { primaryColor: accentColor, primaryColorDark: accentColor, indicatorColor: accentColor, - toggleableActiveColor: accentColor, highlightColor: accentColor, appBarTheme: base.appBarTheme.copyWith( color: barColor, @@ -63,7 +84,30 @@ extension ThemeToolbarExtension on DevicePreviewToolBarThemeData { activeTickMarkColor: accentColor, inactiveTickMarkColor: accentColor, overlayColor: accentColor.withOpacity(0.12), - ), + ), checkboxTheme: CheckboxThemeData( + fillColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + ), radioTheme: RadioThemeData( + fillColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + ), switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + trackColor: MaterialStateProperty.resolveWith((Set states) { + if (states.contains(MaterialState.disabled)) { return null; } + if (states.contains(MaterialState.selected)) { return accentColor; } + return null; + }), + ), ); } } diff --git a/modules/device_preview/lib/src/views/tool_panel/sections/section.dart b/modules/device_preview/lib/src/views/tool_panel/sections/section.dart index 059ef69a..fe354211 100644 --- a/modules/device_preview/lib/src/views/tool_panel/sections/section.dart +++ b/modules/device_preview/lib/src/views/tool_panel/sections/section.dart @@ -36,7 +36,7 @@ class ToolPanelSection extends StatelessWidget { ), child: Text( title.toUpperCase(), - style: theme.textTheme.subtitle2?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.hintColor, ), ), diff --git a/modules/device_preview/lib/src/views/tool_panel/sections/settings.dart b/modules/device_preview/lib/src/views/tool_panel/sections/settings.dart index eaf9f279..dadf1d5a 100644 --- a/modules/device_preview/lib/src/views/tool_panel/sections/settings.dart +++ b/modules/device_preview/lib/src/views/tool_panel/sections/settings.dart @@ -53,7 +53,7 @@ class SettingsSection extends StatelessWidget { shape: BoxShape.circle, color: background.scaffoldBackgroundColor, border: Border.all( - color: toolbar.backgroundColor, + color: Theme.of(context).colorScheme.surface, width: 1, ), ), @@ -84,7 +84,7 @@ class SettingsSection extends StatelessWidget { shape: BoxShape.circle, color: toolbar.scaffoldBackgroundColor, border: Border.all( - color: toolbar.backgroundColor, + color: Theme.of(context).colorScheme.surface, width: 1, ), ), diff --git a/modules/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart b/modules/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart index 8199e8ff..a50ee934 100644 --- a/modules/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart +++ b/modules/device_preview/lib/src/views/tool_panel/sections/subsections/device_model.dart @@ -172,7 +172,7 @@ class _TypeSectionHeader extends StatelessWidget { } }() .toUpperCase(), - style: theme.textTheme.subtitle2?.copyWith( + style: theme.textTheme.titleSmall?.copyWith( color: theme.hintColor, ), ), diff --git a/modules/device_preview/lib/src/views/tool_panel/tool_panel.dart b/modules/device_preview/lib/src/views/tool_panel/tool_panel.dart index 9c2ee146..d9d7b5f4 100644 --- a/modules/device_preview/lib/src/views/tool_panel/tool_panel.dart +++ b/modules/device_preview/lib/src/views/tool_panel/tool_panel.dart @@ -80,7 +80,7 @@ class _ToolPanel extends StatelessWidget { appBar: AppBar( title: Text( 'Device preview', - style: theme.textTheme.headline6?.copyWith( + style: theme.textTheme.titleLarge?.copyWith( fontSize: 14, fontWeight: FontWeight.bold, color: (theme.colorScheme.brightness == Brightness.dark diff --git a/modules/ensemble/lib/ensemble_theme.dart b/modules/ensemble/lib/ensemble_theme.dart index 8b289ba5..624bf7f0 100644 --- a/modules/ensemble/lib/ensemble_theme.dart +++ b/modules/ensemble/lib/ensemble_theme.dart @@ -42,13 +42,13 @@ class EnsembleTheme { } static const TextTheme textTheme = TextTheme( - headline4: display1, - headline5: headline, - headline6: title, - subtitle2: subtitle, - bodyText1: body2, - bodyText2: body1, - caption: caption, + headlineMedium: display1, + headlineSmall: headline, + titleLarge: title, + titleSmall: subtitle, + bodyLarge: body2, + bodyMedium: body1, + bodySmall: caption, ); static const TextStyle display1 = TextStyle( @@ -118,19 +118,19 @@ class EnsembleTheme { static TextTheme _buildTextThemeOld(TextTheme base) { const String fontName = 'WorkSans'; return base.copyWith( - headline1: base.headline1?.copyWith(fontFamily: fontName), - headline2: base.headline2?.copyWith(fontFamily: fontName), - headline3: base.headline3?.copyWith(fontFamily: fontName), - headline4: base.headline4?.copyWith(fontFamily: fontName), - headline5: base.headline5?.copyWith(fontFamily: fontName), - headline6: base.headline6?.copyWith(fontFamily: fontName), - button: base.button?.copyWith(fontFamily: fontName), - caption: base.caption?.copyWith(fontFamily: fontName), - bodyText1: base.bodyText1?.copyWith(fontFamily: fontName), - bodyText2: base.bodyText2?.copyWith(fontFamily: fontName), - subtitle1: base.subtitle1?.copyWith(fontFamily: fontName), - subtitle2: base.subtitle2?.copyWith(fontFamily: fontName), - overline: base.overline?.copyWith(fontFamily: fontName), + displayLarge: base.displayLarge?.copyWith(fontFamily: fontName), + displayMedium: base.displayMedium?.copyWith(fontFamily: fontName), + displaySmall: base.displaySmall?.copyWith(fontFamily: fontName), + headlineMedium: base.headlineMedium?.copyWith(fontFamily: fontName), + headlineSmall: base.headlineSmall?.copyWith(fontFamily: fontName), + titleLarge: base.titleLarge?.copyWith(fontFamily: fontName), + labelLarge: base.labelLarge?.copyWith(fontFamily: fontName), + bodySmall: base.bodySmall?.copyWith(fontFamily: fontName), + bodyLarge: base.bodyLarge?.copyWith(fontFamily: fontName), + bodyMedium: base.bodyMedium?.copyWith(fontFamily: fontName), + titleMedium: base.titleMedium?.copyWith(fontFamily: fontName), + titleSmall: base.titleSmall?.copyWith(fontFamily: fontName), + labelSmall: base.labelSmall?.copyWith(fontFamily: fontName), ); } @@ -140,19 +140,18 @@ class EnsembleTheme { final ColorScheme colorScheme = const ColorScheme.light().copyWith( primary: primaryColor, secondary: secondaryColor, + surface: Colors.white, + error: const Color(0xFFB00020), ); final ThemeData base = ThemeData.light(); return base.copyWith( - colorScheme: colorScheme, primaryColor: primaryColor, indicatorColor: Colors.white, splashColor: Colors.white24, splashFactory: InkRipple.splashFactory, //accentColor: secondaryColor, canvasColor: Colors.white, - backgroundColor: const Color(0xFFFFFFFF), scaffoldBackgroundColor: const Color(0xFFF6F6F6), - errorColor: const Color(0xFFB00020), buttonTheme: ButtonThemeData( colorScheme: colorScheme, textTheme: ButtonTextTheme.primary, @@ -160,7 +159,7 @@ class EnsembleTheme { textTheme: _buildTextThemeOld(base.textTheme), primaryTextTheme: _buildTextThemeOld(base.primaryTextTheme), //accentTextTheme: _buildTextThemeOld(base.accentTextTheme), - platform: TargetPlatform.iOS, + platform: TargetPlatform.iOS, colorScheme: colorScheme.copyWith(background: const Color(0xFFFFFFFF)), ); } } diff --git a/modules/ensemble/lib/widget/carousel.dart b/modules/ensemble/lib/widget/carousel.dart index a38bc8ca..a8ad23a8 100644 --- a/modules/ensemble/lib/widget/carousel.dart +++ b/modules/ensemble/lib/widget/carousel.dart @@ -199,7 +199,7 @@ class MyController extends BoxController { int selectedItemIndex = 0; int? indicatorMaxCount; - final e.CarouselController _carouselController = e.CarouselController(); + final e.CarouselSliderController _carouselController = e.CarouselSliderController(); } class CarouselState extends EWidgetState diff --git a/modules/ensemble/lib/widget/visualization/barchart.dart b/modules/ensemble/lib/widget/visualization/barchart.dart index 11f2e033..86ebc0b6 100644 --- a/modules/ensemble/lib/widget/visualization/barchart.dart +++ b/modules/ensemble/lib/widget/visualization/barchart.dart @@ -131,7 +131,7 @@ class EnsembleBarChartState extends BaseWidgetState return BarTouchData( enabled: true, touchTooltipData: BarTouchTooltipData( - tooltipBgColor: Colors.orangeAccent, + getTooltipColor: (group) => Colors.orangeAccent, tooltipPadding: const EdgeInsets.all(0), tooltipMargin: 8, getTooltipItem: ( @@ -170,7 +170,7 @@ class EnsembleBarChartState extends BaseWidgetState BarTouchData get barTouchData => BarTouchData( enabled: true, touchTooltipData: BarTouchTooltipData( - tooltipBgColor: Colors.orangeAccent, + getTooltipColor: (group) => Colors.orangeAccent, tooltipPadding: const EdgeInsets.all(0), tooltipMargin: 8, getTooltipItem: ( diff --git a/modules/ensemble/lib/widget/visualization/chart_defaults.dart b/modules/ensemble/lib/widget/visualization/chart_defaults.dart index 31db5a95..a313d083 100644 --- a/modules/ensemble/lib/widget/visualization/chart_defaults.dart +++ b/modules/ensemble/lib/widget/visualization/chart_defaults.dart @@ -58,7 +58,7 @@ mixin ChartDefaults { LineTouchData get lineTouchData => LineTouchData( handleBuiltInTouches: true, touchTooltipData: LineTouchTooltipData( - tooltipBgColor: Colors.blueGrey.withOpacity(0.8), + getTooltipColor: (group) => Colors.blueGrey.withOpacity(0.8), ), ); FlGridData get gridData => FlGridData(show: true); diff --git a/modules/ensemble/pubspec.yaml b/modules/ensemble/pubspec.yaml index e4f9c844..c82e5245 100644 --- a/modules/ensemble/pubspec.yaml +++ b/modules/ensemble/pubspec.yaml @@ -19,7 +19,7 @@ version: 1.0.9 environment: sdk: ">=3.0.6 <4.0.0" - flutter: '<=3.19.6' + flutter: '>=3.24.0' dependencies: flutter: @@ -39,7 +39,7 @@ dependencies: cupertino_icons: ^1.0.2 http: ^1.2.1 flutter_rating_bar: ^4.0.0 - fl_chart: ^0.62.0 + fl_chart: ^0.69.0 signature: ^5.5.0 ensemble_icons: @@ -75,7 +75,7 @@ dependencies: flutter_svg_provider: ^1.0.4 qr_flutter: ^4.1.0 device_info_plus: ^9.1.2 - carousel_slider: ^4.1.1 + carousel_slider: ^5.0.0 fluttertoast: 8.2.2 video_player: ^2.6.1 lottie: ^3.0.0 diff --git a/starter/pubspec.yaml b/starter/pubspec.yaml index 1be2be72..6064a89b 100644 --- a/starter/pubspec.yaml +++ b/starter/pubspec.yaml @@ -18,7 +18,7 @@ version: 1.0.0+1 environment: sdk: ">=3.0.6 <4.0.0" - flutter: '<=3.19.6' + flutter: '>=3.24.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions From 413bed6df8f44bfdce6d5ef74607ba718bc58036 Mon Sep 17 00:00:00 2001 From: Khurram Mahmood Date: Mon, 7 Oct 2024 12:33:29 -0700 Subject: [PATCH 02/13] Update pubspec.yaml --- modules/ensemble/pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ensemble/pubspec.yaml b/modules/ensemble/pubspec.yaml index c82e5245..bdba8c19 100644 --- a/modules/ensemble/pubspec.yaml +++ b/modules/ensemble/pubspec.yaml @@ -28,7 +28,7 @@ dependencies: device_preview: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/device_preview yaml: ^3.1.2 @@ -216,4 +216,4 @@ flutter: module: androidX: true androidPackage: com.ensembleui.ensemble - iosBundleIdentifier: com.ensembleui.ensemble \ No newline at end of file + iosBundleIdentifier: com.ensembleui.ensemble From ee8ba94fd3cb28dd9f75209c43f14b375b5ffc2d Mon Sep 17 00:00:00 2001 From: Khurram Mahmood Date: Mon, 7 Oct 2024 12:39:15 -0700 Subject: [PATCH 03/13] pulling in latest (#1682) * added ToolTip widget * requested changes * https://github.com/EnsembleUI/ensemble/issues/1680 (#1681) Co-authored-by: kmahmood74 * Fixed typed issue on Conditional --------- Co-authored-by: TheNoumanDev Co-authored-by: kmahmood74 Co-authored-by: Muhammad Nouman Butt <76642732+TheNoumanDev@users.noreply.github.com> Co-authored-by: Vu Le --- .../framework/test_helper.dart | 4 +- modules/ensemble/lib/ensemble.dart | 2 +- .../ensemble_provider.dart | 40 +++-- .../host_cache_provider.dart | 1 + .../definition_providers/local_provider.dart | 5 + .../definition_providers/provider.dart | 2 +- .../definition_providers/remote_provider.dart | 5 + .../validation_provider.dart | 5 + modules/ensemble/lib/widget/conditional.dart | 2 +- modules/ensemble/lib/widget/tooltip.dart | 163 ++++++++++++++++++ .../ensemble/lib/widget/widget_registry.dart | 2 + 11 files changed, 211 insertions(+), 20 deletions(-) create mode 100644 modules/ensemble/lib/widget/tooltip.dart diff --git a/modules/ensemble/integration_test/framework/test_helper.dart b/modules/ensemble/integration_test/framework/test_helper.dart index d93cba00..727fd4bb 100644 --- a/modules/ensemble/integration_test/framework/test_helper.dart +++ b/modules/ensemble/integration_test/framework/test_helper.dart @@ -23,9 +23,9 @@ class TestHelper { I18nProps i18nProps = I18nProps('integration_test/local/$appName/i18n'); EnsembleConfig config = EnsembleConfig( - definitionProvider: LocalDefinitionProvider( + definitionProvider: await LocalDefinitionProvider( "integration_test/local/$appName/", "", - i18nProps: i18nProps, initialForcedLocale: forcedLocale)); + i18nProps: i18nProps, initialForcedLocale: forcedLocale).init()); return config.updateAppBundle(); } diff --git a/modules/ensemble/lib/ensemble.dart b/modules/ensemble/lib/ensemble.dart index c9b7071c..fb568d08 100644 --- a/modules/ensemble/lib/ensemble.dart +++ b/modules/ensemble/lib/ensemble.dart @@ -176,7 +176,7 @@ class Ensemble extends WithEnsemble with EnsembleRouteObserver { } DefinitionProvider definitionProvider = DefinitionProvider.from(yamlMap); _config = EnsembleConfig( - definitionProvider: definitionProvider, + definitionProvider: await definitionProvider.init(), appBundle: await definitionProvider.getAppBundle(), account: account, services: Services.fromYaml(yamlMap['services']), diff --git a/modules/ensemble/lib/framework/definition_providers/ensemble_provider.dart b/modules/ensemble/lib/framework/definition_providers/ensemble_provider.dart index d78dddec..8a4cce43 100644 --- a/modules/ensemble/lib/framework/definition_providers/ensemble_provider.dart +++ b/modules/ensemble/lib/framework/definition_providers/ensemble_provider.dart @@ -24,6 +24,10 @@ class EnsembleDefinitionProvider extends DefinitionProvider { appModel = AppModelTimerMode(appId); } } + Future init() async { + await appModel.init(); + return this; + } final bool isListenerMode; final String appId; late final AppModel appModel; @@ -128,6 +132,9 @@ class InvalidDefinition {} class AppModel { final String appId; AppModel(this.appId); + Future init() async { + return; + } // the cache for ID -> screen content Map artifactCache = {}; @@ -376,8 +383,9 @@ class AppModel { } } class AppModelListenerMode extends AppModel { - AppModelListenerMode(String appId): super(appId) { - initListeners(); + AppModelListenerMode(String appId): super(appId); + Future init() async { + await initListeners(); } // only 1 instance of these listeners static StreamSubscription? _artifactListener; @@ -397,7 +405,7 @@ class AppModelListenerMode extends AppModel { } } - void initListeners() async { + Future initListeners() async { final app = Ensemble().ensembleFirebaseApp; FirebaseFirestore db = FirebaseFirestore.instanceFor(app: app); @@ -423,10 +431,10 @@ class AppModelListenerMode extends AppModel { }); // hardcoded to Ensemble public widget library - initWidgetArtifactListeners(EnsembleDefinitionProvider.ensembleLibraryId); + await initWidgetArtifactListeners(EnsembleDefinitionProvider.ensembleLibraryId); } - void initWidgetArtifactListeners(String appId) async { + Future initWidgetArtifactListeners(String appId) async { final app = Ensemble().ensembleFirebaseApp; await _dependentArtifactListener?.cancel(); @@ -447,11 +455,11 @@ class AppModelListenerMode extends AppModel { } } class AppModelTimerMode extends AppModel { - AppModelTimerMode(String appId): super(appId) { - updateApp(); + AppModelTimerMode(String appId): super(appId); + Future init() async { + await updateApp(); _startTimer(); } - /// this is latest timestamp of the updatedAt or createdAt among all artifacts Timestamp? lastUpdatedAt; Timestamp? internalArtifactLastUpdateAt; @@ -470,6 +478,15 @@ class AppModelTimerMode extends AppModel { void _stopTimer() { _timer?.cancel(); } + @override + Future getAppBundle({bool? bypassCache = false}) async { + if (bypassCache == true || artifactCache.isEmpty) { + await init(); + } + return AppBundle( + theme: themeMapping != null ? artifactCache[themeMapping] : null, + resources: await getCombinedResources()); + } Future updateInternalArtifacts() async { final app = Ensemble().ensembleFirebaseApp; final String appId = EnsembleDefinitionProvider.ensembleLibraryId; @@ -534,13 +551,6 @@ class AppModelTimerMode extends AppModel { } for (var doc in snapshot.docs) { await updateArtifact(doc, isUpdate); - if (doc.data()['isRoot'] == true) { - if (doc.data()['type'] == ArtifactType.theme.name) { - themeMapping = doc.id; - } else if (doc.data()['type'] == 'screen') { - homeMapping = doc.id; - } - } lastUpdatedAt = calculateLastUpdatedAt(doc, lastUpdatedAt); } } diff --git a/modules/ensemble/lib/framework/definition_providers/host_cache_provider.dart b/modules/ensemble/lib/framework/definition_providers/host_cache_provider.dart index 57caae9a..615c1a34 100644 --- a/modules/ensemble/lib/framework/definition_providers/host_cache_provider.dart +++ b/modules/ensemble/lib/framework/definition_providers/host_cache_provider.dart @@ -15,6 +15,7 @@ class HostCachedEnsembleProvider extends EnsembleDefinitionProvider { static Future create( String appId, I18nProps i18nProps) async { final instance = HostCachedEnsembleProvider._create(appId); + await instance.init(); await instance._initCache(); return instance; } diff --git a/modules/ensemble/lib/framework/definition_providers/local_provider.dart b/modules/ensemble/lib/framework/definition_providers/local_provider.dart index a2aa9515..5d8742e0 100644 --- a/modules/ensemble/lib/framework/definition_providers/local_provider.dart +++ b/modules/ensemble/lib/framework/definition_providers/local_provider.dart @@ -75,4 +75,9 @@ class LocalDefinitionProvider extends FileDefinitionProvider { void onAppLifecycleStateChanged(AppLifecycleState state) { // no-op } + + @override + Future init() async { + return this; + } } diff --git a/modules/ensemble/lib/framework/definition_providers/provider.dart b/modules/ensemble/lib/framework/definition_providers/provider.dart index eb0f43da..7ebb352d 100644 --- a/modules/ensemble/lib/framework/definition_providers/provider.dart +++ b/modules/ensemble/lib/framework/definition_providers/provider.dart @@ -34,7 +34,7 @@ abstract class DefinitionProvider { Locale? initialForcedLocale; DefinitionProvider({this.initialForcedLocale}); - + Future init(); Future getDefinition( {String? screenId, String? screenName}); diff --git a/modules/ensemble/lib/framework/definition_providers/remote_provider.dart b/modules/ensemble/lib/framework/definition_providers/remote_provider.dart index b679c2af..7675a714 100644 --- a/modules/ensemble/lib/framework/definition_providers/remote_provider.dart +++ b/modules/ensemble/lib/framework/definition_providers/remote_provider.dart @@ -91,4 +91,9 @@ class RemoteDefinitionProvider extends FileDefinitionProvider { void onAppLifecycleStateChanged(AppLifecycleState state) { // no-op } + + @override + Future init() async { + return this; + } } diff --git a/modules/ensemble/lib/framework/definition_providers/validation_provider.dart b/modules/ensemble/lib/framework/definition_providers/validation_provider.dart index 412a1af1..cac16dfc 100644 --- a/modules/ensemble/lib/framework/definition_providers/validation_provider.dart +++ b/modules/ensemble/lib/framework/definition_providers/validation_provider.dart @@ -45,4 +45,9 @@ class ValidationProvider extends DefinitionProvider { void onAppLifecycleStateChanged(AppLifecycleState state) { // no-op } + + @override + Future init() async { + return this; + } } diff --git a/modules/ensemble/lib/widget/conditional.dart b/modules/ensemble/lib/widget/conditional.dart index 6e17f113..ceced561 100644 --- a/modules/ensemble/lib/widget/conditional.dart +++ b/modules/ensemble/lib/widget/conditional.dart @@ -142,7 +142,7 @@ class ConditionalState extends EWidgetState { } Widget _buildWidget(ScopeManager scopeManager, dynamic condition) { - var widgetDefinition = YamlMap.wrap({ + dynamic widgetDefinition = YamlMap.wrap({ condition.keys.last: condition.values.last, }); diff --git a/modules/ensemble/lib/widget/tooltip.dart b/modules/ensemble/lib/widget/tooltip.dart new file mode 100644 index 00000000..e93240a5 --- /dev/null +++ b/modules/ensemble/lib/widget/tooltip.dart @@ -0,0 +1,163 @@ +import 'package:ensemble/framework/event.dart'; +import 'package:ensemble/framework/extensions.dart'; +import 'package:ensemble/framework/theme/theme_manager.dart'; +import 'package:ensemble/widget/helpers/controllers.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:ensemble/framework/widget/widget.dart'; +import 'package:ensemble/framework/action.dart'; +import 'package:ensemble/screen_controller.dart'; +import 'package:ensemble/util/utils.dart'; +import 'package:ensemble_ts_interpreter/invokables/invokable.dart'; +import 'package:ensemble/framework/widget/has_children.dart'; +import 'package:ensemble/framework/widget/view_util.dart'; + +class ToolTip extends StatefulWidget + with Invokable, HasController { + static const type = 'ToolTip'; + + ToolTip({Key? key}) : super(key: key); + + final ToolTipController _controller = ToolTipController(); + + @override + ToolTipController get controller => _controller; + + @override + State createState() => ToolTipState(); + + @override + Map getters() { + return { + 'isVisible': () => _controller.isVisible, + }; + } + + @override + Map setters() { + return { + 'message': (value) => _controller.message = Utils.optionalString(value), + 'widget': (value) => _controller.widget = value, + 'textStyle': (value) => _controller.textStyle = Utils.getTextStyle(value), + 'verticalOffset': (value) => + _controller.verticalOffset = Utils.optionalDouble(value), + 'preferBelow': (value) => + _controller.preferBelow = Utils.optionalBool(value), + 'waitDuration': (value) => + _controller.waitDuration = Utils.getDuration(value), + 'showDuration': (value) => + _controller.showDuration = Utils.getDuration(value), + 'triggerMode': (value) => + _controller.triggerMode = TooltipTriggerMode.values.from(value), + 'onTriggered': (definition) => _controller.onTriggered = + EnsembleAction.from(definition, initiator: this), + }; + } + + @override + Map methods() { + return { + 'show': () => _controller.show(), + }; + } +} + +class ToolTipController extends BoxController { + String? message; + dynamic widget; + TextStyle? textStyle; + double? verticalOffset; + bool? preferBelow; + Duration? waitDuration; + Duration? showDuration; + TooltipTriggerMode? triggerMode; + bool isVisible = false; + EnsembleAction? onTriggered; + + void show() { + isVisible = true; + notifyListeners(); + } + + void hide() { + isVisible = false; + notifyListeners(); + } +} + +class ToolTipState extends EWidgetState with HasChildren { + final GlobalKey _tooltipKey = GlobalKey(); + + @override + void initState() { + super.initState(); + widget.controller.addListener(() => setState(() {})); + } + + void _showTooltip() { + final dynamic tooltip = _tooltipKey.currentState; + tooltip?.ensureTooltipVisible(); + widget.controller.show(); + } + + void _hideTooltip() { + final dynamic tooltip = _tooltipKey.currentState; + tooltip?.deactivate(); + widget.controller.hide(); + } + + @override + Widget buildWidget(BuildContext context) { + Widget child = widget.controller.widget != null + ? buildChild(ViewUtil.buildModel(widget.controller.widget, null)) + : const SizedBox.shrink(); + + if (kIsWeb && widget.controller.triggerMode == null) { + child = MouseRegion( + onEnter: (_) => _showTooltip(), + onExit: (_) => _hideTooltip(), + child: child, + ); + } + + return Tooltip( + key: _tooltipKey, + message: widget.controller.message ?? '', + textStyle: widget.controller.textStyle, + height: widget.controller.height?.toDouble(), + padding: widget.controller.padding, + margin: widget.controller.margin, + verticalOffset: widget.controller.verticalOffset, + preferBelow: widget.controller.preferBelow, + waitDuration: + widget.controller.waitDuration ?? const Duration(milliseconds: 0), + showDuration: + widget.controller.showDuration ?? const Duration(milliseconds: 1500), + triggerMode: widget.controller.triggerMode ?? + (kIsWeb ? null : TooltipTriggerMode.tap), + enableFeedback: true, + decoration: BoxDecoration( + color: widget._controller.backgroundColor ?? Colors.grey[700], + borderRadius: widget._controller.borderRadius?.getValue(), + border: widget._controller.borderColor != null || + widget._controller.borderWidth != null + ? Border.all( + color: widget._controller.borderColor ?? + ThemeManager().getBorderColor(context), + width: widget._controller.borderWidth?.toDouble() ?? + ThemeManager().getBorderThickness(context), + ) + : null), + onTriggered: () { + if (widget.controller.onTriggered != null) { + ScreenController().executeAction( + context, + widget.controller.onTriggered!, + event: EnsembleEvent(widget), + ); + } + }, + child: child, + ); + } +} diff --git a/modules/ensemble/lib/widget/widget_registry.dart b/modules/ensemble/lib/widget/widget_registry.dart index 2c78fb98..44d74915 100644 --- a/modules/ensemble/lib/widget/widget_registry.dart +++ b/modules/ensemble/lib/widget/widget_registry.dart @@ -59,6 +59,7 @@ import 'package:ensemble/widget/stub_widgets.dart'; import 'package:ensemble/widget/switch.dart'; import 'package:ensemble/widget/text.dart'; import 'package:ensemble/widget/toggle_button.dart'; +import 'package:ensemble/widget/tooltip.dart'; import 'package:ensemble/widget/video.dart'; import 'package:ensemble/widget/collapsible.dart'; import 'package:ensemble/widget/visualization/barchart.dart'; @@ -137,6 +138,7 @@ class WidgetRegistry { PopupMenu.type: () => PopupMenu(), EnsembleCalendar.type: () => EnsembleCalendar(), Countdown.type: () => Countdown(), + ToolTip.type: () => ToolTip(), Collapsible.type: () => Collapsible(), // form fields From 8e9a19558cfbb168402e3a881141bb10e5d5e88b Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 13:26:09 -0700 Subject: [PATCH 04/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- modules/auth/lib/signin/widget/sign_in_button.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auth/lib/signin/widget/sign_in_button.dart b/modules/auth/lib/signin/widget/sign_in_button.dart index 6e9df22a..852d2996 100644 --- a/modules/auth/lib/signin/widget/sign_in_button.dart +++ b/modules/auth/lib/signin/widget/sign_in_button.dart @@ -5,7 +5,7 @@ import 'package:ensemble/util/utils.dart'; import 'package:ensemble/widget/helpers/controllers.dart'; import 'package:ensemble_auth/signin/widget/sign_in_with_apple.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart' show Colors; import 'package:flutter_svg/svg.dart'; import 'package:sign_in_with_apple/sign_in_with_apple.dart'; From 84f19aa2d75e0a06075c9a59456798cc096d9e4c Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 14:28:13 -0700 Subject: [PATCH 05/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- modules/auth/pubspec.yaml | 6 +++--- modules/bracket/pubspec.yaml | 6 +++--- modules/camera/pubspec.yaml | 6 +++--- modules/chat/pubspec.yaml | 6 +++--- modules/connect/pubspec.yaml | 6 +++--- modules/contacts/pubspec.yaml | 6 +++--- modules/deeplink/pubspec.yaml | 6 +++--- modules/device_preview/pubspec.yaml | 2 +- modules/ensemble/pubspec.yaml | 12 ++++++------ modules/ensemble_icons/pubspec.yaml | 2 +- modules/ensemble_ts_interpreter/pubspec.yaml | 2 +- modules/firebase_analytics/pubspec.yaml | 4 ++-- modules/high_chart/pubspec.yaml | 2 +- modules/js_widget/pubspec.yaml | 2 +- .../location/lib/widget/maps/widget_to_marker.dart | 4 +++- modules/location/pubspec.yaml | 2 +- modules/otp_pin_field/pubspec.yaml | 4 ++-- modules/parsejs_null_safety/pubspec.yaml | 2 +- starter/pubspec.yaml | 4 ++-- 19 files changed, 43 insertions(+), 41 deletions(-) diff --git a/modules/auth/pubspec.yaml b/modules/auth/pubspec.yaml index 781d3991..ed89c247 100644 --- a/modules/auth/pubspec.yaml +++ b/modules/auth/pubspec.yaml @@ -18,8 +18,8 @@ description: A new Flutter module project. version: 1.0.0+1 environment: - sdk: ">=3.0.6 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -28,7 +28,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble ensemble_ts_interpreter: diff --git a/modules/bracket/pubspec.yaml b/modules/bracket/pubspec.yaml index 3c31086e..be39e8ea 100644 --- a/modules/bracket/pubspec.yaml +++ b/modules/bracket/pubspec.yaml @@ -5,8 +5,8 @@ version: 0.0.1 publish_to: none environment: - sdk: ">=3.2.1 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -14,7 +14,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble dev_dependencies: diff --git a/modules/camera/pubspec.yaml b/modules/camera/pubspec.yaml index 54d1f6e2..bd643b75 100644 --- a/modules/camera/pubspec.yaml +++ b/modules/camera/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 homepage: https://github.com/EnsembleUI/ensemble_camera environment: - sdk: ">=2.17.0 <=3.10.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble ensemble_ts_interpreter: git: diff --git a/modules/chat/pubspec.yaml b/modules/chat/pubspec.yaml index 59446808..5664b0d7 100644 --- a/modules/chat/pubspec.yaml +++ b/modules/chat/pubspec.yaml @@ -3,8 +3,8 @@ description: A new Flutter package project. version: 0.0.1 environment: - sdk: ">=3.0.5 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -13,7 +13,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble ensemble_ts_interpreter: diff --git a/modules/connect/pubspec.yaml b/modules/connect/pubspec.yaml index 2a7775ba..64b7b9b2 100644 --- a/modules/connect/pubspec.yaml +++ b/modules/connect/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 homepage: https://github.com/EnsembleUI/ensemble_connect environment: - sdk: ">=3.0.6 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -13,7 +13,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble plaid_flutter: ^3.1.2 diff --git a/modules/contacts/pubspec.yaml b/modules/contacts/pubspec.yaml index f166ea45..fca79a83 100644 --- a/modules/contacts/pubspec.yaml +++ b/modules/contacts/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 homepage: https://github.com/EnsembleUI/ensemble_contacts environment: - sdk: ">=3.0.6 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -13,7 +13,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble flutter_contacts: ^1.1.7+1 diff --git a/modules/deeplink/pubspec.yaml b/modules/deeplink/pubspec.yaml index 073a22da..847d7f90 100644 --- a/modules/deeplink/pubspec.yaml +++ b/modules/deeplink/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1 homepage: https://github.com/EnsembleUI/ensemble_deeplink environment: - sdk: ">=3.2.1 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: @@ -13,7 +13,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble flutter_branch_sdk: ^7.0.1 diff --git a/modules/device_preview/pubspec.yaml b/modules/device_preview/pubspec.yaml index 444a47f3..09f04d24 100644 --- a/modules/device_preview/pubspec.yaml +++ b/modules/device_preview/pubspec.yaml @@ -4,7 +4,7 @@ description: Approximate how your Flutter app looks and performs on another devi homepage: https://github.com/aloisdeniel/flutter_device_preview environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=3.5.0' dependencies: flutter: diff --git a/modules/ensemble/pubspec.yaml b/modules/ensemble/pubspec.yaml index bdba8c19..370bb148 100644 --- a/modules/ensemble/pubspec.yaml +++ b/modules/ensemble/pubspec.yaml @@ -18,7 +18,7 @@ description: Ensemble Runtime version: 1.0.9 environment: - sdk: ">=3.0.6 <4.0.0" + sdk: ">=3.5.0" flutter: '>=3.24.0' dependencies: @@ -45,20 +45,20 @@ dependencies: ensemble_icons: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_icons ensemble_ts_interpreter: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter # use our forked high_chart to fix iOS issue high_chart: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/high_chart event_bus: ^2.0.0 @@ -68,7 +68,7 @@ dependencies: otp_pin_field: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/otp_pin_field form_validator: ^2.1.1 flutter_svg: ^2.0.7 @@ -82,7 +82,7 @@ dependencies: js_widget: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/js_widget flutter_markdown: ^0.6.10+5 provider: ^6.0.3 diff --git a/modules/ensemble_icons/pubspec.yaml b/modules/ensemble_icons/pubspec.yaml index 6d2bebf6..50d0bfcc 100644 --- a/modules/ensemble_icons/pubspec.yaml +++ b/modules/ensemble_icons/pubspec.yaml @@ -18,7 +18,7 @@ description: A new Flutter module project. version: 0.0.1+1 environment: - sdk: '>=3.0.6 <4.0.0' + sdk: '>=3.5.0' dependencies: flutter: diff --git a/modules/ensemble_ts_interpreter/pubspec.yaml b/modules/ensemble_ts_interpreter/pubspec.yaml index 35ec7ba2..b30a26bb 100644 --- a/modules/ensemble_ts_interpreter/pubspec.yaml +++ b/modules/ensemble_ts_interpreter/pubspec.yaml @@ -24,7 +24,7 @@ documentation: https://github.com/EnsembleUI/ensemble_ts_interpreter version: 1.0.0+1 environment: - sdk: ">=2.13.0 <3.0.0" + sdk: ">=3.5.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/modules/firebase_analytics/pubspec.yaml b/modules/firebase_analytics/pubspec.yaml index 5a02e145..3cc77789 100644 --- a/modules/firebase_analytics/pubspec.yaml +++ b/modules/firebase_analytics/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: '>=3.3.1 <4.0.0' + sdk: '>=3.5.0' # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -40,7 +40,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble dev_dependencies: diff --git a/modules/high_chart/pubspec.yaml b/modules/high_chart/pubspec.yaml index 1263f321..9123dda7 100644 --- a/modules/high_chart/pubspec.yaml +++ b/modules/high_chart/pubspec.yaml @@ -5,7 +5,7 @@ version: 2.0.2 homepage: https://github.com/senthilnasa/high_chart environment: - sdk: ">=2.17.0 <3.0.0" + sdk: ">=3.5.0" dependencies: flutter: diff --git a/modules/js_widget/pubspec.yaml b/modules/js_widget/pubspec.yaml index a11087bb..7e9bde27 100644 --- a/modules/js_widget/pubspec.yaml +++ b/modules/js_widget/pubspec.yaml @@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.1 <3.0.0" + sdk: ">=3.5.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/modules/location/lib/widget/maps/widget_to_marker.dart b/modules/location/lib/widget/maps/widget_to_marker.dart index b91c8c1a..cdc26aa9 100644 --- a/modules/location/lib/widget/maps/widget_to_marker.dart +++ b/modules/location/lib/widget/maps/widget_to_marker.dart @@ -33,6 +33,7 @@ extension ToBitmapDescriptor on Widget { Future<(Uint8List, int, int)> _createImageFromWidget(Widget widget) async { final repaintBoundary = RenderRepaintBoundary(); final view = ui.PlatformDispatcher.instance.views.first; + var logicalSize = view.physicalSize / view.devicePixelRatio; final renderView = RenderView( view: view, child: RenderPositionedBox( @@ -40,7 +41,8 @@ Future<(Uint8List, int, int)> _createImageFromWidget(Widget widget) async { child: repaintBoundary, ), configuration: ViewConfiguration( - size: view.physicalSize, + physicalConstraints: BoxConstraints.tight(logicalSize) * view.devicePixelRatio, + logicalConstraints: BoxConstraints.tight(logicalSize), devicePixelRatio: view.devicePixelRatio, ), ); diff --git a/modules/location/pubspec.yaml b/modules/location/pubspec.yaml index 67a619d1..49dd2808 100644 --- a/modules/location/pubspec.yaml +++ b/modules/location/pubspec.yaml @@ -14,7 +14,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble ensemble_ts_interpreter: diff --git a/modules/otp_pin_field/pubspec.yaml b/modules/otp_pin_field/pubspec.yaml index 383a934a..3801b394 100644 --- a/modules/otp_pin_field/pubspec.yaml +++ b/modules/otp_pin_field/pubspec.yaml @@ -4,8 +4,8 @@ version: 1.2.2 homepage: https://github.com/shivbo96/otp_pin_field environment: - sdk: ">=2.18.0 <4.0.0" - flutter: ">=1.17.0" + sdk: ">=3.5.0" + flutter: ">=3.24.0" dependencies: flutter: diff --git a/modules/parsejs_null_safety/pubspec.yaml b/modules/parsejs_null_safety/pubspec.yaml index cfdfe63c..491a542f 100644 --- a/modules/parsejs_null_safety/pubspec.yaml +++ b/modules/parsejs_null_safety/pubspec.yaml @@ -8,7 +8,7 @@ homepage: https://ensembleui.com repository: https://github.com/kmahmood74/parsejs_null_safety.dart environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=3.5.0' dependencies: unicode: '>=0.0.8 <1.0.0' diff --git a/starter/pubspec.yaml b/starter/pubspec.yaml index 6064a89b..a95b8a41 100644 --- a/starter/pubspec.yaml +++ b/starter/pubspec.yaml @@ -17,7 +17,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=3.0.6 <4.0.0" + sdk: ">=3.5.0" flutter: '>=3.24.0' # Dependencies specify other packages that your package needs in order to work. @@ -36,7 +36,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble # Uncomment to enable camera module From 9d54b724c632a563f86dcc188aad4f68624a5782 Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 14:31:39 -0700 Subject: [PATCH 06/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- modules/chat/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/chat/pubspec.yaml b/modules/chat/pubspec.yaml index 5664b0d7..b2c3423b 100644 --- a/modules/chat/pubspec.yaml +++ b/modules/chat/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: ensemble_ts_interpreter: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter web_socket_client: 0.1.0 From 2e1e393ef89bed08a8a5e48179b4b21ba56d7b10 Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 14:32:36 -0700 Subject: [PATCH 07/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- modules/location/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/location/pubspec.yaml b/modules/location/pubspec.yaml index 49dd2808..8dad92cd 100644 --- a/modules/location/pubspec.yaml +++ b/modules/location/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: ensemble_ts_interpreter: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter get_it: ^7.6.0 From 8a1fcc1561b6717afdc29cc04489ae5db8c975f0 Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 14:35:35 -0700 Subject: [PATCH 08/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- modules/auth/pubspec.yaml | 2 +- modules/camera/pubspec.yaml | 2 +- modules/file_manager/pubspec.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/auth/pubspec.yaml b/modules/auth/pubspec.yaml index ed89c247..a733503d 100644 --- a/modules/auth/pubspec.yaml +++ b/modules/auth/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: ensemble_ts_interpreter: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter get_it: ^7.6.0 diff --git a/modules/camera/pubspec.yaml b/modules/camera/pubspec.yaml index bd643b75..df5cbe15 100644 --- a/modules/camera/pubspec.yaml +++ b/modules/camera/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: ensemble_ts_interpreter: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter collection: ^1.17.1 diff --git a/modules/file_manager/pubspec.yaml b/modules/file_manager/pubspec.yaml index b0b6defd..f3b2502b 100644 --- a/modules/file_manager/pubspec.yaml +++ b/modules/file_manager/pubspec.yaml @@ -14,12 +14,12 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble ensemble_ts_interpreter: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter file_picker: ^5.2.10 From 9bf53d028bbb0a526101928af1338f3669f6b8eb Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 18:56:01 -0700 Subject: [PATCH 09/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- modules/parsejs_null_safety/lib/src/lexer.dart | 2 +- modules/parsejs_null_safety/lib/src/parser.dart | 6 +++--- modules/parsejs_null_safety/test/ast_json.dart | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/parsejs_null_safety/lib/src/lexer.dart b/modules/parsejs_null_safety/lib/src/lexer.dart index 03638e8d..be8220ca 100644 --- a/modules/parsejs_null_safety/lib/src/lexer.dart +++ b/modules/parsejs_null_safety/lib/src/lexer.dart @@ -176,7 +176,7 @@ bool isEOL(int x) { class Lexer { Lexer(String text, - {this.filename, this.currentLine: 1, this.index: 0, this.endOfFile}) { + {this.filename, this.currentLine=1, this.index= 0, this.endOfFile}) { input = text.codeUnits; if (endOfFile == null) { endOfFile = input.length; diff --git a/modules/parsejs_null_safety/lib/src/parser.dart b/modules/parsejs_null_safety/lib/src/parser.dart index 06ce5168..a3c2e8d7 100644 --- a/modules/parsejs_null_safety/lib/src/parser.dart +++ b/modules/parsejs_null_safety/lib/src/parser.dart @@ -541,7 +541,7 @@ class Parser { return exp; } - Expression parseAssignment({bool allowIn: true}) { + Expression parseAssignment({bool allowIn= true}) { int? start = token!.startOffset; Expression exp = parseConditional(allowIn); if (token!.type == Token.ASSIGN) { @@ -555,7 +555,7 @@ class Parser { return exp; } - Expression parseExpression({bool allowIn: true}) { + Expression parseExpression({bool allowIn= true}) { int? start = token!.startOffset; Expression exp = parseAssignment(allowIn: allowIn); if (token!.type == Token.COMMA) { @@ -589,7 +589,7 @@ class Parser { ..line = line; } - VariableDeclaration parseVariableDeclarationList({bool allowIn: true}) { + VariableDeclaration parseVariableDeclarationList({bool allowIn= true}) { int? start = token!.startOffset; int? line = token!.line; assert(token!.text == 'var'); diff --git a/modules/parsejs_null_safety/test/ast_json.dart b/modules/parsejs_null_safety/test/ast_json.dart index 7e4e9271..9e642759 100644 --- a/modules/parsejs_null_safety/test/ast_json.dart +++ b/modules/parsejs_null_safety/test/ast_json.dart @@ -8,7 +8,7 @@ class Ast2Json extends Visitor { bool ranges; bool lines; - Ast2Json({this.ranges: false, this.lines: false}); + Ast2Json({this.ranges= false, this.lines= false}); // NOTE: The order in which properties are mentioned is significant, since properties // must be mentioned in the same order for our JSON comparator to work. @@ -255,4 +255,8 @@ class Ast2Json extends Visitor { visitRegexp(RegexpExpression node) => {'type': 'Literal', 'value': {}, 'raw': node.regexp}; + + @override + Object? visitArrowFunctionNode(ArrowFunctionNode node) { + } } From 23edcb33159ee8ed98a0c2a2a222367ae376136c Mon Sep 17 00:00:00 2001 From: kmahmood74 Date: Mon, 7 Oct 2024 19:14:23 -0700 Subject: [PATCH 10/13] https://github.com/EnsembleUI/ensemble/issues/1678 moving to flutter 3.24+ --- .gitignore | 3 +++ modules/ensemble_network_info/pubspec.yaml | 6 +++--- modules/ensemble_ts_interpreter/pubspec.yaml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b0a57888..1fa4d8c8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ pubspec_overrides.yaml /starter/ios/Flutter starter/ios/Runner.xcodeproj/project.pbxproj /node_modules + +# FVM Version Cache +.fvm/ \ No newline at end of file diff --git a/modules/ensemble_network_info/pubspec.yaml b/modules/ensemble_network_info/pubspec.yaml index 523225bd..dedaff31 100644 --- a/modules/ensemble_network_info/pubspec.yaml +++ b/modules/ensemble_network_info/pubspec.yaml @@ -3,8 +3,8 @@ description: Module that provides wifi related information such as wifi name, SS version: 0.0.1 environment: - sdk: ">=3.0.6 <4.0.0" - flutter: "3.19.3" + sdk: ">=3.5.0" + flutter: "3.24.0" dependencies: flutter: @@ -12,7 +12,7 @@ dependencies: ensemble: git: url: https://github.com/EnsembleUI/ensemble.git - ref: ensemble-v1.0.9 + ref: 1678_flutter_3.24 path: modules/ensemble network_info_plus: ^5.0.3 diff --git a/modules/ensemble_ts_interpreter/pubspec.yaml b/modules/ensemble_ts_interpreter/pubspec.yaml index b30a26bb..9bea126d 100644 --- a/modules/ensemble_ts_interpreter/pubspec.yaml +++ b/modules/ensemble_ts_interpreter/pubspec.yaml @@ -52,7 +52,7 @@ dependencies: jsparser: git: url: https://github.com/EnsembleUI/ensemble.git - ref: main + ref: 1678_flutter_3.24 path: modules/parsejs_null_safety source_span: ^1.9.1 intl: '>=0.18.1 <=0.19.0' From afc4b2f1b60b2609f99567fa39d5e98810cdd2ce Mon Sep 17 00:00:00 2001 From: Sneh Mehta Date: Wed, 9 Oct 2024 20:52:44 +0530 Subject: [PATCH 11/13] chores: update packages version --- modules/ensemble/lib/deep_link_manager.dart | 2 +- modules/ensemble/pubspec.yaml | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/ensemble/lib/deep_link_manager.dart b/modules/ensemble/lib/deep_link_manager.dart index 4a288a92..04b172c4 100644 --- a/modules/ensemble/lib/deep_link_manager.dart +++ b/modules/ensemble/lib/deep_link_manager.dart @@ -101,7 +101,7 @@ class DeepLinkManager extends DeepLinkNavigator { /// the default screen. But we don't need to check for the initial load void _checkInitialLink() async { try { - Uri? initialUri = await _appLinks!.getInitialAppLink(); + Uri? initialUri = await _appLinks!.getLatestLink(); if (initialUri != null) { navigateToScreen(initialUri); } diff --git a/modules/ensemble/pubspec.yaml b/modules/ensemble/pubspec.yaml index 370bb148..357b8864 100644 --- a/modules/ensemble/pubspec.yaml +++ b/modules/ensemble/pubspec.yaml @@ -74,7 +74,7 @@ dependencies: flutter_svg: ^2.0.7 flutter_svg_provider: ^1.0.4 qr_flutter: ^4.1.0 - device_info_plus: ^9.1.2 + device_info_plus: ^10.1.0 carousel_slider: ^5.0.0 fluttertoast: 8.2.2 video_player: ^2.6.1 @@ -86,7 +86,7 @@ dependencies: path: modules/js_widget flutter_markdown: ^0.6.10+5 provider: ^6.0.3 - cloud_firestore: 4.17.4 + cloud_firestore: ^5.4.4 get_storage: ^2.0.3 flutter_html: ^3.0.0-beta.1 # flutter_html ^2.0.0 requires flutter_svg <1.0.0, conflicts with ours webview_flutter: ^4.2.0 @@ -94,28 +94,28 @@ dependencies: sensors_plus: ^3.0.0 mime: ^1.0.4 flutter_cache_manager: ^3.3.0 - google_fonts: ^4.0.3 + google_fonts: ^6.2.1 walletconnect_dart: ^0.0.11 http_parser: ^4.0.2 shared_preferences: ^2.1.1 workmanager: ^0.5.1 - flutter_local_notifications: ^16.1.0 + flutter_local_notifications: ^17.2.3 flutter_i18n: ^0.35.1 pointer_interceptor: ^0.9.3+4 - flutter_secure_storage: ^8.1.0 + flutter_secure_storage: ^9.2.2 staggered_grid_view_flutter: ^0.0.4 dart_jsonwebtoken: ^2.8.2 flutter_dotenv: ^5.1.0 - get_it: ^7.6.0 + get_it: ^8.0.0 custom_image_crop: ^0.0.10 app_settings: ^5.0.0 - firebase_messaging: 14.9.3 - firebase_core: 2.31.1 + firebase_messaging: ^15.1.3 + firebase_core: ^3.6.0 custom_refresh_indicator: ^2.2.1 youtube_player_iframe: ^4.0.4 web_socket_client: ^0.1.0 - app_links: ^3.4.3 - share_plus: ^7.2.2 + app_links: ^6.3.2 + share_plus: ^10.0.3 rate_my_app: ^2.0.0 table_calendar: git: From 1bb7e2edd1af1ce70edce84545d34389d89b9a7a Mon Sep 17 00:00:00 2001 From: Sneh Mehta Date: Wed, 9 Oct 2024 23:49:49 +0530 Subject: [PATCH 12/13] resolve conflict issue --- modules/auth/pubspec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/auth/pubspec.yaml b/modules/auth/pubspec.yaml index a733503d..efa2d18c 100644 --- a/modules/auth/pubspec.yaml +++ b/modules/auth/pubspec.yaml @@ -37,11 +37,11 @@ dependencies: ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter - get_it: ^7.6.0 + get_it: ^8.0.0 google_sign_in: ^6.1.4 sign_in_with_apple: ^5.0.0 - firebase_auth: 4.19.6 - firebase_core: 2.31.1 + firebase_auth: ^5.3.1 + firebase_core: ^3.6.0 flutter_web_auth_2: ^2.1.4 flutter_svg: ^2.0.7 crypto: ^3.0.3 From 84dca7b69857230486af41f773e00ba17ae694a5 Mon Sep 17 00:00:00 2001 From: Sneh Mehta Date: Thu, 10 Oct 2024 00:24:02 +0530 Subject: [PATCH 13/13] fix firebase core issue --- modules/firebase_analytics/pubspec.yaml | 4 ++-- modules/location/pubspec.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/firebase_analytics/pubspec.yaml b/modules/firebase_analytics/pubspec.yaml index 3cc77789..9c4c89a7 100644 --- a/modules/firebase_analytics/pubspec.yaml +++ b/modules/firebase_analytics/pubspec.yaml @@ -35,8 +35,8 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 - firebase_analytics: ^10.8.10 - firebase_crashlytics: ^3.4.19 + firebase_analytics: ^11.3.3 + firebase_crashlytics: ^4.1.3 ensemble: git: url: https://github.com/EnsembleUI/ensemble.git diff --git a/modules/location/pubspec.yaml b/modules/location/pubspec.yaml index 8dad92cd..f155f810 100644 --- a/modules/location/pubspec.yaml +++ b/modules/location/pubspec.yaml @@ -23,7 +23,7 @@ dependencies: ref: 1678_flutter_3.24 path: modules/ensemble_ts_interpreter - get_it: ^7.6.0 + get_it: ^8.0.0 google_maps_flutter: ^2.6.0 flutter_cache_manager: ^3.3.0 geolocator: ^9.0.2