mirror of
https://github.com/DefinedNet/mobile_nebula.git
synced 2025-02-22 19:15:27 +00:00
dart fix --apply --code=unnecessary_this
This commit is contained in:
parent
d3f560d9b7
commit
45f3af5646
9 changed files with 37 additions and 37 deletions
|
@ -48,7 +48,7 @@ class IPField extends StatelessWidget {
|
|||
maxLength: ipOnly ? 15 : null,
|
||||
maxLengthEnforcement: ipOnly ? MaxLengthEnforcement.enforced : MaxLengthEnforcement.none,
|
||||
inputFormatters: ipOnly ? [IPTextInputFormatter()] : [FilteringTextInputFormatter.allow(RegExp(r'[^\s]+'))],
|
||||
textInputAction: this.textInputAction,
|
||||
textInputAction: textInputAction,
|
||||
placeholder: help,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -43,7 +43,7 @@ class SimplePage extends StatelessWidget {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget realChild = child;
|
||||
var addScrollbar = this.scrollbar;
|
||||
var addScrollbar = scrollbar;
|
||||
|
||||
if (scrollable == SimpleScrollable.vertical || scrollable == SimpleScrollable.both) {
|
||||
realChild = SingleChildScrollView(
|
||||
|
@ -83,7 +83,7 @@ class SimplePage extends StatelessWidget {
|
|||
}
|
||||
|
||||
if (alignment != null) {
|
||||
realChild = Align(alignment: this.alignment!, child: realChild);
|
||||
realChild = Align(alignment: alignment!, child: realChild);
|
||||
}
|
||||
|
||||
if (bottomBar != null) {
|
||||
|
|
|
@ -44,7 +44,7 @@ class ConfigPageItem extends StatelessWidget {
|
|||
|
||||
Widget _buildContent(BuildContext context) {
|
||||
return SpecialButton(
|
||||
onPressed: this.disabled ? null : onPressed,
|
||||
onPressed: disabled ? null : onPressed,
|
||||
color: Utils.configItemBackground(context),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 6, horizontal: 15),
|
||||
|
@ -54,7 +54,7 @@ class ConfigPageItem extends StatelessWidget {
|
|||
children: <Widget>[
|
||||
label != null ? Container(width: labelWidth, child: label) : Container(),
|
||||
Expanded(child: Container(child: content, padding: EdgeInsets.only(right: 10))),
|
||||
this.disabled
|
||||
disabled
|
||||
? Container()
|
||||
: Icon(CupertinoIcons.forward, color: CupertinoColors.placeholderText.resolveFrom(context), size: 18),
|
||||
],
|
||||
|
|
|
@ -107,7 +107,7 @@ class _AppState extends State<App> {
|
|||
cupertino: (_, __) => CupertinoAppData(theme: CupertinoThemeData(brightness: brightness)),
|
||||
onGenerateRoute: (settings) {
|
||||
if (settings.name == '/') {
|
||||
return platformPageRoute(context: context, builder: (context) => MainScreen(this.dnEnrolled));
|
||||
return platformPageRoute(context: context, builder: (context) => MainScreen(dnEnrolled));
|
||||
}
|
||||
|
||||
final uri = Uri.parse(settings.name!);
|
||||
|
@ -117,7 +117,7 @@ class _AppState extends State<App> {
|
|||
context: context,
|
||||
builder:
|
||||
(context) =>
|
||||
EnrollmentScreen(code: EnrollmentScreen.parseCode(settings.name!), stream: this.dnEnrolled),
|
||||
EnrollmentScreen(code: EnrollmentScreen.parseCode(settings.name!), stream: dnEnrolled),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ class CertificateInfo {
|
|||
CertificateValidity? validity;
|
||||
|
||||
CertificateInfo.debug({this.rawCert = ""})
|
||||
: this.cert = Certificate.debug(),
|
||||
this.validity = CertificateValidity.debug();
|
||||
: cert = Certificate.debug(),
|
||||
validity = CertificateValidity.debug();
|
||||
|
||||
CertificateInfo.fromJson(Map<String, dynamic> json)
|
||||
: cert = Certificate.fromJson(json['Cert']),
|
||||
|
@ -24,7 +24,7 @@ class Certificate {
|
|||
String fingerprint;
|
||||
String signature;
|
||||
|
||||
Certificate.debug() : this.details = CertificateDetails.debug(), this.fingerprint = "DEBUG", this.signature = "DEBUG";
|
||||
Certificate.debug() : details = CertificateDetails.debug(), fingerprint = "DEBUG", signature = "DEBUG";
|
||||
|
||||
Certificate.fromJson(Map<String, dynamic> json)
|
||||
: details = CertificateDetails.fromJson(json['details']),
|
||||
|
@ -44,7 +44,7 @@ class CertificateDetails {
|
|||
String issuer;
|
||||
|
||||
CertificateDetails.debug()
|
||||
: this.name = "DEBUG",
|
||||
: name = "DEBUG",
|
||||
notBefore = DateTime.now(),
|
||||
notAfter = DateTime.now(),
|
||||
publicKey = "",
|
||||
|
@ -70,7 +70,7 @@ class CertificateValidity {
|
|||
bool valid;
|
||||
String reason;
|
||||
|
||||
CertificateValidity.debug() : this.valid = true, this.reason = "";
|
||||
CertificateValidity.debug() : valid = true, reason = "";
|
||||
|
||||
CertificateValidity.fromJson(Map<String, dynamic> json) : valid = json['Valid'], reason = json['Reason'];
|
||||
}
|
||||
|
|
|
@ -139,25 +139,25 @@ class Site {
|
|||
|
||||
_updateFromJson(String json) {
|
||||
var decoded = Site._fromJson(jsonDecode(json));
|
||||
this.name = decoded["name"];
|
||||
this.id = decoded['id']; // TODO update EventChannel
|
||||
this.staticHostmap = decoded['staticHostmap'];
|
||||
this.ca = decoded['ca'];
|
||||
this.certInfo = decoded['certInfo'];
|
||||
this.lhDuration = decoded['lhDuration'];
|
||||
this.port = decoded['port'];
|
||||
this.cipher = decoded['cipher'];
|
||||
this.sortKey = decoded['sortKey'];
|
||||
this.mtu = decoded['mtu'];
|
||||
this.connected = decoded['connected'];
|
||||
this.status = decoded['status'];
|
||||
this.logFile = decoded['logFile'];
|
||||
this.logVerbosity = decoded['logVerbosity'];
|
||||
this.errors = decoded['errors'];
|
||||
this.unsafeRoutes = decoded['unsafeRoutes'];
|
||||
this.managed = decoded['managed'];
|
||||
this.rawConfig = decoded['rawConfig'];
|
||||
this.lastManagedUpdate = decoded['lastManagedUpdate'];
|
||||
name = decoded["name"];
|
||||
id = decoded['id']; // TODO update EventChannel
|
||||
staticHostmap = decoded['staticHostmap'];
|
||||
ca = decoded['ca'];
|
||||
certInfo = decoded['certInfo'];
|
||||
lhDuration = decoded['lhDuration'];
|
||||
port = decoded['port'];
|
||||
cipher = decoded['cipher'];
|
||||
sortKey = decoded['sortKey'];
|
||||
mtu = decoded['mtu'];
|
||||
connected = decoded['connected'];
|
||||
status = decoded['status'];
|
||||
logFile = decoded['logFile'];
|
||||
logVerbosity = decoded['logVerbosity'];
|
||||
errors = decoded['errors'];
|
||||
unsafeRoutes = decoded['unsafeRoutes'];
|
||||
managed = decoded['managed'];
|
||||
rawConfig = decoded['rawConfig'];
|
||||
lastManagedUpdate = decoded['lastManagedUpdate'];
|
||||
}
|
||||
|
||||
static _fromJson(Map<String, dynamic> json) {
|
||||
|
@ -331,7 +331,7 @@ class Site {
|
|||
|
||||
Future<Map<String, List<HostInfo>>> listAllHostmaps() async {
|
||||
try {
|
||||
var res = await Future.wait([this.listHostmap(), this.listPendingHostmap()]);
|
||||
var res = await Future.wait([listHostmap(), listPendingHostmap()]);
|
||||
return {"active": res[0], "pending": res[1]};
|
||||
} on PlatformException catch (err) {
|
||||
throw err.details ?? err.message ?? err.toString();
|
||||
|
|
|
@ -103,7 +103,7 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
padding: EdgeInsets.only(top: 20),
|
||||
);
|
||||
}
|
||||
} else if (this.error != null) {
|
||||
} else if (error != null) {
|
||||
// Error while enrolling, display it
|
||||
child = Center(
|
||||
child: Column(
|
||||
|
@ -137,7 +137,7 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
),
|
||||
Container(
|
||||
child: Padding(child: SelectableText(this.error!), padding: EdgeInsets.all(16)),
|
||||
child: Padding(child: SelectableText(error!), padding: EdgeInsets.all(16)),
|
||||
color: Theme.of(context).colorScheme.errorContainer,
|
||||
),
|
||||
],
|
||||
|
@ -145,7 +145,7 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
),
|
||||
);
|
||||
} else if (this.enrolled) {
|
||||
} else if (enrolled) {
|
||||
// Enrollment complete!
|
||||
child = Padding(
|
||||
child: Center(child: Text('Enrollment complete! 🎉', textAlign: TextAlign.center)),
|
||||
|
|
|
@ -27,7 +27,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||
void initState() {
|
||||
//TODO: we need to unregister on dispose?
|
||||
settings.onChange().listen((_) {
|
||||
if (this.mounted) {
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -27,7 +27,7 @@ class StaticHostmapScreen extends StatefulWidget {
|
|||
this.lighthouse = false,
|
||||
this.onDelete,
|
||||
required this.onSave,
|
||||
}) : this.destinations = destinations ?? [];
|
||||
}) : destinations = destinations ?? [];
|
||||
|
||||
final List<IPAndPort> destinations;
|
||||
final String nebulaIp;
|
||||
|
|
Loading…
Reference in a new issue