From 067e1c1faee110a5b7655d0c4d9f83a5f921d8cb Mon Sep 17 00:00:00 2001 From: netharu methmitha Date: Fri, 17 Jun 2022 12:45:29 +0530 Subject: [PATCH] added the version to the info page in settings and fixed a tiny UX issue - UX issue - add a new bell button covers the bell tools --- lib/pages/bells_page.dart | 3 +- lib/pages/settings_page.dart | 32 +++++++++++++++++++-- pubspec.lock | 56 ++++++++++++++++++++++++++++++++++++ pubspec.yaml | 3 +- 4 files changed, 90 insertions(+), 4 deletions(-) diff --git a/lib/pages/bells_page.dart b/lib/pages/bells_page.dart index b6567fc..a25bfe3 100644 --- a/lib/pages/bells_page.dart +++ b/lib/pages/bells_page.dart @@ -180,7 +180,8 @@ class _BellPageState extends State { 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); diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 4856750..83f9847 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -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 { @@ -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 createState() => _InfoPageState(); +} + +class _InfoPageState extends State { + 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( @@ -111,7 +135,11 @@ class InfoPage extends StatelessWidget { label: const Text('Source Code'), ) ], - ) + ), + Text( + 'version : v${_packageInfo.version}', + style: const TextStyle(color: Colors.grey), + ), ], ); } diff --git a/pubspec.lock b/pubspec.lock index d80bb40..dd5fd2e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -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: diff --git a/pubspec.yaml b/pubspec.yaml index f8f8687..e408dc9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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" @@ -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: