Skip to content

Commit

Permalink
Improve appbar title
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicJelle committed Nov 20, 2024
1 parent 9158d03 commit 0f9480c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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) ...[
Expand Down

0 comments on commit 0f9480c

Please sign in to comment.