Add smart_wifi_connect package and ensemble_wifi module#2273
Draft
sharjeelyunus wants to merge 2 commits into
Draft
Add smart_wifi_connect package and ensemble_wifi module#2273sharjeelyunus wants to merge 2 commits into
sharjeelyunus wants to merge 2 commits into
Conversation
Create smart_wifi_connect Flutter plugin: - Dart API: SmartWifiConnect.connect() with ssid, password, joinOnce, rememberNetwork - Android: WifiNetworkSpecifier (API 29+), NEARBY_WIFI_DEVICES (API 33+) - iOS: NEHotspotConfigurationManager - Structured SmartWifiConnectResult with status enum - 6 unit tests covering API, error handling, and edge cases Create ensemble_wifi module: - WifiManager stub + WifiManagerStub in core ensemble - WifiModule abstraction (WifiModuleStub for disabled state) - ConnectToWifiAction with onSuccess/onError callbacks - Register connectToWifi in ActionType enum and ActionInvokable - WifiModuleImpl bridging to smart_wifi_connect package Wire up in starter: - Add useWifi flag and registration in EnsembleModules - Add commented ensemble_wifi dependency in starter pubspec Fixes #2229 Co-authored-by: Sharjeel Yunus <sharjeelyunus@users.noreply.github.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Creates a lightweight Flutter plugin (
smart_wifi_connect) for connecting to Wi-Fi networks by SSID/password, and integrates it into Ensemble as theensemble_wifimodule with aconnectToWifiaction.Related Issue
Fixes #2229
Type of Change
What Has Changed
smart_wifi_connectpackage (packages/smart_wifi_connect/)SmartWifiConnect.connect(ssid, password, joinOnce, rememberNetwork)returningSmartWifiConnectResultWifiNetworkSpecifier(API 29+) withNEARBY_WIFI_DEVICESpermission on Android 13+ (neverForLocationflag) andACCESS_FINE_LOCATIONcapped at SDK 32NEHotspotConfigurationManagerwithjoinOncesupport, graceful handling of user denial andalreadyAssociatedSmartWifiConnectResultwithsuccess,statusenum,message,platformCodeconnected,permissionDenied,userCancelled,unsupported,invalidArguments,failedCore ensemble changes (
modules/ensemble/)WifiManagerabstract class +WifiManagerStubinlib/framework/stub/wifi_manager.dartWifiModule+WifiModuleStubinlib/module/wifi_module.dartConnectToWifiActioninlib/action/wifi_action.dart— parses YAML properties, evaluates expressions viascopeManager.dataContext.eval(), callsWifiManager.connect(), firesonSuccess/onErrorwithEnsembleEventconnectToWifiadded toActionTypeenum,fromActionType()factory, andActionInvokablemethods listensemble_wifimodule (modules/ensemble_wifi/)WifiManagerImpl: bridgesWifiManagerstub toSmartWifiConnect.connect()WifiModuleImpl: registersWifiManagerImplvia GetItStarter wiring
useWififlag andWifiModuleregistration added toEnsembleModulesensemble_wifidependency instarter/pubspec.yamlProposed YAML Action
Security & Privacy
neverForLocationflag used on Android 13+How to Test
melos bootstrapfrom repo rootflutter testinpackages/smart_wifi_connect/— 6 tests passflutter analyzeon all new files — no issuesflutter build webinstarter/— builds successfullyensemble_wifiin starter, add Wi-Fi permissions, and testconnectToWifiaction on Android 10+/iOSChecklist
flutter analyzeand addressed any new warningsflutter testand all tests pass