Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wifi_passpoint): plugin added #289

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/cancel_previous.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ jobs:
workflow_id: >-
all_plugins.yaml,
wifi_iot.yaml,
wifi_scan.yaml
wifi_scan.yaml,
wifi_passpoint.yaml
all_but_latest: true
91 changes: 91 additions & 0 deletions .github/workflows/wifi_passpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Build wifi_passpoint example
name: wifi_passpoint

on:
pull_request:
paths:
- "packages/wifi_passpoint/**"
- ".github/workflows/wifi_passpoint.yaml"

env:
PLUGIN_SCOPE: "*wifi_passpoint*"
PLUGIN_EXAMPLE_SCOPE: "*wifi_passpoint_example*"

jobs:
android:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: ./.github/workflows/scripts/install-tools.sh
- name: "Build Example"
run: ./.github/workflows/scripts/build-examples.sh android ./lib/main.dart

ios:
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: "Checkout repository"
uses: actions/checkout@v2
- name: "Install Flutter"
run: ./.github/workflows/scripts/install-flutter.sh stable
- name: "Install Tools"
run: ./.github/workflows/scripts/install-tools.sh
- name: "Build Example"
run: ./.github/workflows/scripts/build-examples.sh ios ./lib/main.dart

# macos:
# runs-on: macos-latest
# timeout-minutes: 30
# steps:
# - name: "Checkout repository"
# uses: actions/checkout@v2
# - name: "Install Flutter"
# run: ./.github/workflows/scripts/install-flutter.sh stable
# - name: "Install Tools"
# run: ./.github/workflows/scripts/install-tools.sh
# - name: "Build Example"
# run: ./.github/workflows/scripts/build-examples.sh macos ./lib/main.dart

# linux:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - name: "Checkout repository"
# uses: actions/checkout@v2
# - name: "Install Flutter"
# run: ./.github/workflows/scripts/install-flutter.sh stable
# - name: "Install Tools"
# run: ./.github/workflows/scripts/install-tools.sh
# - name: "Build Example"
# run: ./.github/workflows/scripts/build-examples.sh linux ./lib/main.dart

# windows:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - name: "Checkout repository"
# uses: actions/checkout@v2
# - name: "Install Flutter"
# run: ./.github/workflows/scripts/install-flutter.sh stable
# - name: "Install Tools"
# run: ./.github/workflows/scripts/install-tools.sh
# - name: "Build Example"
# run: ./.github/workflows/scripts/build-examples.sh windows ./lib/main.dart

