Skip to content

Commit c76f6f3

Browse files
committed
show about dialog
1 parent d1de0bf commit c76f6f3

6 files changed

Lines changed: 91 additions & 10 deletions

File tree

lib/presentation/about_dialog.dart

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:package_info_plus/package_info_plus.dart';
3+
import 'package:url_launcher/link.dart';
4+
5+
Future<void> showAboutDialoog(
6+
BuildContext context,
7+
) async {
8+
final appInfo = await PackageInfo.fromPlatform();
9+
showAboutDialog(
10+
context: context,
11+
applicationIcon: Image.asset('assets/app_icon_256.png', width: 64),
12+
applicationVersion: 'v${appInfo.version}',
13+
children: [
14+
const SizedBox(height: 16),
15+
Row(
16+
children: [
17+
const Text('GitHub: '),
18+
Link(
19+
uri: Uri.parse('https://github.com/mx1up/fdupes-gui'),
20+
builder: (context, followLink) => GestureDetector(
21+
onTap: followLink,
22+
child: const Text(
23+
'https://github.com/mx1up/fdupes-gui',
24+
style: TextStyle(color: Colors.blue),
25+
),
26+
),
27+
),
28+
],
29+
),
30+
const SizedBox(height: 8),
31+
Row(
32+
children: [
33+
const Text('Blog: '),
34+
Link(
35+
uri: Uri.parse('https://mattiesworld.gotdns.org/weblog/category/coding-excursions/fdupes-gui'),
36+
builder: (context, followLink) => GestureDetector(
37+
onTap: followLink,
38+
child: const Text(
39+
'https://mattiesworld.gotdns.org/weblog',
40+
style: TextStyle(color: Colors.blue),
41+
),
42+
),
43+
),
44+
],
45+
),
46+
],
47+
);
48+
}

lib/presentation/dupes_top_bar.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:io';
22

33
import 'package:fdupes_gui/domain/fdupes_bloc.dart';
4+
import 'package:fdupes_gui/presentation/about_dialog.dart';
45
import 'package:fdupes_gui/presentation/base_dirs.dart';
56
import 'package:fdupes_gui/presentation/select_folder_dialog.dart';
67
import 'package:flutter/material.dart';
@@ -20,10 +21,6 @@ class DupesTopBar extends StatelessWidget {
2021
mainAxisSize: MainAxisSize.max,
2122
crossAxisAlignment: CrossAxisAlignment.start,
2223
children: [
23-
Expanded(
24-
child: BaseDirs(baseDirs: baseDirs),
25-
),
26-
SizedBox(width: 8),
2724
Column(
2825
children: [
2926
Tooltip(
@@ -43,6 +40,17 @@ class DupesTopBar extends StatelessWidget {
4340
),
4441
],
4542
),
43+
SizedBox(width: 8),
44+
Expanded(
45+
child: BaseDirs(baseDirs: baseDirs),
46+
),
47+
Tooltip(
48+
message: 'Find duplicates',
49+
child: ElevatedButton(
50+
child: Icon(Icons.info_outline),
51+
onPressed: () => showAboutDialoog(context),
52+
),
53+
),
4654
],
4755
);
4856
}

macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import FlutterMacOS
66
import Foundation
77

88
import file_selector_macos
9+
import package_info_plus
910
import shared_preferences_foundation
1011
import url_launcher_macos
1112

1213
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
1314
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
15+
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
1416
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
1517
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
1618
}

macos/Podfile.lock

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ PODS:
22
- file_selector_macos (0.0.1):
33
- FlutterMacOS
44
- FlutterMacOS (1.0.0)
5+
- package_info_plus (0.0.1):
6+
- FlutterMacOS
57
- shared_preferences_foundation (0.0.1):
68
- Flutter
79
- FlutterMacOS
@@ -11,6 +13,7 @@ PODS:
1113
DEPENDENCIES:
1214
- file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
1315
- FlutterMacOS (from `Flutter/ephemeral`)
16+
- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)
1417
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
1518
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
1619

@@ -19,17 +22,20 @@ EXTERNAL SOURCES:
1922
:path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
2023
FlutterMacOS:
2124
:path: Flutter/ephemeral
25+
package_info_plus:
26+
:path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos
2227
shared_preferences_foundation:
2328
:path: Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin
2429
url_launcher_macos:
2530
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
2631

2732
SPEC CHECKSUMS:
28-
file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2
33+
file_selector_macos: 585232b688707857504f9cb5f985a7c97fe4dd30
2934
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
30-
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
31-
url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399
35+
package_info_plus: 122abb51244f66eead59ce7c9c200d6b53111779
36+
shared_preferences_foundation: 0b09b969fb36da5551c0bc4a2dbd9d0ff9387478
37+
url_launcher_macos: de10e46d8d8b9e3a7b8a133e8de92b104379f05e
3238

3339
PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
3440

35-
COCOAPODS: 1.14.3
41+
COCOAPODS: 1.16.2

pubspec.lock

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ packages:
233233
dependency: transitive
234234
description:
235235
name: js
236-
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
236+
sha256: cf7243a0c29626284ada2add68a33f5b1102affe3509393e75136e0f6616bd68
237237
url: "https://pub.dev"
238238
source: hosted
239-
version: "0.6.7"
239+
version: "0.6.8"
240240
json_annotation:
241241
dependency: transitive
242242
description:
@@ -277,6 +277,22 @@ packages:
277277
url: "https://pub.dev"
278278
source: hosted
279279
version: "3.3.2"
280+
package_info_plus:
281+
dependency: "direct main"
282+
description:
283+
name: package_info_plus
284+
sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017"
285+
url: "https://pub.dev"
286+
source: hosted
287+
version: "4.2.0"
288+
package_info_plus_platform_interface:
289+
dependency: transitive
290+
description:
291+
name: package_info_plus_platform_interface
292+
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
293+
url: "https://pub.dev"
294+
source: hosted
295+
version: "2.0.1"
280296
path:
281297
dependency: "direct main"
282298
description:

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dependencies:
1717
flutter:
1818
sdk: flutter
1919

20+
package_info_plus: ^4.2.0
2021
process_run: ^0.13.2
2122
file_selector: ^1.0.1
2223
flutter_bloc: ^8.1.3

0 commit comments

Comments
 (0)