728x90

Platform 관련 함수는 웹에서 사용이 불가능한 모양

 

 

사용하지 않거나,

그럼에도 불구하고 사용하고싶으면 try-catch 감싸라는 이야기 존재

 

 

//You can use a try-catch block to prevent the exception from breaking the flow:

bool kisweb;
try{
    if(Platform.isAndroid||Platform.isIOS) {
        kisweb=false;
    } else {
        kisweb=true;
    }
} catch(e){
    kisweb=true;
}



 

Reference

https://stackoverflow.com/questions/58459483/unsupported-operation-platform-operatingsystem

 

Unsupported operation: Platform._operatingSystem

My flutter code isn't running on web. I found that "bool kisweb" can be used to detect the platform. But my code is failing at "FirebaseAuth.instance". Does this mean I can't use Firebaseauth on ...

stackoverflow.com

 

728x90

'Dev > Flutter' 카테고리의 다른 글

[Flutter/Dart] .. (Double dot/이중점) 연산자 - cascade  (0) 2021.01.15
[Flutter] 플러터로 Web하기  (0) 2020.09.07

+ Recent posts