Skip to content

Commit 9c27cb2

Browse files
committed
Finally fix web check
1 parent f64bc3f commit 9c27cb2

File tree

2 files changed

+92
-85
lines changed

2 files changed

+92
-85
lines changed

lib/components/settings/pages/network/network.dart

Lines changed: 89 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -38,89 +38,95 @@ class _SettingsPageNetworkState extends State<SettingsPageNetwork> {
3838
Widget build(BuildContext context) {
3939
return SettingsPage(
4040
title: "Network & internet",
41-
cards: [
42-
const SettingsContentHeader("Wi-Fi"),
43-
SettingsCard.withExpandableSwitch(
44-
content: SizedBox(
45-
height: 200,
46-
child: (kIsWeb)
47-
? (Platform.isLinux)
48-
? ListView(
49-
children: parseNetworks(context),
50-
)
51-
: const Text("Not supported on this platform")
52-
: const Text("Not supported on this platform"),
53-
),
54-
title: "Wi-Fi",
55-
subtitle: "Wi-Fi is ${_wifiEnabled ? "enabled" : "disabled"}",
56-
leading: const Icon(
57-
Icons.wifi_rounded,
58-
),
59-
value: _wifiEnabled,
60-
onToggle: (val) {
61-
setState(() {
62-
_wifiEnabled = val;
63-
});
64-
},
65-
),
66-
const SettingsCard.withExpandable(
67-
value: false,
68-
title: "Wi-Fi prefernces",
69-
subtitle: "Smart Wi-Fi connection, scanning options",
70-
leading: Icon(Icons.online_prediction_rounded),
71-
),
72-
const SettingsCard.withExpandable(
73-
value: false,
74-
title: "Saved networks",
75-
subtitle: "8 networks",
76-
leading: Icon(Icons.save_rounded),
77-
),
78-
const SettingsCard.withRouter(
79-
title: "Wi-Fi data usage",
80-
subtitle: "Data usage for this month",
81-
leading: Icon(Icons.data_saver_on_rounded),
82-
),
83-
const SettingsContentHeader("Ethernet"),
84-
SettingsCard.withSwitch(
85-
title: "Ethernet",
86-
subtitle: "Ethernet is ${_ethernetEnabled ? "enabled" : "disabled"}",
87-
leading: const Icon(Icons.settings_ethernet_rounded),
88-
value: _ethernetEnabled,
89-
onToggle: (val) {
90-
setState(() => _ethernetEnabled = val);
91-
},
92-
),
93-
const SettingsCard.withRouter(
94-
title: "Ethernet data usage",
95-
subtitle: "Data usage for this month",
96-
leading: Icon(Icons.data_saver_on_rounded),
97-
),
98-
const SettingsContentHeader("Network options"),
99-
SettingsCard.withCustomTrailing(
100-
title: "Virtual Private Network (VPN)",
101-
subtitle: "None",
102-
leading: const Icon(Icons.vpn_lock_rounded),
103-
trailing: ElevatedButton(
104-
child: const Padding(
105-
padding: EdgeInsets.all(8.0),
106-
child: Text("VPN options"),
107-
),
108-
onPressed: () {},
109-
),
110-
),
111-
SettingsCard.withCustomTrailing(
112-
title: "Private DNS",
113-
subtitle: "Automatic",
114-
leading: const Icon(Icons.dns_rounded),
115-
trailing: ElevatedButton(
116-
child: const Padding(
117-
padding: EdgeInsets.all(8.0),
118-
child: Text("DNS options"),
119-
),
120-
onPressed: () {},
121-
),
122-
),
123-
],
41+
cards: (kIsWeb)
42+
? [
43+
const SettingsCard.withCustomTrailing(
44+
title: "Not supported on this platform",
45+
trailing: SizedBox.shrink(),
46+
),
47+
]
48+
: [
49+
const SettingsContentHeader("Wi-Fi"),
50+
SettingsCard.withExpandableSwitch(
51+
content: SizedBox(
52+
height: 200,
53+
child: ListView(
54+
children: (Platform.isLinux)
55+
? parseNetworks(context)
56+
: const [Text("Not supported on this platform")],
57+
),
58+
),
59+
title: "Wi-Fi",
60+
subtitle: "Wi-Fi is ${_wifiEnabled ? "enabled" : "disabled"}",
61+
leading: const Icon(
62+
Icons.wifi_rounded,
63+
),
64+
value: _wifiEnabled,
65+
onToggle: (val) {
66+
setState(() {
67+
_wifiEnabled = val;
68+
});
69+
},
70+
),
71+
const SettingsCard.withExpandable(
72+
value: false,
73+
title: "Wi-Fi prefernces",
74+
subtitle: "Smart Wi-Fi connection, scanning options",
75+
leading: Icon(Icons.online_prediction_rounded),
76+
),
77+
const SettingsCard.withExpandable(
78+
value: false,
79+
title: "Saved networks",
80+
subtitle: "8 networks",
81+
leading: Icon(Icons.save_rounded),
82+
),
83+
const SettingsCard.withRouter(
84+
title: "Wi-Fi data usage",
85+
subtitle: "Data usage for this month",
86+
leading: Icon(Icons.data_saver_on_rounded),
87+
),
88+
const SettingsContentHeader("Ethernet"),
89+
SettingsCard.withSwitch(
90+
title: "Ethernet",
91+
subtitle:
92+
"Ethernet is ${_ethernetEnabled ? "enabled" : "disabled"}",
93+
leading: const Icon(Icons.settings_ethernet_rounded),
94+
value: _ethernetEnabled,
95+
onToggle: (val) {
96+
setState(() => _ethernetEnabled = val);
97+
},
98+
),
99+
const SettingsCard.withRouter(
100+
title: "Ethernet data usage",
101+
subtitle: "Data usage for this month",
102+
leading: Icon(Icons.data_saver_on_rounded),
103+
),
104+
const SettingsContentHeader("Network options"),
105+
SettingsCard.withCustomTrailing(
106+
title: "Virtual Private Network (VPN)",
107+
subtitle: "None",
108+
leading: const Icon(Icons.vpn_lock_rounded),
109+
trailing: ElevatedButton(
110+
child: const Padding(
111+
padding: EdgeInsets.all(8.0),
112+
child: Text("VPN options"),
113+
),
114+
onPressed: () {},
115+
),
116+
),
117+
SettingsCard.withCustomTrailing(
118+
title: "Private DNS",
119+
subtitle: "Automatic",
120+
leading: const Icon(Icons.dns_rounded),
121+
trailing: ElevatedButton(
122+
child: const Padding(
123+
padding: EdgeInsets.all(8.0),
124+
child: Text("DNS options"),
125+
),
126+
onPressed: () {},
127+
),
128+
),
129+
],
124130
);
125131
}
126132
}

lib/utils/data/app_list.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ limitations under the License.
1313

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

16-
import '../other/apps_stub.dart' if (dart.library.io) 'package:files/main.dart';
16+
import 'package:pangolin/utils/other/apps_stub.dart'
17+
if (dart.library.io) 'package:files/main.dart';
1718
// ignore: duplicate_import
18-
import '../other/apps_stub.dart'
19+
import 'package:pangolin/utils/other/apps_stub.dart'
1920
if (dart.library.io) 'package:terminal/main.dart';
2021

2122
import 'package:calculator/calculator.dart';

0 commit comments

Comments
 (0)