From 0f9480c8e6c69ceede5713daafcf96a8febaf67e Mon Sep 17 00:00:00 2001 From: TechnicJelle <22576047+TechnicJelle@users.noreply.github.com> Date: Wed, 20 Nov 2024 01:18:38 +0100 Subject: [PATCH] Improve appbar title _Finally_ This has not changed since the first commit!! https://github.com/TechnicJelle/BlueMapGUI/commit/a8a67bff53f88a9ebc8112a114b7a7ddceedc879#diff-e61eb31d013d12616f5532636a88cfa63631dda8f7829e5424e68542214d1608R93-R102 --- lib/main.dart | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 98ac405..a9a67b4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import "dart:io"; import "package:flutter/material.dart"; import "package:flutter_riverpod/flutter_riverpod.dart"; +import "package:path/path.dart" as p; import "main_menu/main_menu.dart"; import "main_menu/projects/projects_screen.dart"; @@ -52,14 +53,16 @@ class MyHomePage extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final Directory? projectDirectory = ref.watch(openProjectProvider); - String title = "BlueMap GUI"; - if (projectDirectory != null) { - title += ": ${projectDirectory.path}"; - } + final String title = projectDirectory == null + ? "BlueMap GUI" + : "Project: ${p.basename(projectDirectory.path)}"; return Scaffold( appBar: AppBar( - title: Text(title), + title: Tooltip( + message: projectDirectory?.path ?? "Hi :)", + child: Text(title), + ), actions: [ const Text("Version: $version\nBlueMap: $blueMapTag"), if (projectDirectory != null) ...[