Skip to content

Commit

Permalink
Fix dart analyze
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-ancell committed Nov 16, 2022
1 parent e715241 commit 56e6e45
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions example/wifi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ void connectToWifiNetwork(NetworkManagerClient manager,
device: device,
accessPoint: accessPoint,
connection: {
"802-11-wireless-security": {
"key-mgmt": DBusString("wpa-psk"),
"psk": DBusString(psk)
'802-11-wireless-security': {
'key-mgmt': DBusString('wpa-psk'),
'psk': DBusString(psk)
}
});
}
Expand All @@ -76,18 +76,18 @@ Future<NetworkManagerSettingsConnection?> getAccessPointConnectionSettings(
var ssid = utf8.decode(accessPoint.ssid);

var settings = await Future.wait(device.availableConnections
.map((e) async => {"settings": await e.getSettings(), "connection": e}));
.map((e) async => {'settings': await e.getSettings(), 'connection': e}));
NetworkManagerSettingsConnection? accessPointSettings;
for (var element in settings) {
var s = element["settings"] as dynamic;
var s = element['settings'] as dynamic;
if (s != null) {
var connection = s["connection"] as Map<String, DBusValue>?;
var connection = s['connection'] as Map<String, DBusValue>?;
if (connection != null) {
var id = connection["id"];
var id = connection['id'];
if (id != null) {
if (id.toNative() == ssid) {
accessPointSettings =
element["connection"] as NetworkManagerSettingsConnection;
element['connection'] as NetworkManagerSettingsConnection;
break;
}
}
Expand All @@ -103,11 +103,11 @@ Future<String?> getSavedWifiPsk(
await getAccessPointConnectionSettings(device, accessPoint);
if (settingsConnection != null) {
var secrets =
await settingsConnection.getSecrets("802-11-wireless-security");
await settingsConnection.getSecrets('802-11-wireless-security');
if (secrets.isNotEmpty) {
var security = secrets["802-11-wireless-security"];
var security = secrets['802-11-wireless-security'];
if (security != null) {
var psk = security["psk"];
var psk = security['psk'];
if (psk != null) {
return psk.toNative();
}
Expand Down

0 comments on commit 56e6e45

Please sign in to comment.