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

Added takeScreenshot Action #1775

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Added takeScreenshot Action #1775

wants to merge 7 commits into from

Conversation

mehsaandev
Copy link
Contributor

No description provided.

@kmahmood74
Copy link
Collaborator

@mehsaandev no reviewer?

@kmahmood74
Copy link
Collaborator

also which ticket does this address? add the proposed yaml to that ticket. Let's get things done properly please

@mehsaandev mehsaandev linked an issue Jan 6, 2025 that may be closed by this pull request
@mehsaandev mehsaandev marked this pull request as ready for review January 6, 2025 16:39
@mehsaandev mehsaandev requested a review from snehmehta January 6, 2025 16:39
@mehsaandev
Copy link
Contributor Author

mehsaandev commented Jan 6, 2025

@snehmehta PTAL
Ticket: #1771

@mehsaandev mehsaandev changed the title Added ScreenshotContainer Added takeScreenshot Action Jan 6, 2025
@@ -109,6 +109,7 @@ dependencies:
web_socket_client: ^0.1.0
app_links: ^6.3.2
share_plus: ^10.0.3
screenshot: ^3.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

look at the source code, i don't think this package add that much value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am getting ScreenshotController from this package.

throw LanguageError("Widget not found: '$widgetId'");
}

final widget = Screenshot(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure if this will work as you are taking a live widget that putting it in a separate render tree? have you tested it in android, ios and web with many different types of widgets? what if the widget is a form with values entered by the user? if it is limited to readonly widgets, make that clear.

child: widget,
),
),
delay: const Duration(milliseconds: 1000),
Copy link
Collaborator

Choose a reason for hiding this comment

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

why delay?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ADD comments in the code!

final widget = Screenshot(
controller: screenshotController,
child: DataScopeWidget(
scopeManager: scopeManager,
Copy link
Collaborator

Choose a reason for hiding this comment

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

test the case where the takescreenshot action is being invoked from the bottom sheet or a dialog and the widgetId is of a widget that is on the main screen. scopeManager may have issues in that case so please check that case.

event: EnsembleEvent(initiator, data: {'error': e.toString()}),
);
}
rethrow;
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you actually tested it? rethrowing the error may cause issues. TEST the error case please

@@ -1165,6 +1167,8 @@ abstract class EnsembleAction {
return FilePickerAction.fromYaml(payload: payload);
} else if (actionType == ActionType.openUrl) {
return OpenUrlAction.fromYaml(payload: payload);
} else if (actionType == ActionType.takeScreenshot) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

please test to make sure that this action can be invoked from javascript as ensemble.takeScreenshot You have only added the yaml support and not js support. ALWAYS test the js as well and add that as kitchen sink example and documentation

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.

require an action to capture image/screenshot of the Container
4 participants