mirror of
https://github.com/DefinedNet/mobile_nebula.git
synced 2025-02-22 19:15:27 +00:00
dart fix --apply --code=sort_child_properties_last
This commit is contained in:
parent
b4ba6bb726
commit
dccd96844d
14 changed files with 32 additions and 32 deletions
|
@ -14,11 +14,11 @@ class DangerButton extends StatelessWidget {
|
|||
if (Platform.isAndroid) {
|
||||
return FilledButton(
|
||||
onPressed: onPressed,
|
||||
child: child,
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: Theme.of(context).colorScheme.error,
|
||||
foregroundColor: Theme.of(context).colorScheme.onError,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
} else {
|
||||
// Workaround for https://github.com/flutter/flutter/issues/161590
|
||||
|
@ -26,9 +26,9 @@ class DangerButton extends StatelessWidget {
|
|||
return CupertinoTheme(
|
||||
data: themeData.copyWith(primaryColor: CupertinoColors.white),
|
||||
child: CupertinoButton(
|
||||
child: child,
|
||||
onPressed: onPressed,
|
||||
color: CupertinoColors.systemRed.resolveFrom(context),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -48,8 +48,8 @@ class SimplePage extends StatelessWidget {
|
|||
if (scrollable == SimpleScrollable.vertical || scrollable == SimpleScrollable.both) {
|
||||
realChild = SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: realChild,
|
||||
controller: refreshController == null ? scrollController : null,
|
||||
child: realChild,
|
||||
);
|
||||
addScrollbar = true;
|
||||
}
|
||||
|
@ -69,10 +69,10 @@ class SimplePage extends StatelessWidget {
|
|||
onRefresh: onRefresh,
|
||||
onLoading: onLoading,
|
||||
controller: refreshController!,
|
||||
child: realChild,
|
||||
enablePullUp: onLoading != null,
|
||||
enablePullDown: onRefresh != null,
|
||||
footer: ClassicFooter(loadStyle: LoadStyle.ShowWhenLoading),
|
||||
child: realChild,
|
||||
),
|
||||
);
|
||||
addScrollbar = true;
|
||||
|
|
|
@ -42,7 +42,7 @@ class _SpecialButtonState extends State<SpecialButton> with SingleTickerProvider
|
|||
child: Ink(
|
||||
decoration: widget.decoration,
|
||||
color: widget.color,
|
||||
child: InkWell(child: widget.child, onTap: widget.onPressed),
|
||||
child: InkWell(onTap: widget.onPressed, child: widget.child),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class _SpecialButtonState extends State<SpecialButton> with SingleTickerProvider
|
|||
button: true,
|
||||
child: FadeTransition(
|
||||
opacity: _opacityAnimation!,
|
||||
child: DefaultTextStyle(style: textStyle, child: Container(child: widget.child, color: widget.color)),
|
||||
child: DefaultTextStyle(style: textStyle, child: Container(color: widget.color, child: widget.child)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -14,8 +14,8 @@ class PrimaryButton extends StatelessWidget {
|
|||
if (Platform.isAndroid) {
|
||||
return FilledButton(
|
||||
onPressed: onPressed,
|
||||
child: child,
|
||||
style: FilledButton.styleFrom(backgroundColor: Theme.of(context).colorScheme.primary),
|
||||
child: child,
|
||||
);
|
||||
} else {
|
||||
// Workaround for https://github.com/flutter/flutter/issues/161590
|
||||
|
@ -23,9 +23,9 @@ class PrimaryButton extends StatelessWidget {
|
|||
return CupertinoTheme(
|
||||
data: themeData.copyWith(primaryColor: CupertinoColors.white),
|
||||
child: CupertinoButton(
|
||||
child: child,
|
||||
onPressed: onPressed,
|
||||
color: CupertinoColors.secondaryLabel.resolveFrom(context),
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class ConfigCheckboxItem extends StatelessWidget {
|
|||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
label != null ? Container(width: labelWidth, child: label) : Container(),
|
||||
Expanded(child: Container(child: content, padding: EdgeInsets.only(right: 10))),
|
||||
Expanded(child: Container(padding: EdgeInsets.only(right: 10), child: content)),
|
||||
checked
|
||||
? Icon(CupertinoIcons.check_mark, color: CupertinoColors.systemBlue.resolveFrom(context))
|
||||
: Container(),
|
||||
|
|
|
@ -53,7 +53,7 @@ class ConfigPageItem extends StatelessWidget {
|
|||
crossAxisAlignment: crossAxisAlignment,
|
||||
children: <Widget>[
|
||||
label != null ? Container(width: labelWidth, child: label) : Container(),
|
||||
Expanded(child: Container(child: content, padding: EdgeInsets.only(right: 10))),
|
||||
Expanded(child: Container(padding: EdgeInsets.only(right: 10), child: content)),
|
||||
disabled
|
||||
? Container()
|
||||
: Icon(CupertinoIcons.forward, color: CupertinoColors.placeholderText.resolveFrom(context), size: 18),
|
||||
|
|
|
@ -28,8 +28,8 @@ class ConfigSection extends StatelessWidget {
|
|||
}
|
||||
_children.add(
|
||||
Padding(
|
||||
child: Divider(height: 1, color: Utils.configSectionBorder(context)),
|
||||
padding: EdgeInsets.only(left: pad),
|
||||
child: Divider(height: 1, color: Utils.configSectionBorder(context)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -94,27 +94,30 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
} else {
|
||||
// No code, show the error
|
||||
child = Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'No valid enrollment code was found.\n\nContact your administrator to obtain a new enrollment code.',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
);
|
||||
}
|
||||
} else if (error != null) {
|
||||
// Error while enrolling, display it
|
||||
child = Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
child: SelectableText(
|
||||
'There was an issue while attempting to enroll this device. Contact your administrator to obtain a new enrollment code.',
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 20),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
child: SelectableText.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
|
@ -134,22 +137,19 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
],
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
),
|
||||
Container(
|
||||
child: Padding(child: SelectableText(error!), padding: EdgeInsets.all(16)),
|
||||
color: Theme.of(context).colorScheme.errorContainer,
|
||||
child: Padding(padding: EdgeInsets.all(16), child: SelectableText(error!)),
|
||||
),
|
||||
],
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
),
|
||||
);
|
||||
} else if (enrolled) {
|
||||
// Enrollment complete!
|
||||
child = Padding(
|
||||
child: Center(child: Text('Enrollment complete! 🎉', textAlign: TextAlign.center)),
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Center(child: Text('Enrollment complete! 🎉', textAlign: TextAlign.center)),
|
||||
);
|
||||
} else {
|
||||
// Have a code and actively enrolling
|
||||
|
@ -157,7 +157,7 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
child = Center(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(child: Text('Contacting DN for enrollment'), padding: EdgeInsets.only(bottom: 25)),
|
||||
Padding(padding: EdgeInsets.only(bottom: 25), child: Text('Contacting DN for enrollment')),
|
||||
PlatformCircularProgressIndicator(
|
||||
cupertino: (_, __) {
|
||||
return CupertinoProgressIndicatorData(radius: 50);
|
||||
|
@ -168,7 +168,7 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
);
|
||||
}
|
||||
|
||||
return SimplePage(title: Text('Enroll with Managed Nebula'), child: child, alignment: alignment);
|
||||
return SimplePage(title: Text('Enroll with Managed Nebula'), alignment: alignment, child: child);
|
||||
}
|
||||
|
||||
Widget _codeEntry() {
|
||||
|
@ -212,7 +212,7 @@ class _EnrollmentScreenState extends State<EnrollmentScreen> {
|
|||
Padding(padding: EdgeInsets.symmetric(vertical: 32), child: form),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
child: Row(children: [Expanded(child: PrimaryButton(child: Text('Submit'), onPressed: onSubmit))]),
|
||||
child: Row(children: [Expanded(child: PrimaryButton(onPressed: onSubmit, child: Text('Submit')))]),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
|
|
@ -115,8 +115,8 @@ class _MainScreenState extends State<MainScreen> {
|
|||
|
||||
if (kDebugMode) {
|
||||
debugSite = Row(
|
||||
children: [_debugSave(badDebugSave), _debugSave(goodDebugSave), _debugClearKeys()],
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [_debugSave(badDebugSave), _debugSave(goodDebugSave), _debugClearKeys()],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -168,12 +168,12 @@ class _MainScreenState extends State<MainScreen> {
|
|||
if (error != null) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: error!,
|
||||
),
|
||||
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 10),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ class _MainScreenState extends State<MainScreen> {
|
|||
);
|
||||
|
||||
if (Platform.isIOS) {
|
||||
child = CupertinoTheme(child: child, data: CupertinoTheme.of(context));
|
||||
child = CupertinoTheme(data: CupertinoTheme.of(context), child: child);
|
||||
}
|
||||
|
||||
// The theme here is to remove the hardcoded canvas border reordering forces on us
|
||||
|
|
|
@ -59,6 +59,7 @@ class _SiteLogsScreenState extends State<SiteLogsScreen> {
|
|||
refreshController.loadComplete();
|
||||
},
|
||||
refreshController: refreshController,
|
||||
bottomBar: _buildBottomBar(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(5),
|
||||
constraints: logBoxConstraints(context),
|
||||
|
@ -75,7 +76,6 @@ class _SiteLogsScreenState extends State<SiteLogsScreen> {
|
|||
}, style: TextStyle(fontFamily: 'RobotoMono', fontSize: 14)),
|
||||
),
|
||||
),
|
||||
bottomBar: _buildBottomBar(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class _SiteTunnelsScreenState extends State<SiteTunnelsScreen> {
|
|||
),
|
||||
),
|
||||
label: Row(
|
||||
children: <Widget>[Padding(child: icon, padding: EdgeInsets.only(right: 10)), Text(hostInfo.vpnIp)],
|
||||
children: <Widget>[Padding(padding: EdgeInsets.only(right: 10), child: icon), Text(hostInfo.vpnIp)],
|
||||
),
|
||||
labelWidth: ipWidth,
|
||||
content: Container(alignment: Alignment.centerRight, child: Text(hostInfo.cert?.details.name ?? "")),
|
||||
|
@ -85,7 +85,7 @@ class _SiteTunnelsScreenState extends State<SiteTunnelsScreen> {
|
|||
}).toList();
|
||||
|
||||
final Widget child = switch (children.length) {
|
||||
0 => Center(child: Padding(child: Text('No tunnels to show'), padding: EdgeInsets.only(top: 30))),
|
||||
0 => Center(child: Padding(padding: EdgeInsets.only(top: 30), child: Text('No tunnels to show'))),
|
||||
_ => ConfigSection(children: children),
|
||||
};
|
||||
|
||||
|
|
|
@ -182,8 +182,8 @@ class _SiteConfigScreenState extends State<SiteConfigScreen> {
|
|||
children: <Widget>[
|
||||
certError
|
||||
? Padding(
|
||||
child: Icon(Icons.error, color: CupertinoColors.systemRed.resolveFrom(context), size: 20),
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
child: Icon(Icons.error, color: CupertinoColors.systemRed.resolveFrom(context), size: 20),
|
||||
)
|
||||
: Container(),
|
||||
certError ? Text('Needs attention') : Text(site.certInfo?.cert.details.name ?? 'Unknown certificate'),
|
||||
|
@ -233,8 +233,8 @@ class _SiteConfigScreenState extends State<SiteConfigScreen> {
|
|||
children: <Widget>[
|
||||
caError
|
||||
? Padding(
|
||||
child: Icon(Icons.error, color: CupertinoColors.systemRed.resolveFrom(context), size: 20),
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
child: Icon(Icons.error, color: CupertinoColors.systemRed.resolveFrom(context), size: 20),
|
||||
)
|
||||
: Container(),
|
||||
caError ? Text('Needs attention') : Text(Utils.itemCountFormat(site.ca.length)),
|
||||
|
@ -274,8 +274,8 @@ class _SiteConfigScreenState extends State<SiteConfigScreen> {
|
|||
children: <Widget>[
|
||||
site.staticHostmap.length == 0
|
||||
? Padding(
|
||||
child: Icon(Icons.error, color: CupertinoColors.systemRed.resolveFrom(context), size: 20),
|
||||
padding: EdgeInsets.only(right: 5),
|
||||
child: Icon(Icons.error, color: CupertinoColors.systemRed.resolveFrom(context), size: 20),
|
||||
)
|
||||
: Container(),
|
||||
site.staticHostmap.length == 0
|
||||
|
|
|
@ -80,11 +80,11 @@ class _StaticHostsScreenState extends State<StaticHostsScreen> {
|
|||
label: Row(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
child: Icon(
|
||||
host.lighthouse ? Icons.lightbulb_outline : Icons.computer,
|
||||
color: CupertinoColors.placeholderText.resolveFrom(context),
|
||||
),
|
||||
padding: EdgeInsets.only(right: 10),
|
||||
),
|
||||
Text(host.nebulaIp),
|
||||
],
|
||||
|
|
|
@ -79,9 +79,9 @@ class Utils {
|
|||
|
||||
static Widget trailingSaveWidget(BuildContext context, Function onPressed) {
|
||||
return PlatformTextButton(
|
||||
child: Text('Save'),
|
||||
padding: Platform.isAndroid ? null : EdgeInsets.zero,
|
||||
onPressed: () => onPressed(),
|
||||
child: Text('Save'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue