-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: Adds support for custom keyboard pages and other customizations #58
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi 👋🏽 Thank you for opening your first PR with simpleclub/math_keyboard ❤
You can expect a review from us soon
In the meantime, please check our contribution guidelines, the PR checklist, and the PR checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sub6Resources Thanks Matthew for the contribution😍 And sorry for the late review! I have just some nits but happy to merge this one then:)
/// The buttons to display. | ||
final List<List<KeyboardButtonConfig>>? page2; | ||
/// The configuration for all the pages on the keyboard. | ||
final List<CustomButtonPage>? pages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final List<CustomButtonPage>? pages; | |
final List<CustomButtonPage> pages; |
I think this can't be nullable anymore
else if (type == | ||
MathKeyboardType.expression) | ||
standardKeyboard, | ||
if (type == MathKeyboardType.expression) | ||
functionKeyboard, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if (type == | |
MathKeyboardType.expression) | |
standardKeyboard, | |
if (type == MathKeyboardType.expression) | |
functionKeyboard, | |
if (type == MathKeyboardType.expression) | |
standardKeyboard, | |
functionKeyboard, |
...(widget.customPages.fold<List<List<KeyboardButtonConfig>>>( | ||
[], | ||
(previousValue, customPage) { | ||
return previousValue..addAll(customPage.buttonLayout); | ||
}, | ||
)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...(widget.customPages.fold<List<List<KeyboardButtonConfig>>>( | |
[], | |
(previousValue, customPage) { | |
return previousValue..addAll(customPage.buttonLayout); | |
}, | |
)), | |
for (final page in widget.customPages) | |
...page.buttonLayout |
Could you check if this works?🙂
@Sub6Resources @edhom this is a very useful PR can it be merged |
Description
bool secondPage
has been replaced withint page
inMathFieldEditingController
to allow for more than two pages.customPages
attribute that takes a list ofCustomButtonPage
s.CustomButtonPage
takes aList<List<KeyboardButtonConfig>>
as well as an optionallabel
oricon
to be shown using thePageButtonConfig
.fontSize
attribute toMathKeyboard
and akeyboardButtonFontSize
attribute toMathField
to allow the font size of the keyboard buttons to be adjusted.heightFactor
attribute toKeyboardButtonConfig
to allow for customization of the height of keyboard rows.MathKeyboard
to test the functionality of custom and default pages on the keyboard.Related issues & PRs
None
Checklist
contributing guide.
math_keyboard
orexample
package(also README etc.), I created an entry in
CHANGELOG.md
(## UPCOMING RELEASE
if the changeon its own is not worth an update).
math_keyboard
package, I updated the versionaccording to Dart's semantic versioning.