Skip to content

feat: Adds support for custom keyboard pages and other customizations#58

Open
Sub6Resources wants to merge 1 commit into
simpleclub:mainfrom
Sub6Resources:main
Open

feat: Adds support for custom keyboard pages and other customizations#58
Sub6Resources wants to merge 1 commit into
simpleclub:mainfrom
Sub6Resources:main

Conversation

@Sub6Resources

@Sub6Resources Sub6Resources commented Aug 8, 2023

Copy link
Copy Markdown

Description

  • BREAKING: bool secondPage has been replaced with int page in MathFieldEditingController to allow for more than two pages.
  • Adds support for custom keyboard pages using the new customPages attribute that takes a list of CustomButtonPages.
    • Each CustomButtonPage takes a List<List<KeyboardButtonConfig>> as well as an optional label or icon to be shown using the PageButtonConfig.
    • The existing pages were wrapped in this class.
  • Adds a fontSize attribute to MathKeyboard and a keyboardButtonFontSize attribute to MathField to allow the font size of the keyboard buttons to be adjusted.
  • Adds a heightFactor attribute to KeyboardButtonConfig to allow for customization of the height of keyboard rows.
  • Adds widget tests for MathKeyboard to test the functionality of custom and default pages on the keyboard.

Related issues & PRs

None

Checklist

  • I have made myself familiar with the CaTeX
    contributing guide.
  • I added a PR description.
  • I linked all related issues and PRs I could find (no links if there are none).
  • If this PR changes anything about the main math_keyboard or example package
    (also README etc.), I created an entry in CHANGELOG.md (## UPCOMING RELEASE if the change
    on its own is not worth an update).
  • If this PR includes a notable change in the math_keyboard package, I updated the version
    according to Dart's semantic versioning.
  • If there is new functionality in code, I added tests covering all my additions.
  • All required checks pass.

@Sub6Resources Sub6Resources requested a review from edhom as a code owner August 8, 2023 02:41

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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.

@edhom edhom left a comment

Copy link
Copy Markdown
Member

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
final List<CustomButtonPage>? pages;
final List<CustomButtonPage> pages;

I think this can't be nullable anymore

Comment on lines +144 to +148
else if (type ==
MathKeyboardType.expression)
standardKeyboard,
if (type == MathKeyboardType.expression)
functionKeyboard,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
else if (type ==
MathKeyboardType.expression)
standardKeyboard,
if (type == MathKeyboardType.expression)
functionKeyboard,
if (type == MathKeyboardType.expression)
standardKeyboard,
functionKeyboard,

Comment on lines +399 to +404
...(widget.customPages.fold<List<List<KeyboardButtonConfig>>>(
[],
(previousValue, customPage) {
return previousValue..addAll(customPage.buttonLayout);
},
)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
...(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?🙂

@absar

absar commented Jul 21, 2024

Copy link
Copy Markdown

@Sub6Resources @edhom this is a very useful PR can it be merged

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

sumitsharansatsangi added a commit to sumitsharansatsangi/math_keyboard that referenced this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants