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] Optional by adding few onPressedCallback in AgoraVideoButtons Widget class #90

Closed
gtiger165 opened this issue Jun 12, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@gtiger165
Copy link

Is your feature request related to a problem? Please describe.
This lib ui kit really helpful for me to implement Video Call in flash, but some cases like when i pressed end call button i need to show some pop up dialog first, then after i choose an option execute end button call functionality.

Describe the solution you'd like
So i've read the code in buttons.dart. I believe in AgoraVideoButtons there's a param like disconnectButtonChild, if i want to customize ui button for each functionallity that i need. So the solution that i propose is by adding onPressedCallback params like "onDisconnectButtonPressed" and etc.

Describe alternatives you've considered
as example, in method _disconnectCallButton :

...
  AgoraVideoButtons(
      client: controller.videoClient,
      // onDisconnectButtonPressed return Future<void>
      onDisconnectButtonPressed: () async {}
  ),
...
Widget _disconnectCallButton() {
    return widget.disconnectButtonChild != null
        ? RawMaterialButton(
            onPressed: () async {
              // before executing _onCallEnd method
              // implement onDisconnectButtonPressed Function first
              await onDisconnectButtonPressed();
              await  _onCallEnd(context);
            },
            child: widget.disconnectButtonChild,
          )
        : RawMaterialButton(
            onPressed: () => _onCallEnd(context),
            child: Icon(Icons.call_end, color: Colors.white, size: 35),
            shape: CircleBorder(),
            elevation: 2.0,
            fillColor: Colors.redAccent,
            padding: const EdgeInsets.all(15.0),
          );
  }

Additional context
So in my case i only need onPressedCallback on disconnectButtonChild, thank you for your attention and i apologize if there something wrong in my explanation. I'll be looking foward for next feature of this library.

@gtiger165 gtiger165 added the enhancement New feature or request label Jun 12, 2022
@Meherdeep
Copy link
Contributor

@gtiger165 Thanks for submitting your suggestion and yes, I agree that will be a helpful feature. You can submit a PR for the same or I will make sure to add this feature in our next release.

@gtiger165
Copy link
Author

thanks @Meherdeep, i'll try to submit later on my free time.

@Meherdeep
Copy link
Contributor

@gtiger165 This feature has been added to the latest release v1.0.3

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

No branches or pull requests

2 participants