핸드핼드 기기
Flutter Dart isFinite 속성 사용법
가야태자
2020. 9. 29. 09:00
반응형
Dart에서 var로 정의 되어 있어서 값의 정이가 애매모호한 경우
제가 변환하고 있는 javascript에서 isFinite(value) 를 Dart에서는 어떻게 사용할 수 있는지에 대한 글입니다.
double.parse(value.toString()).isFinite
위와 같이 사용하면 됩니다.
double 이나 int 즉 number형 변수에 isFinite 가 속성으로 존재 합니다.
return 값은 bool 입니다. 즉 true/false 를 리컨 하고 있습니다. ^^
출처 : api.flutter.dev/flutter/dart-core/num/isFinite.html
isFinite property - num class - dart:core library - Dart API
True if the number is finite; otherwise, false. The only non-finite numbers are NaN, positive infinity, and negative infinity.
api.flutter.dev
반응형