Skip to content

Commit

Permalink
[ui] remove package_info_plus dependency
Browse files Browse the repository at this point in the history
Benefits:
- Fewer dependencies (yay!)
- We now need to update the app version on new releases only in two
  places: `pubspec.yaml` and `lib/constants.dart`. I plan to create a
  release guide so we don't forget either when creating a new
  release[1].

[1]: Lacerte#285
  • Loading branch information
triallax committed Jul 3, 2022
1 parent b26763c commit 5deaf6d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 51 deletions.
7 changes: 7 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

const appVersion = '2.0.1';
14 changes: 6 additions & 8 deletions lib/ui/screens/about_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import 'package:clima/constants.dart';
import 'package:clima/ui/build_flavor.dart';
import 'package:clima/ui/widgets/dialogs/credits_dialog.dart';
import 'package:clima/ui/widgets/dialogs/help_and_feedback_dialog.dart';
Expand All @@ -12,7 +13,6 @@ import 'package:clima/ui/widgets/settings/settings_header.dart';
import 'package:clima/ui/widgets/settings/settings_tile.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';

class AboutScreen extends StatelessWidget {
Expand Down Expand Up @@ -43,14 +43,14 @@ class AboutScreen extends StatelessWidget {
),
SettingsTile(
title: 'Changelog',
subtitle: 'Version 2.0.1',
subtitle: 'Version $appVersion',
leading: Icon(
Icons.new_releases_outlined,
color: Theme.of(context).iconTheme.color,
),
onTap: () => launchUrl(
Uri.parse(
'https://github.com/lacerte/clima/releases/tag/v2.0.1',
'https://github.com/lacerte/clima/releases/tag/v$appVersion',
),
),
),
Expand All @@ -75,13 +75,11 @@ class AboutScreen extends StatelessWidget {
Icons.source_outlined,
color: Theme.of(context).iconTheme.color,
),
onTap: () async {
final PackageInfo packageInfo =
await PackageInfo.fromPlatform();
onTap: () {
showLicensePage(
context: context,
applicationName: packageInfo.appName,
applicationVersion: packageInfo.version,
applicationName: 'Clima',
applicationVersion: appVersion,
);
},
),
Expand Down
42 changes: 0 additions & 42 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -478,48 +478,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.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
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies:
git:
url: https://github.com/CentaurusApps/material_floating_search_bar.git
ref: 07b2980ad304dacaa5688e56483adcec36fb08ab
package_info_plus: 1.4.2
riverpod: 1.0.3
shared_preferences: 2.0.15
font_awesome_flutter: 10.1.0
Expand Down

0 comments on commit 5deaf6d

Please sign in to comment.