view.buttons library Null safety
The overall structure is this:
See CalculatorButton for more details.
- A helper to create the buttons and their associated layout.
A button on the calculator keyboard.
CalculatorButtonuses a Flutter
CustomPaintwith a painter that delegates back to the
CalculatorButton's paintForPainter method. This is a template method that uses the various
drawXXX()methods and the getters defined here to draw a button. The defaults provided here work for most buttons, but are specialized for buttons that have a distinct visual appearance. [...]
- The button that has LJ in blue text. Deja vu Sans has a really ugly "J", so we change the font.
- The enter button, which occupies two rows on the keyboard.
- The f shift button, which is gold instead of black.
- The g shift button, which is blue instead of black.
- The on/off button, which is flat on the 16C. This button also has a special function when the on button is pressed, because pressing it a second time turns the calculator off, so it's also a CalculatorOnSpecialButton.
- A CalculatorButton that has a special function when used with conjunction with the on'off button. Such buttons show text describing their special function when the on/off button has been pressed.
- The square root button, which draws and extra line above the blue label to visually complete the square-root symbol. Lining this up depends on the specific font, which is bundled with the app.