Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 1.79 KB

README-zh_CN.md

File metadata and controls

69 lines (50 loc) · 1.79 KB

flutter_ip

pub version Awesome Flutter

简体中文 | English

Flutter 插件 - 获取 外网IP内网IP - 支持的网络环境: 手机4G 或 Wi-Fi 或 有线 (目前支持iOS)

安装

flutter_ip to 到 pubspec.yaml

  dependencies:
    flutter_ip: ^0.1.4

iOS前提 - iOS Deployment Target 10.0

引入

  import 'package:flutter_ip/flutter_ip.dart';

使用方式

获取 外网IP

  String external = await FlutterIp.externalIP; 
  // e.g. 113.139.104.65 or ""

获取 内网IP

  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跑了

Getting Started

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.