# web:
# runs-on: ubuntu-latest
# timeout-minutes: 30
# steps:
# - name: "Checkout repository"
# uses: actions/checkout@v2
# - name: "Install Flutter"
# run: ./.github/workflows/scripts/install-flutter.sh stable
# - name: "Install Tools"
# run: ./.github/workflows/scripts/install-tools.sh
# - name: "Build Example"
# run: ./.github/workflows/scripts/build-examples.sh web ./lib/main.dart
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ WiFiFlutter is a suite of Flutter plugins that enable Flutter apps to use variou
<!--
- [Station (`wifi_sta`)](#wifi_sta)
- [Access Point / Hotspot (`wifi_ap`)](#wifi_ap)
-->
- [Passpoint (`wifi_passpoint`)](#wifi_passpoint)
<!--
- [Aware (`wifi_aware`)](#wifi_aware)
- [Location / RTT (`wifi_rtt`)](#wifi_rtt)
-->
Expand Down Expand Up @@ -124,8 +127,24 @@ Flutter plugin to setup device as a WiFi access point (hotspot).
| :-----: | :-: |
| ❌ | ➖ |

---
-->

### `wifi_passpoint`
> [![wifi_passpoint][passpoint_workflow_badge]][passpoint_workflow] [![wifi_passpoint][passpoint_pub_badge]][passpoint_pub] [![pub points][passpoint_pub_points_badge]][passpoint_pub_points]

Flutter plugin to discover and connect to WiFi Passpoint(Hotspot 2.0) access points.

[[View Source][passpoint_code]]

#### Platform Support
| Android | iOS |
| :-----: | :-: |
| ❌️ | ❌ |

---

<!-- HIDING until available
### `wifi_aware`
> [![wifi_aware][aware_workflow_badge]][aware_workflow] [![wifi_aware][aware_pub_badge]][aware_pub] [![pub points][aware_pub_points_badge]][aware_pub_points]

Expand Down Expand Up @@ -227,6 +246,14 @@ This project follows the [all-contributors][all_contributors] specification. Con
[ap_pub_points]: https://pub.dev/packages/wifi_ap/score
[ap_pub_points_badge]: https://badges.bar/wifi_ap/pub%20points

[passpoint_code]: https://github.com/flutternetwork/WiFiFlutter/tree/master/packages/wifi_passpoint
[passpoint_workflow]: https://github.com/flutternetwork/WiFiFlutter/actions/workflows/wifi_passpoint.yaml
[passpoint_workflow_badge]: https://github.com/flutternetwork/WiFiFlutter/actions/workflows/wifi_passpoint.yaml/badge.svg
[passpoint_pub]: https://pub.dev/packages/wifi_passpoint
[passpoint_pub_badge]: https://img.shields.io/pub/v/wifi_passpoint.svg
[passpoint_pub_points]: https://pub.dev/packages/wifi_passpoint/score
[passpoint_pub_points_badge]: https://badges.bar/wifi_passpoint/pub%20points

[aware_code]: https://github.com/flutternetwork/WiFiFlutter/tree/master/packages/wifi_aware
[aware_workflow]: https://github.com/flutternetwork/WiFiFlutter/actions/workflows/wifi_aware.yaml
[aware_workflow_badge]: https://github.com/flutternetwork/WiFiFlutter/actions/workflows/wifi_aware.yaml/badge.svg
Expand Down
30 changes: 30 additions & 0 deletions packages/wifi_passpoint/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
33 changes: 33 additions & 0 deletions packages/wifi_passpoint/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
channel: stable

project_type: plugin

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: android
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
- platform: ios
create_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268
base_revision: fb57da5f945d02ef4f98dfd9409a72b7cce74268

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
3 changes: 3 additions & 0 deletions packages/wifi_passpoint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
19 changes: 19 additions & 0 deletions packages/wifi_passpoint/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2022 WiFiFlutter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 15 additions & 0 deletions packages/wifi_passpoint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# wifi_passpoint _[COMING SOON]_

Flutter plugin to discover and connect to WiFi Passpoint(Hotspot 2.0) access points.

## Getting Started

This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/developing-packages/),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.

For help getting started with Flutter development, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

9 changes: 9 additions & 0 deletions packages/wifi_passpoint/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
50 changes: 50 additions & 0 deletions packages/wifi_passpoint/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
group 'dev.flutternetwork.wifi.wifi_passpoint'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

rootProject.allprojects {
repositories {
google()
mavenCentral()
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
minSdkVersion 16
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
1 change: 1 addition & 0 deletions packages/wifi_passpoint/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'wifi_passpoint'
3 changes: 3 additions & 0 deletions packages/wifi_passpoint/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.flutternetwork.wifi.wifi_passpoint">
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package dev.flutternetwork.wifi.wifi_passpoint

import androidx.annotation.NonNull

import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result

/** WifiPasspointPlugin */
class WifiPasspointPlugin: FlutterPlugin, MethodCallHandler {
/// The MethodChannel that will the communication between Flutter and native Android
///
/// This local reference serves to register the plugin with the Flutter Engine and unregister it
/// when the Flutter Engine is detached from the Activity
private lateinit var channel : MethodChannel

override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
channel = MethodChannel(flutterPluginBinding.binaryMessenger, "wifi_passpoint")
channel.setMethodCallHandler(this)
}

override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
if (call.method == "getPlatformVersion") {
result.success("Android ${android.os.Build.VERSION.RELEASE}")
} else {
result.notImplemented()
}
}

override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
channel.setMethodCallHandler(null)
}
}
Loading