From af1c5829844930d5ec0c5f4639b3a094196ed58f Mon Sep 17 00:00:00 2001 From: Caleb Jasik Date: Wed, 29 Jan 2025 10:12:24 -0600 Subject: [PATCH] Update the bottom app bar for the logs screen (#236) --- lib/screens/EnrollmentScreen.dart | 1 - lib/screens/SiteLogsScreen.dart | 59 ++++++++++++++++++------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lib/screens/EnrollmentScreen.dart b/lib/screens/EnrollmentScreen.dart index a34ee96..2cee762 100644 --- a/lib/screens/EnrollmentScreen.dart +++ b/lib/screens/EnrollmentScreen.dart @@ -10,7 +10,6 @@ import 'package:mobile_nebula/components/SimplePage.dart'; import 'package:mobile_nebula/components/buttons/PrimaryButton.dart'; import 'package:url_launcher/url_launcher.dart'; -import '../components/config/ConfigItem.dart'; import '../components/config/ConfigSection.dart'; class EnrollmentScreen extends StatefulWidget { diff --git a/lib/screens/SiteLogsScreen.dart b/lib/screens/SiteLogsScreen.dart index 78c75a0..c6ae222 100644 --- a/lib/screens/SiteLogsScreen.dart +++ b/lib/screens/SiteLogsScreen.dart @@ -105,33 +105,42 @@ class _SiteLogsScreenState extends State { var padding = Platform.isAndroid ? EdgeInsets.fromLTRB(0, 20, 0, 30) : EdgeInsets.all(10); - return Container( - decoration: BoxDecoration( - border: Border(top: borderSide), - ), - child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded(child: Builder(builder: (BuildContext context) { - return PlatformIconButton( - padding: padding, - icon: Icon(context.platformIcons.share, size: 30), - onPressed: () { - Share.shareFile(context, - title: '${widget.site.name} logs', - filePath: widget.site.logFile, - filename: '${widget.site.name}.log'); - }, - ); - })), - Expanded( + return PlatformWidgetBuilder( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + spacing: 8, + children: [ + Tooltip( + message: "Share logs", child: PlatformIconButton( + icon: Icon(context.platformIcons.share), + onPressed: () { + Share.shareFile(context, + title: '${widget.site.name} logs', + filePath: widget.site.logFile, + filename: '${widget.site.name}.log'); + }, + ), + ), + Tooltip( + message: 'Go to latest', + child: PlatformIconButton( + icon: Icon(context.platformIcons.downArrow), + onPressed: () async { + controller.animateTo(controller.position.maxScrollExtent, + duration: const Duration(milliseconds: 500), curve: Curves.linearToEaseOut); + }, + ), + ), + ], + ), + cupertino: (context, child, platform) => Container( + decoration: BoxDecoration( + border: Border(top: borderSide), + ), padding: padding, - icon: Icon(context.platformIcons.downArrow, size: 30), - onPressed: () async { - controller.animateTo(controller.position.maxScrollExtent, - duration: const Duration(milliseconds: 500), curve: Curves.linearToEaseOut); - }, - )), - ])); + child: child), + material: (context, child, platform) => BottomAppBar(child: child)); } loadLogs() async {