Update the bottom app bar for the logs screen (#236)

This commit is contained in:
Caleb Jasik 2025-01-29 10:12:24 -06:00 committed by GitHub
parent f3d22a83cf
commit af1c582984
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 26 deletions

View file

@ -10,7 +10,6 @@ import 'package:mobile_nebula/components/SimplePage.dart';
import 'package:mobile_nebula/components/buttons/PrimaryButton.dart'; import 'package:mobile_nebula/components/buttons/PrimaryButton.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../components/config/ConfigItem.dart';
import '../components/config/ConfigSection.dart'; import '../components/config/ConfigSection.dart';
class EnrollmentScreen extends StatefulWidget { class EnrollmentScreen extends StatefulWidget {

View file

@ -105,33 +105,42 @@ class _SiteLogsScreenState extends State<SiteLogsScreen> {
var padding = Platform.isAndroid ? EdgeInsets.fromLTRB(0, 20, 0, 30) : EdgeInsets.all(10); var padding = Platform.isAndroid ? EdgeInsets.fromLTRB(0, 20, 0, 30) : EdgeInsets.all(10);
return Container( return PlatformWidgetBuilder(
decoration: BoxDecoration( child: Row(
border: Border(top: borderSide), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
), spacing: 8,
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ children: <Widget>[
Expanded(child: Builder(builder: (BuildContext context) { Tooltip(
return PlatformIconButton( message: "Share logs",
padding: padding, child: PlatformIconButton(
icon: Icon(context.platformIcons.share, size: 30), icon: Icon(context.platformIcons.share),
onPressed: () { onPressed: () {
Share.shareFile(context, Share.shareFile(context,
title: '${widget.site.name} logs', title: '${widget.site.name} logs',
filePath: widget.site.logFile, filePath: widget.site.logFile,
filename: '${widget.site.name}.log'); filename: '${widget.site.name}.log');
}, },
); ),
})), ),
Expanded( Tooltip(
message: 'Go to latest',
child: PlatformIconButton( child: PlatformIconButton(
padding: padding, icon: Icon(context.platformIcons.downArrow),
icon: Icon(context.platformIcons.downArrow, size: 30),
onPressed: () async { onPressed: () async {
controller.animateTo(controller.position.maxScrollExtent, controller.animateTo(controller.position.maxScrollExtent,
duration: const Duration(milliseconds: 500), curve: Curves.linearToEaseOut); duration: const Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
}, },
)), ),
])); ),
],
),
cupertino: (context, child, platform) => Container(
decoration: BoxDecoration(
border: Border(top: borderSide),
),
padding: padding,
child: child),
material: (context, child, platform) => BottomAppBar(child: child));
} }
loadLogs() async { loadLogs() async {