forked from core/mobile_nebula
Cleanup (#58)
This commit is contained in:
parent
64b056618c
commit
d37bdd9032
|
@ -1,7 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
||||||
import 'package:mobile_nebula/models/CIDR.dart';
|
import 'package:mobile_nebula/models/CIDR.dart';
|
||||||
import '../services/utils.dart';
|
import '../services/utils.dart';
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/CIDRField.dart';
|
import 'package:mobile_nebula/components/CIDRField.dart';
|
||||||
import 'package:mobile_nebula/models/CIDR.dart';
|
import 'package:mobile_nebula/models/CIDR.dart';
|
||||||
import 'package:mobile_nebula/validators/ipValidator.dart';
|
import 'package:mobile_nebula/validators/ipValidator.dart';
|
||||||
|
|
||||||
class CIDRFormField extends FormField<CIDR> {
|
class CIDRFormField extends FormField<CIDR> {
|
||||||
//TODO: onSaved, validator, autovalidate, enabled?
|
//TODO: onSaved, validator, auto-validate, enabled?
|
||||||
CIDRFormField({
|
CIDRFormField({
|
||||||
Key key,
|
Key key,
|
||||||
autoFocus = false,
|
autoFocus = false,
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
||||||
import 'package:mobile_nebula/models/IPAndPort.dart';
|
import 'package:mobile_nebula/models/IPAndPort.dart';
|
||||||
import '../services/utils.dart';
|
import '../services/utils.dart';
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/models/IPAndPort.dart';
|
import 'package:mobile_nebula/models/IPAndPort.dart';
|
||||||
import 'package:mobile_nebula/validators/dnsValidator.dart';
|
import 'package:mobile_nebula/validators/dnsValidator.dart';
|
||||||
import 'package:mobile_nebula/validators/ipValidator.dart';
|
import 'package:mobile_nebula/validators/ipValidator.dart';
|
||||||
|
@ -7,7 +6,7 @@ import 'package:mobile_nebula/validators/ipValidator.dart';
|
||||||
import 'IPAndPortField.dart';
|
import 'IPAndPortField.dart';
|
||||||
|
|
||||||
class IPAndPortFormField extends FormField<IPAndPort> {
|
class IPAndPortFormField extends FormField<IPAndPort> {
|
||||||
//TODO: onSaved, validator, autovalidate, enabled?
|
//TODO: onSaved, validator, auto-validate, enabled?
|
||||||
IPAndPortFormField({
|
IPAndPortFormField({
|
||||||
Key key,
|
Key key,
|
||||||
ipOnly = false,
|
ipOnly = false,
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
||||||
|
|
||||||
import '../services/utils.dart';
|
import '../services/utils.dart';
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/validators/dnsValidator.dart';
|
import 'package:mobile_nebula/validators/dnsValidator.dart';
|
||||||
import 'package:mobile_nebula/validators/ipValidator.dart';
|
import 'package:mobile_nebula/validators/ipValidator.dart';
|
||||||
|
|
||||||
|
@ -9,7 +7,7 @@ import 'IPField.dart';
|
||||||
//TODO: reset doesn't update the ui but clears the field
|
//TODO: reset doesn't update the ui but clears the field
|
||||||
|
|
||||||
class IPFormField extends FormField<String> {
|
class IPFormField extends FormField<String> {
|
||||||
//TODO: validator, autovalidate, enabled?
|
//TODO: validator, auto-validate, enabled?
|
||||||
IPFormField({
|
IPFormField({
|
||||||
Key key,
|
Key key,
|
||||||
ipOnly = false,
|
ipOnly = false,
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
import 'package:mobile_nebula/components/SpecialTextField.dart';
|
||||||
//TODO: reset doesn't update the ui but clears the field
|
//TODO: reset doesn't update the ui but clears the field
|
||||||
|
|
||||||
class PlatformTextFormField extends FormField<String> {
|
class PlatformTextFormField extends FormField<String> {
|
||||||
//TODO: autovalidate, enabled?
|
//TODO: auto-validate, enabled?
|
||||||
PlatformTextFormField(
|
PlatformTextFormField(
|
||||||
{Key key,
|
{Key key,
|
||||||
widgetKey,
|
widgetKey,
|
||||||
|
|
|
@ -32,7 +32,7 @@ class SimplePage extends StatelessWidget {
|
||||||
final SimpleScrollable scrollable;
|
final SimpleScrollable scrollable;
|
||||||
final ScrollController scrollController;
|
final ScrollController scrollController;
|
||||||
|
|
||||||
/// Set this to true to force draw a scrollbar without a scroll view, this is helpful for pages with Reorderable listviews
|
/// Set this to true to force draw a scrollbar without a scroll view, this is helpful for pages with Reorder-able listviews
|
||||||
/// This is set to true if you have any scrollable other than none
|
/// This is set to true if you have any scrollable other than none
|
||||||
final bool scrollbar;
|
final bool scrollbar;
|
||||||
final Widget bottomBar;
|
final Widget bottomBar;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:mobile_nebula/components/SpecialButton.dart';
|
import 'package:mobile_nebula/components/SpecialButton.dart';
|
||||||
import 'package:mobile_nebula/models/Site.dart';
|
import 'package:mobile_nebula/models/Site.dart';
|
||||||
import 'package:mobile_nebula/services/utils.dart';
|
import 'package:mobile_nebula/services/utils.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
|
|
||||||
/// A normal TextField or CupertinoTextField that looks the same on all platforms
|
/// A normal TextField or CupertinoTextField that looks the same on all platforms
|
||||||
|
@ -76,42 +75,42 @@ class _SpecialTextFieldState extends State<SpecialTextField> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return PlatformTextField(
|
return PlatformTextField(
|
||||||
autocorrect: widget.autocorrect,
|
autocorrect: widget.autocorrect,
|
||||||
minLines: widget.minLines,
|
minLines: widget.minLines,
|
||||||
maxLines: widget.maxLines,
|
maxLines: widget.maxLines,
|
||||||
maxLength: widget.maxLength,
|
maxLength: widget.maxLength,
|
||||||
maxLengthEnforcement: widget.maxLengthEnforcement,
|
maxLengthEnforcement: widget.maxLengthEnforcement,
|
||||||
keyboardType: widget.keyboardType,
|
keyboardType: widget.keyboardType,
|
||||||
keyboardAppearance: widget.keyboardAppearance,
|
keyboardAppearance: widget.keyboardAppearance,
|
||||||
textInputAction: widget.textInputAction,
|
textInputAction: widget.textInputAction,
|
||||||
textCapitalization: widget.textCapitalization,
|
textCapitalization: widget.textCapitalization,
|
||||||
textAlign: widget.textAlign,
|
textAlign: widget.textAlign,
|
||||||
textAlignVertical: widget.textAlignVertical,
|
textAlignVertical: widget.textAlignVertical,
|
||||||
autofocus: widget.autofocus,
|
autofocus: widget.autofocus,
|
||||||
focusNode: widget.focusNode,
|
focusNode: widget.focusNode,
|
||||||
onChanged: widget.onChanged,
|
onChanged: widget.onChanged,
|
||||||
enabled: widget.enabled,
|
enabled: widget.enabled,
|
||||||
onSubmitted: (_) {
|
onSubmitted: (_) {
|
||||||
if (widget.nextFocusNode != null) {
|
if (widget.nextFocusNode != null) {
|
||||||
FocusScope.of(context).requestFocus(widget.nextFocusNode);
|
FocusScope.of(context).requestFocus(widget.nextFocusNode);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
expands: widget.expands,
|
expands: widget.expands,
|
||||||
inputFormatters: formatters,
|
inputFormatters: formatters,
|
||||||
material: (_, __) => MaterialTextFieldData(
|
material: (_, __) => MaterialTextFieldData(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
isDense: true,
|
isDense: true,
|
||||||
hintText: widget.placeholder,
|
hintText: widget.placeholder,
|
||||||
counterText: '',
|
counterText: '',
|
||||||
suffix: widget.suffix)),
|
suffix: widget.suffix)),
|
||||||
cupertino: (_, __) => CupertinoTextFieldData(
|
cupertino: (_, __) => CupertinoTextFieldData(
|
||||||
decoration: BoxDecoration(),
|
decoration: BoxDecoration(),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
placeholder: widget.placeholder,
|
placeholder: widget.placeholder,
|
||||||
suffix: widget.suffix),
|
suffix: widget.suffix),
|
||||||
style: widget.style,
|
style: widget.style,
|
||||||
controller: widget.controller);
|
controller: widget.controller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:mobile_nebula/components/SpecialButton.dart';
|
import 'package:mobile_nebula/components/SpecialButton.dart';
|
||||||
import 'package:mobile_nebula/services/utils.dart';
|
import 'package:mobile_nebula/services/utils.dart';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mobile_nebula/services/utils.dart';
|
import 'package:mobile_nebula/services/utils.dart';
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/screens/MainScreen.dart';
|
import 'package:mobile_nebula/screens/MainScreen.dart';
|
||||||
import 'package:mobile_nebula/services/settings.dart';
|
import 'package:mobile_nebula/services/settings.dart';
|
||||||
|
|
||||||
//TODO: EventChannel might be better than the streamcontroller we are using now
|
//TODO: EventChannel might be better than the stream controller we are using now
|
||||||
|
|
||||||
void main() => runApp(Main());
|
void main() => runApp(Main());
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import 'package:flutter/foundation.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigItem.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigCheckboxItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigCheckboxItem.dart';
|
||||||
|
@ -75,18 +74,12 @@ class _HostInfoScreenState extends State<HostInfoScreen> {
|
||||||
Widget _buildDetails() {
|
Widget _buildDetails() {
|
||||||
return ConfigSection(children: <Widget>[
|
return ConfigSection(children: <Widget>[
|
||||||
ConfigItem(
|
ConfigItem(
|
||||||
label: Text('Lighthouse'),
|
label: Text('Lighthouse'), labelWidth: 150, content: SelectableText(widget.isLighthouse ? 'Yes' : 'No')),
|
||||||
labelWidth: 150,
|
|
||||||
content: SelectableText(widget.isLighthouse ? 'Yes' : 'No')),
|
|
||||||
ConfigItem(label: Text('Local Index'), labelWidth: 150, content: SelectableText('${hostInfo.localIndex}')),
|
ConfigItem(label: Text('Local Index'), labelWidth: 150, content: SelectableText('${hostInfo.localIndex}')),
|
||||||
|
ConfigItem(label: Text('Remote Index'), labelWidth: 150, content: SelectableText('${hostInfo.remoteIndex}')),
|
||||||
ConfigItem(
|
ConfigItem(
|
||||||
label: Text('Remote Index'), labelWidth: 150, content: SelectableText('${hostInfo.remoteIndex}')),
|
label: Text('Message Counter'), labelWidth: 150, content: SelectableText('${hostInfo.messageCounter}')),
|
||||||
ConfigItem(
|
ConfigItem(label: Text('Cached Packets'), labelWidth: 150, content: SelectableText('${hostInfo.cachedPackets}')),
|
||||||
label: Text('Message Counter'),
|
|
||||||
labelWidth: 150,
|
|
||||||
content: SelectableText('${hostInfo.messageCounter}')),
|
|
||||||
ConfigItem(
|
|
||||||
label: Text('Cached Packets'), labelWidth: 150, content: SelectableText('${hostInfo.cachedPackets}')),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +149,7 @@ class _HostInfoScreenState extends State<HostInfoScreen> {
|
||||||
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: PlatformButton(
|
child: PlatformElevatedButton(
|
||||||
child: Text('Close Tunnel'),
|
child: Text('Close Tunnel'),
|
||||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||||
onPressed: () => Utils.confirmDelete(context, 'Close Tunnel?', () async {
|
onPressed: () => Utils.confirmDelete(context, 'Close Tunnel?', () async {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/SiteItem.dart';
|
import 'package:mobile_nebula/components/SiteItem.dart';
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigItem.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
|
@ -109,8 +108,7 @@ class _SiteDetailScreenState extends State<SiteDetailScreen> {
|
||||||
List<Widget> items = [];
|
List<Widget> items = [];
|
||||||
site.errors.forEach((error) {
|
site.errors.forEach((error) {
|
||||||
items.add(ConfigItem(
|
items.add(ConfigItem(
|
||||||
labelWidth: 0,
|
labelWidth: 0, content: Padding(padding: EdgeInsets.symmetric(vertical: 10), child: SelectableText(error))));
|
||||||
content: Padding(padding: EdgeInsets.symmetric(vertical: 10), child: SelectableText(error))));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return ConfigSection(
|
return ConfigSection(
|
||||||
|
@ -235,7 +233,7 @@ class _SiteDetailScreenState extends State<SiteDetailScreen> {
|
||||||
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: PlatformButton(
|
child: PlatformElevatedButton(
|
||||||
child: Text('Delete'),
|
child: Text('Delete'),
|
||||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||||
onPressed: () => Utils.confirmDelete(context, 'Delete Site?', () async {
|
onPressed: () => Utils.confirmDelete(context, 'Delete Site?', () async {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/models/Site.dart';
|
import 'package:mobile_nebula/models/Site.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigSection.dart';
|
import 'package:mobile_nebula/components/config/ConfigSection.dart';
|
||||||
|
|
|
@ -4,7 +4,6 @@ import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
||||||
|
|
|
@ -2,9 +2,7 @@ import 'dart:convert';
|
||||||
|
|
||||||
import 'package:barcode_scan/barcode_scan.dart';
|
import 'package:barcode_scan/barcode_scan.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigItem.dart';
|
||||||
|
@ -93,11 +92,9 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ConfigItem(label: Text('Valid?'), content: valid),
|
ConfigItem(label: Text('Valid?'), content: valid),
|
||||||
ConfigItem(
|
ConfigItem(
|
||||||
label: Text('Created'),
|
label: Text('Created'), content: SelectableText(certInfo.cert.details.notBefore.toLocal().toString())),
|
||||||
content: SelectableText(certInfo.cert.details.notBefore.toLocal().toString())),
|
|
||||||
ConfigItem(
|
ConfigItem(
|
||||||
label: Text('Expires'),
|
label: Text('Expires'), content: SelectableText(certInfo.cert.details.notAfter.toLocal().toString())),
|
||||||
content: SelectableText(certInfo.cert.details.notAfter.toLocal().toString())),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -105,8 +102,7 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
Widget _buildFilters() {
|
Widget _buildFilters() {
|
||||||
List<Widget> items = [];
|
List<Widget> items = [];
|
||||||
if (certInfo.cert.details.groups.length > 0) {
|
if (certInfo.cert.details.groups.length > 0) {
|
||||||
items.add(
|
items.add(ConfigItem(label: Text('Groups'), content: SelectableText(certInfo.cert.details.groups.join(', '))));
|
||||||
ConfigItem(label: Text('Groups'), content: SelectableText(certInfo.cert.details.groups.join(', '))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (certInfo.cert.details.ips.length > 0) {
|
if (certInfo.cert.details.ips.length > 0) {
|
||||||
|
@ -114,8 +110,7 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (certInfo.cert.details.subnets.length > 0) {
|
if (certInfo.cert.details.subnets.length > 0) {
|
||||||
items.add(
|
items.add(ConfigItem(label: Text('Subnets'), content: SelectableText(certInfo.cert.details.subnets.join(', '))));
|
||||||
ConfigItem(label: Text('Subnets'), content: SelectableText(certInfo.cert.details.subnets.join(', '))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return items.length > 0
|
return items.length > 0
|
||||||
|
@ -128,8 +123,8 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
ConfigItem(
|
ConfigItem(
|
||||||
label: Text('Fingerprint'),
|
label: Text('Fingerprint'),
|
||||||
content: SelectableText(certInfo.cert.fingerprint,
|
content:
|
||||||
style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14)),
|
SelectableText(certInfo.cert.fingerprint, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14)),
|
||||||
crossAxisAlignment: CrossAxisAlignment.start),
|
crossAxisAlignment: CrossAxisAlignment.start),
|
||||||
ConfigItem(
|
ConfigItem(
|
||||||
label: Text('Public Key'),
|
label: Text('Public Key'),
|
||||||
|
@ -139,8 +134,7 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
certInfo.rawCert != null
|
certInfo.rawCert != null
|
||||||
? ConfigItem(
|
? ConfigItem(
|
||||||
label: Text('PEM Format'),
|
label: Text('PEM Format'),
|
||||||
content:
|
content: SelectableText(certInfo.rawCert, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14)),
|
||||||
SelectableText(certInfo.rawCert, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14)),
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start)
|
crossAxisAlignment: CrossAxisAlignment.start)
|
||||||
: Container(),
|
: Container(),
|
||||||
],
|
],
|
||||||
|
@ -156,7 +150,7 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: PlatformButton(
|
child: PlatformElevatedButton(
|
||||||
child: Text('Replace certificate'),
|
child: Text('Replace certificate'),
|
||||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -186,7 +180,7 @@ class _CertificateDetailsScreenState extends State<CertificateDetailsScreen> {
|
||||||
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: PlatformButton(
|
child: PlatformElevatedButton(
|
||||||
child: Text('Delete'),
|
child: Text('Delete'),
|
||||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||||
onPressed: () => Utils.confirmDelete(context, title, () async {
|
onPressed: () => Utils.confirmDelete(context, title, () async {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/SimplePage.dart';
|
import 'package:mobile_nebula/components/SimplePage.dart';
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:convert';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
import 'package:mobile_nebula/components/PlatformTextFormField.dart';
|
import 'package:mobile_nebula/components/PlatformTextFormField.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
import 'package:mobile_nebula/components/IPAndPortFormField.dart';
|
import 'package:mobile_nebula/components/IPAndPortFormField.dart';
|
||||||
|
@ -103,7 +102,7 @@ class _StaticHostmapScreenState extends State<StaticHostmapScreen> {
|
||||||
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: PlatformButton(
|
child: PlatformElevatedButton(
|
||||||
child: Text('Delete'),
|
child: Text('Delete'),
|
||||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||||
onPressed: () => Utils.confirmDelete(context, 'Delete host map?', () {
|
onPressed: () => Utils.confirmDelete(context, 'Delete host map?', () {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:mobile_nebula/components/CIDRFormField.dart';
|
import 'package:mobile_nebula/components/CIDRFormField.dart';
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
|
@ -92,7 +89,7 @@ class _UnsafeRouteScreenState extends State<UnsafeRouteScreen> {
|
||||||
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
padding: EdgeInsets.only(top: 50, bottom: 10, left: 10, right: 10),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: PlatformButton(
|
child: PlatformElevatedButton(
|
||||||
child: Text('Delete'),
|
child: Text('Delete'),
|
||||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||||
onPressed: () => Utils.confirmDelete(context, 'Delete unsafe route?', () {
|
onPressed: () => Utils.confirmDelete(context, 'Delete unsafe route?', () {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:mobile_nebula/components/FormPage.dart';
|
import 'package:mobile_nebula/components/FormPage.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigButtonItem.dart';
|
||||||
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
import 'package:mobile_nebula/components/config/ConfigPageItem.dart';
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:file_picker/file_picker.dart';
|
import 'package:file_picker/file_picker.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/painting.dart';
|
|
||||||
import 'package:flutter/widgets.dart';
|
|
||||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue