|
@@ -328,6 +328,10 @@ class _MeasureMainViewState extends State<MeasureMainView> {
|
|
|
cancelString: i18nBook.common.cancel.t,
|
|
|
okString: i18nBook.common.confirm.t,
|
|
|
onOk: () {
|
|
|
+ if (calibrationLine == 0) {
|
|
|
+ PromptBox.toast(i18nBook.measure.toast4calibrationLine.t);
|
|
|
+ return;
|
|
|
+ }
|
|
|
try {
|
|
|
standardLineCalibrationController!.confirmEdit(calibrationLine);
|
|
|
} catch (e) {
|
|
@@ -378,7 +382,13 @@ class _MeasureMainViewState extends State<MeasureMainView> {
|
|
|
controller: TextEditingController(
|
|
|
text: calibrationLine.toString(),
|
|
|
),
|
|
|
- onChanged: (val) => calibrationLine = double.parse(val),
|
|
|
+ onChanged: (val) {
|
|
|
+ try {
|
|
|
+ calibrationLine = double.parse(val);
|
|
|
+ } catch (e) {
|
|
|
+ calibrationLine = 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
),
|
|
|
),
|
|
|
),
|