Skip to content

Commit

Permalink
fix: 키보드 UI 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kyungsnim committed Nov 22, 2024
1 parent 814103a commit 1752147
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
25 changes: 18 additions & 7 deletions math_keyboard/lib/src/foundation/keyboard_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,18 @@ final functionKeyboard = [
),
],
[
const PageButtonConfig(flex: 3),
// const PageButtonConfig(flex: 3),
const BasicKeyboardButtonConfig(
label: '[',
value: '[',
highlighted: true,
keyboardCharacters: ['['],
),const BasicKeyboardButtonConfig(
label: ']',
value: ']',
highlighted: true,
keyboardCharacters: [']'],
),
const BasicKeyboardButtonConfig(
label: '(',
value: '(',
Expand All @@ -224,9 +235,9 @@ final functionKeyboard = [
highlighted: true,
keyboardCharacters: [')'],
),
PreviousButtonConfig(),
NextButtonConfig(),
DeleteButtonConfig(),
// PreviousButtonConfig(),
// NextButtonConfig(),
// DeleteButtonConfig(),
],
];

Expand Down Expand Up @@ -270,11 +281,11 @@ final standardKeyboard = [
DeleteButtonConfig(),
],
[
const PageButtonConfig(),
_digitButtons[0],
// const PageButtonConfig(),
PreviousButtonConfig(),
_digitButtons[0],
NextButtonConfig(),
SubmitButtonConfig(),
SubmitButtonConfig(flex: 4),
],
];

Expand Down
50 changes: 29 additions & 21 deletions math_keyboard/lib/src/widgets/math_keyboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class MathKeyboard extends StatelessWidget {
color: Color(0xFFCCCCCC))
]
),
padding: EdgeInsets.only(top: 16.0),
padding: EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0),
child: _KeyboardBody(
insetsState: insetsState,
slideAnimation:
Expand All @@ -150,7 +150,7 @@ class MathKeyboard extends StatelessWidget {
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: 5e2,
maxWidth: double.infinity,
),
child: Column(
children: [
Expand All @@ -167,25 +167,33 @@ class MathKeyboard extends StatelessWidget {
padding: const EdgeInsets.only(
top: 4,
),
child: _Buttons(
controller: controller,
page1: type == MathKeyboardType.numberOnly
? numberKeyboard
: type ==
MathKeyboardType.coachOnKeyboard1
? standardKeyboard
: standardKeyboard,
page2: type == MathKeyboardType.numberOnly
? null
: type ==
MathKeyboardType.coachOnKeyboard1
? coachOnKeyboard1
: functionKeyboard,
onSubmit: onSubmit,
buttonColor: buttonColor,
highlightColor: highlightColor,
iconColor: iconColor,
submitColor: submitColor,
child: Row(
children: [
Flexible(
child: _Buttons(
controller: controller,
page1: functionKeyboard,
page2: functionKeyboard,
onSubmit: onSubmit,
buttonColor: buttonColor,
highlightColor: highlightColor,
iconColor: iconColor,
submitColor: submitColor,
),
),
Flexible(
child: _Buttons(
controller: controller,
page1: standardKeyboard,
page2: coachOnKeyboard1,
onSubmit: onSubmit,
buttonColor: buttonColor,
highlightColor: highlightColor,
iconColor: iconColor,
submitColor: submitColor,
),
),
],
),
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ String rightSide = '';
focusNode: mathFocusNode,
autofocus: true,
controller: mathController,
variables: const ['x', 'y', 'z', '='],
variables: const ['a', 'b', 'c', 'x', 'y', 'z', '='],
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: '수식을 입력하세요',
Expand Down

0 comments on commit 1752147

Please sign in to comment.