简体中文 | English
Flutter 插件 - 获取 外网IP 及 内网IP - 支持的网络环境: 手机4G 或 Wi-Fi 或 有线
(目前支持iOS)
加 flutter_ip
to 到 pubspec.yaml
dependencies:
flutter_ip: ^0.1.4
import 'package:flutter_ip/flutter_ip.dart';
String external = await FlutterIp.externalIP;
// e.g. 113.139.104.65 or ""
String internal = await FlutterIp.internalIP;
// e.g. 192.168.0.102 or ""
String type = await FlutterIp.networkType; // e.g. wifi
Type: String
Value: wifi, wired, cellular // wifi, 有线,手机4G
用Xcode run一边example文件夹里的项目 就可以用AS跑了
This project is a starting point for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.