Skip to content

Commit

Permalink
added the version to the info page in settings and fixed a tiny UX issue
Browse files Browse the repository at this point in the history
 - UX issue - add a new bell button covers the bell tools
  • Loading branch information
netharuM committed Jun 17, 2022
1 parent 992bd98 commit 067e1c1
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/pages/bells_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class _BellPageState extends State<BellPage> {
child: BellCardData(
shake: _changingOrder,
child: ReorderableListView(
padding: const EdgeInsets.all(8),
padding: const EdgeInsets.only(
top: 8, left: 8, right: 8, bottom: 64),
onReorder: (int oldIndex, int newIndex) {
debugPrint("Reordered $oldIndex to $newIndex");
_moveBell(oldIndex, newIndex);
Expand Down
32 changes: 30 additions & 2 deletions lib/pages/settings_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:auto_bell/settings.dart';
import 'package:auto_bell/widgets/title_bar.dart';
import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';

class SettingsPage extends StatelessWidget {
Expand Down Expand Up @@ -44,9 +45,32 @@ class SettingsPage extends StatelessWidget {
}
}

class InfoPage extends StatelessWidget {
class InfoPage extends StatefulWidget {
const InfoPage({Key? key}) : super(key: key);

@override
State<InfoPage> createState() => _InfoPageState();
}

class _InfoPageState extends State<InfoPage> {
PackageInfo _packageInfo = PackageInfo(
appName: 'Unknown',
packageName: 'Unknown',
version: ' Unknown',
buildNumber: 'Unknown',
buildSignature: 'Unknown',
);

@override
void initState() {
PackageInfo.fromPlatform().then((packageInfo) {
setState(() {
_packageInfo = packageInfo;
});
});
super.initState();
}

@override
Widget build(BuildContext context) {
return Column(
Expand Down Expand Up @@ -111,7 +135,11 @@ class InfoPage extends StatelessWidget {
label: const Text('Source Code'),
)
],
)
),
Text(
'version : v${_packageInfo.version}',
style: const TextStyle(color: Colors.grey),
),
],
);
}
Expand Down
56 changes: 56 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
name: http
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.4"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
intl:
dependency: "direct main"
description:
Expand Down Expand Up @@ -254,6 +268,48 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.2"
package_info_plus_linux:
dependency: transitive
description:
name: package_info_plus_linux
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_macos:
dependency: transitive
description:
name: package_info_plus_macos
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
package_info_plus_web:
dependency: transitive
description:
name: package_info_plus_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
package_info_plus_windows:
dependency: transitive
description:
name: package_info_plus_windows
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
path:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+4
version: 1.0.5+1

environment:
sdk: ">=2.16.1 <3.0.0"
Expand Down Expand Up @@ -47,6 +47,7 @@ dependencies:
path_provider: ^2.0.9
url_launcher: ^6.0.20
local_notifier: ^0.1.1
package_info_plus: ^1.4.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 067e1c1

Please sign in to comment.