Skip to content

Commit

Permalink
Finally fix web check
Browse files Browse the repository at this point in the history
  • Loading branch information
larsb24 committed Dec 8, 2021
1 parent f64bc3f commit 9c27cb2
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 85 deletions.
172 changes: 89 additions & 83 deletions lib/components/settings/pages/network/network.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,89 +38,95 @@ class _SettingsPageNetworkState extends State<SettingsPageNetwork> {
Widget build(BuildContext context) {
return SettingsPage(
title: "Network & internet",
cards: [
const SettingsContentHeader("Wi-Fi"),
SettingsCard.withExpandableSwitch(
content: SizedBox(
height: 200,
child: (kIsWeb)
? (Platform.isLinux)
? ListView(
children: parseNetworks(context),
)
: const Text("Not supported on this platform")
: const Text("Not supported on this platform"),
),
title: "Wi-Fi",
subtitle: "Wi-Fi is ${_wifiEnabled ? "enabled" : "disabled"}",
leading: const Icon(
Icons.wifi_rounded,
),
value: _wifiEnabled,
onToggle: (val) {
setState(() {
_wifiEnabled = val;
});
},
),
const SettingsCard.withExpandable(
value: false,
title: "Wi-Fi prefernces",
subtitle: "Smart Wi-Fi connection, scanning options",
leading: Icon(Icons.online_prediction_rounded),
),
const SettingsCard.withExpandable(
value: false,
title: "Saved networks",
subtitle: "8 networks",
leading: Icon(Icons.save_rounded),
),
const SettingsCard.withRouter(
title: "Wi-Fi data usage",
subtitle: "Data usage for this month",
leading: Icon(Icons.data_saver_on_rounded),
),
const SettingsContentHeader("Ethernet"),
SettingsCard.withSwitch(
title: "Ethernet",
subtitle: "Ethernet is ${_ethernetEnabled ? "enabled" : "disabled"}",
leading: const Icon(Icons.settings_ethernet_rounded),
value: _ethernetEnabled,
onToggle: (val) {
setState(() => _ethernetEnabled = val);
},
),
const SettingsCard.withRouter(
title: "Ethernet data usage",
subtitle: "Data usage for this month",
leading: Icon(Icons.data_saver_on_rounded),
),
const SettingsContentHeader("Network options"),
SettingsCard.withCustomTrailing(
title: "Virtual Private Network (VPN)",
subtitle: "None",
leading: const Icon(Icons.vpn_lock_rounded),
trailing: ElevatedButton(
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text("VPN options"),
),
onPressed: () {},
),
),
SettingsCard.withCustomTrailing(
title: "Private DNS",
subtitle: "Automatic",
leading: const Icon(Icons.dns_rounded),
trailing: ElevatedButton(
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text("DNS options"),
),
onPressed: () {},
),
),
],
cards: (kIsWeb)
? [
const SettingsCard.withCustomTrailing(
title: "Not supported on this platform",
trailing: SizedBox.shrink(),
),
]
: [
const SettingsContentHeader("Wi-Fi"),
SettingsCard.withExpandableSwitch(
content: SizedBox(
height: 200,
child: ListView(
children: (Platform.isLinux)
? parseNetworks(context)
: const [Text("Not supported on this platform")],
),
),
title: "Wi-Fi",
subtitle: "Wi-Fi is ${_wifiEnabled ? "enabled" : "disabled"}",
leading: const Icon(
Icons.wifi_rounded,
),
value: _wifiEnabled,
onToggle: (val) {
setState(() {
_wifiEnabled = val;
});
},
),
const SettingsCard.withExpandable(
value: false,
title: "Wi-Fi prefernces",
subtitle: "Smart Wi-Fi connection, scanning options",
leading: Icon(Icons.online_prediction_rounded),
),
const SettingsCard.withExpandable(
value: false,
title: "Saved networks",
subtitle: "8 networks",
leading: Icon(Icons.save_rounded),
),
const SettingsCard.withRouter(
title: "Wi-Fi data usage",
subtitle: "Data usage for this month",
leading: Icon(Icons.data_saver_on_rounded),
),
const SettingsContentHeader("Ethernet"),
SettingsCard.withSwitch(
title: "Ethernet",
subtitle:
"Ethernet is ${_ethernetEnabled ? "enabled" : "disabled"}",
leading: const Icon(Icons.settings_ethernet_rounded),
value: _ethernetEnabled,
onToggle: (val) {
setState(() => _ethernetEnabled = val);
},
),
const SettingsCard.withRouter(
title: "Ethernet data usage",
subtitle: "Data usage for this month",
leading: Icon(Icons.data_saver_on_rounded),
),
const SettingsContentHeader("Network options"),
SettingsCard.withCustomTrailing(
title: "Virtual Private Network (VPN)",
subtitle: "None",
leading: const Icon(Icons.vpn_lock_rounded),
trailing: ElevatedButton(
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text("VPN options"),
),
onPressed: () {},
),
),
SettingsCard.withCustomTrailing(
title: "Private DNS",
subtitle: "Automatic",
leading: const Icon(Icons.dns_rounded),
trailing: ElevatedButton(
child: const Padding(
padding: EdgeInsets.all(8.0),
child: Text("DNS options"),
),
onPressed: () {},
),
),
],
);
}
}
5 changes: 3 additions & 2 deletions lib/utils/data/app_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ limitations under the License.

import 'package:pangolin/utils/data/models/application.dart';

import '../other/apps_stub.dart' if (dart.library.io) 'package:files/main.dart';
import 'package:pangolin/utils/other/apps_stub.dart'
if (dart.library.io) 'package:files/main.dart';
// ignore: duplicate_import
import '../other/apps_stub.dart'
import 'package:pangolin/utils/other/apps_stub.dart'
if (dart.library.io) 'package:terminal/main.dart';

import 'package:calculator/calculator.dart';
Expand Down

0 comments on commit 9c27cb2

Please sign in to comment.