From 428ecbdc3dd99b6fdf9d0a5e806ec7198e6d0971 Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Wed, 28 Aug 2024 14:59:18 -0400 Subject: [PATCH] Remove dead/unused code --- lib/screens/EnrollmentScreen.dart | 3 --- lib/screens/MainScreen.dart | 5 ----- lib/screens/SettingsScreen.dart | 3 --- lib/validators/ipValidator.dart | 1 - 4 files changed, 12 deletions(-) diff --git a/lib/screens/EnrollmentScreen.dart b/lib/screens/EnrollmentScreen.dart index 7d494be..cbe91fd 100644 --- a/lib/screens/EnrollmentScreen.dart +++ b/lib/screens/EnrollmentScreen.dart @@ -4,7 +4,6 @@ import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_platform_widgets/flutter_platform_widgets.dart'; -import 'package:flutter_svg/svg.dart'; import 'package:mobile_nebula/components/SimplePage.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -152,8 +151,6 @@ class _EnrollmentScreenState extends State { ])); } - final dnIcon = - Theme.of(context).brightness == Brightness.dark ? 'images/dn-logo-dark.svg' : 'images/dn-logo-light.svg'; return SimplePage( title: Text('Enroll with Managed Nebula', style: TextStyle(fontWeight: FontWeight.bold)), child: Padding(child: child, padding: EdgeInsets.symmetric(horizontal: 10)), diff --git a/lib/screens/MainScreen.dart b/lib/screens/MainScreen.dart index 728018c..d4d70ef 100644 --- a/lib/screens/MainScreen.dart +++ b/lib/screens/MainScreen.dart @@ -14,7 +14,6 @@ import 'package:mobile_nebula/models/IPAndPort.dart'; import 'package:mobile_nebula/models/Site.dart'; import 'package:mobile_nebula/models/StaticHosts.dart'; import 'package:mobile_nebula/models/UnsafeRoute.dart'; -import 'package:mobile_nebula/screens/EnrollmentScreen.dart'; import 'package:mobile_nebula/screens/SettingsScreen.dart'; import 'package:mobile_nebula/screens/SiteDetailScreen.dart'; import 'package:mobile_nebula/screens/siteConfig/SiteConfigScreen.dart'; @@ -303,15 +302,11 @@ class _MainScreenState extends State { _loadSites() async { //TODO: This can throw, we need to show an error dialog Map rawSites = jsonDecode(await platform.invokeMethod('listSites')); - bool hasErrors = false; sites = []; rawSites.forEach((id, rawSite) { try { var site = Site.fromJson(rawSite); - if (site.errors.length > 0) { - hasErrors = true; - } //TODO: we need to cancel change listeners when we rebuild site.onChange().listen((_) { diff --git a/lib/screens/SettingsScreen.dart b/lib/screens/SettingsScreen.dart index 50cfa0e..dd35bcd 100644 --- a/lib/screens/SettingsScreen.dart +++ b/lib/screens/SettingsScreen.dart @@ -1,7 +1,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/svg.dart'; import 'package:mobile_nebula/components/SimplePage.dart'; import 'package:mobile_nebula/components/config/ConfigItem.dart'; import 'package:mobile_nebula/components/config/ConfigPageItem.dart'; @@ -86,8 +85,6 @@ class _SettingsScreenState extends State { )), )); - final dnIcon = - Theme.of(context).brightness == Brightness.dark ? 'images/dn-logo-dark.svg' : 'images/dn-logo-light.svg'; items.add(ConfigSection(children: [ ConfigPageItem( label: Text('Enroll with Managed Nebula'), diff --git a/lib/validators/ipValidator.dart b/lib/validators/ipValidator.dart index 50959d0..229bfb8 100644 --- a/lib/validators/ipValidator.dart +++ b/lib/validators/ipValidator.dart @@ -23,7 +23,6 @@ bool ipValidator(String? str, bool enableIPV6) { { return true; } - break; } return false;