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

Add share button to share generated API integration code (Android/iOS) #550

Open
ashitaprasad opened this issue Jan 25, 2025 · 2 comments
Open
Labels
enhancement New feature or request FOSSHack2025

Comments

@ashitaprasad
Copy link
Member

Mobile versions of API Dash can include a share button in "View Code" section to easily share the generated code on Whatsapp/Mail/etc.

@ashitaprasad ashitaprasad added enhancement New feature or request FOSSHack2025 labels Jan 25, 2025
@abhinavs1920
Copy link

To add a share button in the "View Code" section of the mobile versions of API Dash, I will follow the below steps:

Step-by-Step Approach:

  1. Add a Share Button:

    • In the UI of the "View Code" section, add a button or icon that represents the share action. This can be done using Flutter's IconButton or FloatingActionButton.
  2. Implement Sharing Functionality:

    • Use Flutter's share_plus package to implement the sharing functionality. This package allows you to share text or files via other apps installed on the device, such as WhatsApp or email clients.
  3. Integrate the Share Button:

    • Ensure that the share button is only visible on mobile platforms. I can use platform checks (e.g., kIsMobile) to conditionally display the button.
  4. Handle the Share Action:

    • When the share button is pressed, retrieve the generated code from the "View Code" section and pass it to the Share.share method from the share_plus package.
  5. Test the Implementation:

    • Test the share functionality on both Android and iOS devices to ensure it works as expected and that the code is shared correctly via different apps.

@ashitaprasad

@ashitaprasad
Copy link
Member Author

@abhinavs1920 Share across a draft PR adding the button at the correct location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request FOSSHack2025
Projects
None yet
Development

No branches or pull requests

2 participants