Flutter Connectivity_plus 공식 문서
https://pub.dev/packages/connectivity_plus
Flutter Connectivity_plus 사용 법 공식 문서
https://plus.fluttercommunity.dev/docs/connectivity_plus/usage#wifi-or-cellular
connectivity_plus: ^2.3.5
import 'package:connectivity_plus/connectivity_plus.dart';
//변수 that accesss to all methods in the API of 'Connectivity_plus 패키지'
final Connectivity _connectivity = Connectivity();
//핸드폰 wifi 연결 여부
void checkConnectivityWifi() async{
//wifi, 셀룰러, None 셋 중 하나의 status를 가져오는 변수
ConnectivityResult connectivityResult = await _connectivity.checkConnectivity();
//핸드폰이 wifi에 연결 되었다면
if (connectivityResult == ConnectivityResult.wifi) {
print('wifi에 연결됨');
}
}