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

SweetSheet improvement - 1/3 : Do not use Strings for Title and Description #2

Open
MsXam opened this issue Apr 4, 2020 · 0 comments

Comments

@MsXam
Copy link

MsXam commented Apr 4, 2020

Hi there ...

Currently your Component has a method signature such that it expects Strings for Title and Description. This should be changed so that a Widget is supplied in-place of the Strings. You need this because your current component does not support accessibility meaning that the Text(...) widget that you internally use to render the Title & Description will take its TextScaleFactor for MediaQuery.

This can lead to overflow errors when the Bottom sheet is rendered.

Suggestion

Change the method :

show({
@required BuildContext context,
Text title,
@required Text description,
@required CustomSheetColor color,
@required SweetSheetAction positive,
SweetSheetAction negative,
IconData icon,
}) {

To

show({
@required BuildContext context,
Widget title,
@required Widget description,
@required CustomSheetColor color,
@required SweetSheetAction positive,
SweetSheetAction negative,
IconData icon,
}) {

This will allow callers of Show to handle their own Accessibility for both Title & Description and Since these will be changed to Widget, we can further use composition to wrap them , i.e


show(context:context,
           title:FixedSizedTitle(child:Text('My SweetTitle')),
description:FixedSizedTitle(child:Text('My Sweet description etc')),
....
)
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

No branches or pull requests

1 participant