Skip to content

Commit 347433a

Browse files
authored
Merge pull request #17 from mx1up/feature/print_version_on_startup
Feature/print version on startup
2 parents a92f309 + 812160e commit 347433a

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 0.3.2 - 2025-11-11
4+
5+
* print app version on startup
6+
* show progress label during file scan
7+
38
## 0.3.1 - 2025-04-15
49

510
* add about dialog with version info

lib/main.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:fdupes_gui/presentation/dupe_screen.dart';
66
import 'package:fdupes_gui/theme.dart';
77
import 'package:flutter/material.dart';
88
import 'package:flutter_bloc/flutter_bloc.dart';
9+
import 'package:package_info_plus/package_info_plus.dart';
910

1011
class MyBlocObserver extends BlocObserver {
1112
@override
@@ -33,7 +34,7 @@ class MyBlocObserver extends BlocObserver {
3334
}
3435
}
3536

36-
void main(List<String> args) {
37+
Future<void> main(List<String> args) async {
3738
List<String>? initialDirsArg;
3839
if (args.length > 0) {
3940
initialDirsArg = args;
@@ -42,6 +43,10 @@ void main(List<String> args) {
4243
final initialDirs =
4344
initialDirsArg?.map((e) => Directory(e)).where((element) => element.existsSync()).map((e) => e.absolute).toList();
4445
print('valid initialDirs=$initialDirs');
46+
WidgetsFlutterBinding.ensureInitialized();
47+
final appInfo = await PackageInfo.fromPlatform();
48+
print('app info: ${appInfo.appName} v${appInfo.version}(${appInfo.buildNumber})');
49+
4550
Bloc.observer = MyBlocObserver();
4651

4752
runApp(MyApp(initialDirs));

lib/presentation/dupe_screen.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,17 @@ class DupeScreen extends StatelessWidget {
4949
return Center(child: Text(state.msg));
5050
}
5151
if (state is FdupesStateLoading) {
52+
final progress = state.progress != null ? state.progress!.toDouble() / 100.0 : null;
5253
return Center(
53-
child: CircularProgressIndicator(value: state.progress != null ? state.progress!.toDouble() / 100.0 : null),
54+
child: Column(
55+
mainAxisSize: MainAxisSize.max,
56+
mainAxisAlignment: MainAxisAlignment.center,
57+
children: [
58+
CircularProgressIndicator(value: progress),
59+
SizedBox(height: 8),
60+
Text(progress == null ? 'Initializing...' : '${(progress * 100).toInt()}%')
61+
],
62+
),
5463
);
5564
}
5665
if (state is FdupesStateResult) {

pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: fdupes_gui
22
description: fdupes front-end
33
publish_to: 'none'
4-
version: 0.3.1+7
4+
version: 0.3.2+8
55

66
dependency_overrides:
7+
# https://github.com/brendan-duncan/image/pull/732
78
image:
89
git:
910
url: https://github.com/mx1up/image.git

0 commit comments

Comments
 (0)