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

Feature -> Develop | Added Platform Channel Service #44

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

we-mohd-i001
Copy link

Task #28 - Platform Specific Code > Method Channel & Event Channel

Time invested: hh:mm format 18:20 | Billable: 18:20 | Non-Billable: 00:00

Problem Statement

  1. The VaahFlutter doesn't have the option to use the Platform channels to establish communication between the native and Flutter side using Method and Event channels.

Describe The Fix/ Solution You Implemented
I have added a service that can used to invoke methods and get event streams from the native side.

Proof of your testing (Demo link or video links or image links)

Dependencies
Updated:
Added:

Merge Request Checklist

  • I have performed a self-review of my code
  • My code does follow industry standards
  • My code doesn't produce warnings/ errors for dart analyzer
  • New and existing tests pass locally with my changes (No tests are there as of now)
  • The code modified as part of this PR has been covered with tests
  • My code is properly formatted
  • I've followed the proper naming conventions
  • I have rebased the feature on the latest develop
  • I have run flutter run after the rebase
  • I have added new dependencies/ updated old dependencies
  • I have read all the comments & notes in wireframe and verified that I did take care of that
  • verify that the UI must match with design & wireframe if available
  • I have updated the version/ build (x.x.x+xxx)
  • I've verified that the latest commit of develop exists in your feature branch after rebase.
  • My fix achieves 100% of what is required
  • Can enhance the solution in the future because better implementation could be made

@we-prajapati-c001
Copy link
Collaborator

Handing this over to @we-kislay-k001 from @we-mohd-i001

@we-md-s001 we-md-s001 force-pushed the feature/add-platform-communication branch 2 times, most recently from 32100eb to 798ce11 Compare January 31, 2025 12:02
@we-prajapati-c001 we-prajapati-c001 force-pushed the feature/add-platform-communication branch from 798ce11 to e36b22e Compare February 18, 2025 05:43
@we-md-s001 we-md-s001 force-pushed the feature/add-platform-communication branch 3 times, most recently from fd0ab60 to 38d741b Compare February 25, 2025 13:26
@we-md-s001 we-md-s001 force-pushed the feature/add-platform-communication branch from 38d741b to c99f3ab Compare March 6, 2025 13:03
@@ -17,5 +17,6 @@
"one_signal_config": null,
"pusher_config": null,
"show_debug_panel": false,
"method_channel_name": "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Noticing a difference in method_channel configurations between develop.json and production.json method_channel_map is an object in one, while method_channel_name is a string in the other. Just wanted to check if this is intentional else we should fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

done

@@ -17,5 +17,6 @@
"one_signal_config": null,
"pusher_config": null,
"show_debug_panel": true,
"method_channel_name": "",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Noticing a difference in method_channel configurations between develop.json and production.json method_channel_map is an object in one, while method_channel_name is a string in the other. Just wanted to check if this is intentional else we should fix it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

done

/// Calls the native platform method to show a snackbar.
Future<void> _showNativeSnackbar() async {
try {
final String? result = await _platform.invokeMethod<String>('showSnackbar');
Copy link
Collaborator

@we-lokesh-m001 we-lokesh-m001 Mar 10, 2025

Choose a reason for hiding this comment

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

we could use a file to keep track of methods like - PlatformMethods.showSnackbar for known methods while allowing users to call any method name as a string, instead of hard-coding it.

Copy link
Collaborator

@we-md-s001 we-md-s001 Mar 10, 2025

Choose a reason for hiding this comment

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

sure I will find a better way instead of harcoding it.

@we-md-s001 we-md-s001 force-pushed the feature/add-platform-communication branch from c99f3ab to 65a2232 Compare March 10, 2025 13:29
@we-md-s001 we-md-s001 force-pushed the feature/add-platform-communication branch from 0bc12c3 to 57a2596 Compare March 21, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants