搜索插件、代码仓与 APP 分类

math_keyboard 封面
插件详情v0.4.0

math_keyboard

在 Flutter 中使用屏幕软件键盘或物理键盘输入,在排版输入字段中编辑数学表达式。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1.1万
喜欢数
148
Pub 分数
140

安装插件

flutter pub add math_keyboard

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

math_keyboard 包通过屏幕软件键盘或物理键盘,使 Flutter 应用中的数学表达式输入更加直观。它支持排版渲染,确保输入字段内的数学符号清晰且视觉准确。专为教育和科学应用设计,可在多个平台上无缝集成到 Flutter 的 UI 框架中。该包能够处理复杂的表达式并正确格式化,非常适合交互式学习工具和以数学为重点的界面。

适合场景

  • 数学教育应用
  • 科学计算器
  • 交互式问题求解器
  • 在线数学辅导平台
  • 基于表单的数学输入表单

主要特点

  • 排版数学表达式渲染
  • 屏幕和物理键盘支持
  • 跨平台兼容性
  • 实时表达式编辑
  • 可自定义的键盘布局

适合对象

  • 教育类应用开发者
  • STEM学习工具创作者
  • 专注于数学的表单输入
  • Flutter 开发者构建交互式数学界面

使用建议

  • 需要仔细处理表达式解析
  • 可能需要对复杂表达式进行额外验证
  • 仅限数学特定输入模式
  • 不适用于常规文本输入
  • 性能取决于表达式的复杂性

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

math_keyboard logo

math_keyboard Flutter web demo math_keyboard on Pub

math_keyboard is a Flutter package that allows editing math expressions using a typeset input field (so-called "math field") and a custom-made fully integrated math keyboard in Flutter only - no plugins, no web views.

About math_keyboard

The math_keyboard package provides a widget that behaves like a Flutter TextField with the same full integration, i.e. focus tree support, input decoration support, and both an on-screen software keyboard as well as physical keyboard input support. On top of that, the math field typesetting uses TeX and the package supports converting to math expressions (that e.g. can be used for calculation).

math_keyboard is an open source project with the aim of providing a way to edit math expression providing the best user experience in terms of input and UI as well as allowing accurate evaluation of the mathematical expressions entered by the user. This is used by the simpleclub app, hence, the association. It is also maintained by simpleclub (see the LICENSE file).

Features & usage

See the package README for features and usage information.

You can also try the demo app or view the package on Pub → math_keyboard Flutter web demo math_keyboard on Pub

Implementation

In the following, some high-level information regarding the implementation of the package is described. This is useful in case you are curious or intend to contribute.

For information on implementing math_keyboard into your own app, please see the package README.

Math expressions

Notice how the math_keyboard package includes a major feature that allows working with the input expressions in a mathematical matter, i.e. by converting them into "math expressions" (this is how we refer to the format in the context of this project).

We achieve this by essentially working with two formats:

  • The typeset display format, powered by TeX (see below).
  • A data format, i.e. math expressions.

This "data format" depends on the math_expressions package. Handling the expressions in this format allows you to e.g. evaluate the expressions.

TeX typesetting

Both the math field content, i.e. the expressions typed by the user, as well as some symbols on the keyboard itself are typeset using TeX. For TeX typesetting in Flutter, we created our own proof of concept renderer in early 2020, called CaTeX. This project is on-hold for now and in the meantime, we collaborated on the flutter_math package that aims to achieve something similar.
Due to lack of maintenance on that repo, we are currently using our forked version, flutter_math_fork. Note that our ultimate goal is fully integrating the math_keyboard package with the catex package, which would give us maximum control over the rendering of the typeset math.

Contributing

Our mission with open source repositories like math_keyboard in particular is creating an ecosystem of science and education related packages for Flutter, allowing users on all platforms to use the optimal tools for learning.

This is also why we want to share and collaborate on this software as a way to give back to the community. Any contributions are more than welcome!

See our contributing guide for more information.

Missing features

You might notice that some features that you would expect from the math_keyboard package are missing or something is not working as expected. In that case, please file an issue.

In general, we can of course never fully solve every use case, however, especially in this case we are aware of a few shortcomings. For example the customization options of the keyboard are currently limited because this has simply not yet been a requirement in our internal usage. In that case, please consider contributing pull requests to this repo in order to allow as many use cases to be covered as possible :) Please refer to the contributing guide for that.

Repo structure

The math_keyboard repository is divided into multiple packages. These packages are the following:

Package Content
math_keyboard Main package implementation
math_keyboard_demo Demo app

Num++ inspiration

During the research phase of this project, we came across the Num++ app, which served as an inspiration for the math expression parsing part of the package.
The main difference between that app and this package (apart from one being a calculator app and the other being a generalized usable package) is the fact that Num++ uses a web view and MathQuill for editing the expression while we built the input field and editing ourselves.

所属分类

依赖

依赖清单 6 项

源码仓库

使用此插件的项目

暂无相关数据。