Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor dart call forwarding #183

Merged
merged 3 commits into from
Nov 28, 2024

Conversation

mrehan27
Copy link
Contributor

part of: MBL-660

Changes

  • Relocated constants to local directories for each module
  • Simplified forwarding calls to native methods by adding extensions
  • Made inAppMessaging a static property to align with the initial proposal
  • Updated public API to expose all methods as Future, reflecting asynchronous nature of native calls
  • Fixed and updated tests to align with these changes

@mrehan27 mrehan27 self-assigned this Nov 26, 2024
Copy link

github-actions bot commented Nov 26, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • amiapp_flutter: 183.3.0 (28879862)

@mrehan27 mrehan27 force-pushed the rehan/mbl-660-dart-refactor branch from 7e4fd34 to ad14375 Compare November 26, 2024 20:35
}

/// Access in-app messaging functionality
CustomerIOMessagingInAppPlatform get inAppMessaging => _inAppMessaging;
static CustomerIOMessagingInAppPlatform get inAppMessaging {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to match with initial proposal and with pushMessaging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file has been moved to lib/data_pipelines/customer_io_method_channel.dart below. But due to significant content changes (because of extension), GitHub shows it as a deleted file.

import 'customer_io_platform_interface.dart';

/// An implementation of [CustomerIOPlatform] that uses method channels.
class CustomerIOMethodChannel extends CustomerIOPlatform {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated implementation of lib/customer_io_method_channel.dart using extensions

@mrehan27 mrehan27 requested a review from Shahroz16 November 26, 2024 20:44
Copy link
Collaborator

@Shahroz16 Shahroz16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we dont need to make all methods Future its only for those where we need to make sure native code is executed before the dart code, e.g initialize for rest we are okay to use just void.

lib/customer_io.dart Outdated Show resolved Hide resolved
lib/customer_io.dart Outdated Show resolved Hide resolved
@mrehan27
Copy link
Contributor Author

Discussed on call, and we decided to stick with void. I'll go ahead and revert all updates for Future<void>.

@mrehan27 mrehan27 requested a review from Shahroz16 November 28, 2024 11:49
@mrehan27 mrehan27 merged commit 94a65e0 into feature/data-pipelines-support Nov 28, 2024
6 checks passed
@mrehan27 mrehan27 deleted the rehan/mbl-660-dart-refactor branch November 28, 2024 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants