From 9b2aa15eea9f2507bb439aa10e7dfe96350813cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=98n=20Ustin=C3=98ff?= Date: Thu, 25 Jul 2024 17:23:02 +0400 Subject: [PATCH] chore(1.7.1): removed `pubspec_generator` and added `package_info_plus` --- CHANGELOG.md | 5 + example/pubspec.lock | 51 +- lib/src/in_store_app_version_checker.dart | 18 +- lib/src/model/pubspec.yaml.g.dart | 500 ------------------ pubspec.lock | 55 +- pubspec.yaml | 6 +- ...ter_in_store_app_version_checker_test.dart | 6 +- test/unit/pubspec.yaml.g_test.dart | 13 - test/util/mocks.dart | 6 +- 9 files changed, 117 insertions(+), 543 deletions(-) delete mode 100644 lib/src/model/pubspec.yaml.g.dart delete mode 100644 test/unit/pubspec.yaml.g_test.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index f54a25d..a26eadb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.7.1 +- **REMOVED**: `pubspec_generator` +- **ADDED**: `package_info_plus` + + ## 1.7.0 - **ADDED**: `pubspec_generator` - **REMOVED**: `package_info_plus` diff --git a/example/pubspec.lock b/example/pubspec.lock index 0c62fef..11a018e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -57,6 +57,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" flutter: dependency: "direct main" description: flutter @@ -68,7 +76,7 @@ packages: path: ".." relative: true source: path - version: "1.7.0" + version: "1.7.1" flutter_lints: dependency: "direct dev" description: @@ -82,6 +90,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" http: dependency: transitive description: @@ -154,6 +167,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.12.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0 + url: "https://pub.dev" + source: hosted + version: "8.0.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + url: "https://pub.dev" + source: hosted + version: "3.0.0" path: dependency: transitive description: @@ -162,6 +191,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" sky_engine: dependency: transitive description: flutter @@ -247,6 +284,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.5.1" + win32: + dependency: transitive + description: + name: win32 + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + url: "https://pub.dev" + source: hosted + version: "5.5.1" sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/lib/src/in_store_app_version_checker.dart b/lib/src/in_store_app_version_checker.dart index a4a21c6..7967049 100644 --- a/lib/src/in_store_app_version_checker.dart +++ b/lib/src/in_store_app_version_checker.dart @@ -4,8 +4,8 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter_in_store_app_version_checker/src/model/in_store_app_version_checker_result.dart'; -import 'package:flutter_in_store_app_version_checker/src/model/pubspec.yaml.g.dart'; import 'package:http/http.dart' as http; +import 'package:package_info_plus/package_info_plus.dart'; /// Possible types of android store enum AndroidStore { @@ -101,21 +101,19 @@ final class _InStoreAppVersionCheckerImpl implements InStoreAppVersionChecker { _kIsWeb = true; } - final packageName = appId ?? Pubspec.name; - final currentVersion = this.currentVersion ?? Pubspec.version.canonical; + final packageInfo = await PackageInfo.fromPlatform(); + final packageName = appId ?? packageInfo.packageName; + final currentVersion = this.currentVersion ?? packageInfo.version; if (_isAndroid) { return await switch (androidStore) { AndroidStore.apkPure => - _checkPlayStore$ApkPure(currentVersion, packageName), + _checkPlayStoreApkPure(currentVersion, packageName), _ => _checkPlayStore(currentVersion, packageName), }; } else if (_isIOS) { - return await _checkAppleStore( - currentVersion, - packageName, - locale: locale, - ); + return await _checkAppleStore(currentVersion, packageName, + locale: locale); } else { return InStoreAppVersionCheckerResult( currentVersion, @@ -207,7 +205,7 @@ final class _InStoreAppVersionCheckerImpl implements InStoreAppVersionChecker { } /// {@macro in_store_app_version_checker} - Future _checkPlayStore$ApkPure( + Future _checkPlayStoreApkPure( String currentVersion, String packageName, ) async { diff --git a/lib/src/model/pubspec.yaml.g.dart b/lib/src/model/pubspec.yaml.g.dart deleted file mode 100644 index 238a8cc..0000000 --- a/lib/src/model/pubspec.yaml.g.dart +++ /dev/null @@ -1,500 +0,0 @@ -// ignore_for_file: lines_longer_than_80_chars, unnecessary_raw_strings -// ignore_for_file: use_raw_strings, avoid_classes_with_only_static_members -// ignore_for_file: avoid_escaping_inner_quotes, prefer_single_quotes - -/// GENERATED CODE - DO NOT MODIFY BY HAND - -library pubspec; - -// ***************************************************************************** -// * pubspec_generator * -// ***************************************************************************** - -/* - - MIT License - - Copyright (c) 2024 Plague Fox - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - */ - -/// Given a version number MAJOR.MINOR.PATCH, increment the: -/// -/// 1. MAJOR version when you make incompatible API changes -/// 2. MINOR version when you add functionality in a backward compatible manner -/// 3. PATCH version when you make backward compatible bug fixes -/// -/// Additional labels for pre-release and build metadata are available -/// as extensions to the MAJOR.MINOR.PATCH format. -typedef PubspecVersion = ({ - String representation, - String canonical, - int major, - int minor, - int patch, - List preRelease, - List build -}); - -/// # The pubspec file -/// -/// Code generated pubspec.yaml.g.dart from pubspec.yaml -/// This class is generated from pubspec.yaml, do not edit directly. -/// -/// Every pub package needs some metadata so it can specify its dependencies. -/// Pub packages that are shared with others also need to provide some other -/// information so users can discover them. All of this metadata goes -/// in the package’s pubspec: -/// a file named pubspec.yaml that’s written in the YAML language. -/// -/// Read more: -/// - https://pub.dev/packages/pubspec_generator -/// - https://dart.dev/tools/pub/pubspec -sealed class Pubspec { - /// Version - /// - /// Current app [version] - /// - /// Every package has a version. - /// A version number is required to host your package on the pub.dev site, - /// but can be omitted for local-only packages. - /// If you omit it, your package is implicitly versioned 0.0.0. - /// - /// Versioning is necessary for reusing code while letting it evolve quickly. - /// A version number is three numbers separated by dots, like 0.2.43. - /// It can also optionally have a build ( +1, +2, +hotfix.oopsie) - /// or prerelease (-dev.4, -alpha.12, -beta.7, -rc.5) suffix. - /// - /// Each time you publish your package, you publish it at a specific version. - /// Once that’s been done, consider it hermetically sealed: - /// you can’t touch it anymore. To make more changes, - /// you’ll need a new version. - /// - /// When you select a version, - /// follow [semantic versioning](https://semver.org/). - static const PubspecVersion version = ( - /// Non-canonical string representation of the version as provided - /// in the pubspec.yaml file. - representation: r'1.7.0', - - /// Returns a 'canonicalized' representation - /// of the application version. - /// This represents the version string in accordance with - /// Semantic Versioning (SemVer) standards. - canonical: r'1.7.0', - - /// MAJOR version when you make incompatible API changes. - /// The major version number: 1 in "1.2.3". - major: 1, - - /// MINOR version when you add functionality - /// in a backward compatible manner. - /// The minor version number: 2 in "1.2.3". - minor: 7, - - /// PATCH version when you make backward compatible bug fixes. - /// The patch version number: 3 in "1.2.3". - patch: 0, - - /// The pre-release identifier: "foo" in "1.2.3-foo". - preRelease: [], - - /// The build identifier: "foo" in "1.2.3+foo". - build: [], - ); - - /// Build date and time (UTC) - static final DateTime timestamp = DateTime.utc( - 2024, - 7, - 25, - 11, - 3, - 21, - 559, - 322, - ); - - /// Name - /// - /// Current app [name] - /// - /// Every package needs a name. - /// It’s how other packages refer to yours, and how it appears to the world, - /// should you publish it. - /// - /// The name should be all lowercase, with underscores to separate words, - /// just_like_this. Use only basic Latin letters and Arabic digits: - /// [a-z0-9_]. Also, make sure the name is a valid Dart identifier—that - /// it doesn’t start with digits - /// and isn’t a [reserved word](https://dart.dev/language/keywords). - /// - /// Try to pick a name that is clear, terse, and not already in use. - /// A quick search of packages on the [pub.dev site](https://pub.dev/packages) - /// to make sure that nothing else is using your name is recommended. - static const String name = r'flutter_in_store_app_version_checker'; - - /// Description - /// - /// Current app [description] - /// - /// This is optional for your own personal packages, - /// but if you intend to publish your package you must provide a description, - /// which should be in English. - /// The description should be relatively short, from 60 to 180 characters - /// and tell a casual reader what they might want to know about your package. - /// - /// Think of the description as the sales pitch for your package. - /// Users see it when they [browse for packages](https://pub.dev/packages). - /// The description is plain text: no markdown or HTML. - static const String description = - r'A lightweight flutter plugin to check if your app is up-to-date on GooglePlay or AppStore.'; - - /// Homepage - /// - /// Current app [homepage] - /// - /// This should be a URL pointing to the website for your package. - /// For [hosted packages](https://dart.dev/tools/pub/dependencies#hosted-packages), - /// this URL is linked from the package’s page. - /// While providing a homepage is optional, - /// please provide it or repository (or both). - /// It helps users understand where your package is coming from. - static const String homepage = - r'https://github.com/ziqq/flutter_in_store_app_version_checker'; - - /// Repository - /// - /// Current app [repository] - /// - /// Repository - /// The optional repository field should contain the URL for your package’s - /// source code repository—for example, - /// https://github.com//. - /// If you publish your package to the pub.dev site, - /// then your package’s page displays the repository URL. - /// While providing a repository is optional, - /// please provide it or homepage (or both). - /// It helps users understand where your package is coming from. - static const String repository = - r'https://github.com/ziqq/flutter_in_store_app_version_checker'; - - /// Issue tracker - /// - /// Current app [issueTracker] - /// - /// The optional issue_tracker field should contain a URL for the package’s - /// issue tracker, where existing bugs can be viewed and new bugs can be filed. - /// The pub.dev site attempts to display a link - /// to each package’s issue tracker, using the value of this field. - /// If issue_tracker is missing but repository is present and points to GitHub, - /// then the pub.dev site uses the default issue tracker - /// (https://github.com///issues). - static const String issueTracker = - r'https://github.com/ziqq/flutter_in_store_app_version_checker/issues'; - - /// Documentation - /// - /// Current app [documentation] - /// - /// Some packages have a site that hosts documentation, - /// separate from the main homepage and from the Pub-generated API reference. - /// If your package has additional documentation, add a documentation: - /// field with that URL; pub shows a link to this documentation - /// on your package’s page. - static const String documentation = r''; - - /// Publish_to - /// - /// Current app [publishTo] - /// - /// The default uses the [pub.dev](https://pub.dev/) site. - /// Specify none to prevent a package from being published. - /// This setting can be used to specify a custom pub package server to publish. - /// - /// ```yaml - /// publish_to: none - /// ``` - static const String publishTo = r'https://pub.dartlang.org'; - - /// Funding - /// - /// Current app [funding] - /// - /// Package authors can use the funding property to specify - /// a list of URLs that provide information on how users - /// can help fund the development of the package. For example: - /// - /// ```yaml - /// funding: - /// - https://www.buymeacoffee.com/example_user - /// - https://www.patreon.com/some-account - /// ``` - /// - /// If published to [pub.dev](https://pub.dev/) the links are displayed on the package page. - /// This aims to help users fund the development of their dependencies. - static const List funding = []; - - /// False_secrets - /// - /// Current app [falseSecrets] - /// - /// When you try to publish a package, - /// pub conducts a search for potential leaks of secret credentials, - /// API keys, or cryptographic keys. - /// If pub detects a potential leak in a file that would be published, - /// then pub warns you and refuses to publish the package. - /// - /// Leak detection isn’t perfect. To avoid false positives, - /// you can tell pub not to search for leaks in certain files, - /// by creating an allowlist using gitignore - /// patterns under false_secrets in the pubspec. - /// - /// For example, the following entry causes pub not to look - /// for leaks in the file lib/src/hardcoded_api_key.dart - /// and in all .pem files in the test/localhost_certificates/ directory: - /// - /// ```yaml - /// false_secrets: - /// - /lib/src/hardcoded_api_key.dart - /// - /test/localhost_certificates/*.pem - /// ``` - /// - /// Starting a gitignore pattern with slash (/) ensures - /// that the pattern is considered relative to the package’s root directory. - static const List falseSecrets = []; - - /// Screenshots - /// - /// Current app [screenshots] - /// - /// Packages can showcase their widgets or other visual elements - /// using screenshots displayed on their pub.dev page. - /// To specify screenshots for the package to display, - /// use the screenshots field. - /// - /// A package can list up to 10 screenshots under the screenshots field. - /// Don’t include logos or other branding imagery in this section. - /// Each screenshot includes one description and one path. - /// The description explains what the screenshot depicts - /// in no more than 160 characters. For example: - /// - /// ```yaml - /// screenshots: - /// - description: 'This screenshot shows the transformation of a number of bytes - /// to a human-readable expression.' - /// path: path/to/image/in/package/500x500.webp - /// - description: 'This screenshot shows a stack trace returning a human-readable - /// representation.' - /// path: path/to/image/in/package.png - /// ``` - /// - /// Pub.dev limits screenshots to the following specifications: - /// - /// - File size: max 4 MB per image. - /// - File types: png, jpg, gif, or webp. - /// - Static and animated images are both allowed. - /// - /// Keep screenshot files small. Each download of the package - /// includes all screenshot files. - /// - /// Pub.dev generates the package’s thumbnail image from the first screenshot. - /// If this screenshot uses animation, pub.dev uses its first frame. - static const List screenshots = []; - - /// Topics - /// - /// Current app [topics] - /// - /// Package authors can use the topics field to categorize their package. Topics can be used to assist discoverability during search with filters on pub.dev. Pub.dev displays the topics on the package page as well as in the search results. - /// - /// The field consists of a list of names. For example: - /// - /// ```yaml - /// topics: - /// - network - /// - http - /// ``` - /// - /// Pub.dev requires topics to follow these specifications: - /// - /// - Tag each package with at most 5 topics. - /// - Write the topic name following these requirements: - /// 1) Use between 2 and 32 characters. - /// 2) Use only lowercase alphanumeric characters or hyphens (a-z, 0-9, -). - /// 3) Don’t use two consecutive hyphens (--). - /// 4) Start the name with lowercase alphabet characters (a-z). - /// 5) End with alphanumeric characters (a-z or 0-9). - /// - /// When choosing topics, consider if existing topics are relevant. - /// Tagging with existing topics helps users discover your package. - static const List topics = []; - - /// Environment - static const Map environment = { - 'sdk': '>=3.0.0 <4.0.0', - 'flutter': '>=3.0.0 <4.0.0', - }; - - /// Platforms - /// - /// Current app [platforms] - /// - /// When you [publish a package](https://dart.dev/tools/pub/publishing), - /// pub.dev automatically detects the platforms that the package supports. - /// If this platform-support list is incorrect, - /// use platforms to explicitly declare which platforms your package supports. - /// - /// For example, the following platforms entry causes - /// pub.dev to list the package as supporting - /// Android, iOS, Linux, macOS, Web, and Windows: - /// - /// ```yaml - /// # This package supports all platforms listed below. - /// platforms: - /// android: - /// ios: - /// linux: - /// macos: - /// web: - /// windows: - /// ``` - /// - /// Here is an example of declaring that the package supports only Linux and macOS (and not, for example, Windows): - /// - /// ```yaml - /// # This package supports only Linux and macOS. - /// platforms: - /// linux: - /// macos: - /// ``` - static const Map platforms = {}; - - /// Dependencies - /// - /// Current app [dependencies] - /// - /// [Dependencies](https://dart.dev/tools/pub/glossary#dependency) - /// are the pubspec’s `raison d’être`. - /// In this section you list each package that - /// your package needs in order to work. - /// - /// Dependencies fall into one of two types. - /// Regular dependencies are listed under dependencies: - /// these are packages that anyone using your package will also need. - /// Dependencies that are only needed in - /// the development phase of the package itself - /// are listed under dev_dependencies. - /// - /// During the development process, - /// you might need to temporarily override a dependency. - /// You can do so using dependency_overrides. - /// - /// For more information, - /// see [Package dependencies](https://dart.dev/tools/pub/dependencies). - static const Map dependencies = { - 'flutter': { - 'sdk': r'flutter', - }, - 'meta': r'^1.9.1', - 'http': r'^1.2.2', - }; - - /// Developer dependencies - static const Map devDependencies = { - 'flutter_test': { - 'sdk': r'flutter', - }, - 'collection': r'any', - 'path': r'any', - 'build_runner': r'^2.4.11', - 'pubspec_generator': r'^4.0.0', - 'mockito': r'^5.4.4', - 'flutter_lints': r'^4.0.0', - }; - - /// Dependency overrides - static const Map dependencyOverrides = {}; - - /// Executables - /// - /// Current app [executables] - /// - /// A package may expose one or more of its scripts as executables - /// that can be run directly from the command line. - /// To make a script publicly available, - /// list it under the executables field. - /// Entries are listed as key/value pairs: - /// - /// ```yaml - /// : - /// ``` - /// - /// For example, the following pubspec entry lists two scripts: - /// - /// ```yaml - /// executables: - /// slidy: main - /// fvm: - /// ``` - /// - /// Once the package is activated using pub global activate, - /// typing `slidy` executes `bin/main.dart`. - /// Typing `fvm` executes `bin/fvm.dart`. - /// If you don’t specify the value, it is inferred from the key. - /// - /// For more information, see pub global. - static const Map executables = {}; - - /// Source data from pubspec.yaml - static const Map source = { - 'name': name, - 'description': description, - 'repository': repository, - 'issue_tracker': issueTracker, - 'homepage': homepage, - 'documentation': documentation, - 'publish_to': publishTo, - 'version': version, - 'funding': funding, - 'false_secrets': falseSecrets, - 'screenshots': screenshots, - 'topics': topics, - 'platforms': platforms, - 'environment': environment, - 'dependencies': dependencies, - 'dev_dependencies': devDependencies, - 'dependency_overrides': dependencyOverrides, - 'flutter': { - 'plugin': { - 'platforms': { - 'android': { - 'package': r'com.example.in_store_app_version_checker', - 'pluginclass': r'InStoreAppVersionCheckerPlugin', - }, - 'ios': { - 'pluginclass': r'InStoreAppVersionCheckerPlugin', - }, - }, - }, - }, - }; -} diff --git a/pubspec.lock b/pubspec.lock index 74eeb4f..95ec3cf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -177,6 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" file: dependency: transitive description: @@ -211,6 +219,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" frontend_server_client: dependency: transitive description: @@ -371,6 +384,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0 + url: "https://pub.dev" + source: hosted + version: "8.0.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + url: "https://pub.dev" + source: hosted + version: "3.0.0" path: dependency: "direct dev" description: @@ -379,6 +408,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.9.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" pool: dependency: transitive description: @@ -395,14 +432,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - pubspec_generator: - dependency: "direct dev" - description: - name: pubspec_generator - sha256: "7286dfd00b3b7309604c3d5eb23abb46dfd91c216ab9d5f01dcb8ce34a79bc41" - url: "https://pub.dev" - source: hosted - version: "4.0.0" pubspec_parse: dependency: transitive description: @@ -552,6 +581,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.0" + win32: + dependency: transitive + description: + name: win32 + sha256: a79dbe579cb51ecd6d30b17e0cae4e0ea15e2c0e66f69ad4198f22a6789e94f4 + url: "https://pub.dev" + source: hosted + version: "5.5.1" yaml: dependency: transitive description: @@ -562,4 +599,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.4.0 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + flutter: ">=3.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index e42f258..0861b47 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ name: flutter_in_store_app_version_checker description: > A lightweight flutter plugin to check if your app is up-to-date on GooglePlay or AppStore. -version: 1.7.0 +version: 1.7.1 homepage: https://github.com/ziqq/flutter_in_store_app_version_checker @@ -25,6 +25,9 @@ dependencies: # Http http: ^1.2.2 + # Utilities + package_info_plus: ^8.0.0 + dev_dependencies: flutter_test: sdk: flutter @@ -34,7 +37,6 @@ dev_dependencies: path: any build_runner: ^2.4.11 - pubspec_generator: ^4.0.0 # Testing mockito: ^5.4.4 diff --git a/test/flutter_in_store_app_version_checker_test.dart b/test/flutter_in_store_app_version_checker_test.dart index 06ae6e4..b93c705 100644 --- a/test/flutter_in_store_app_version_checker_test.dart +++ b/test/flutter_in_store_app_version_checker_test.dart @@ -2,9 +2,5 @@ import 'unit/in_store_app_version_checker_test.dart' as in_store_app_version_checker; -import 'unit/pubspec.yaml.g_test.dart' as pubspec_yaml_g_test; -void main() { - in_store_app_version_checker.main(); - pubspec_yaml_g_test.main(); -} +void main() => in_store_app_version_checker.main(); diff --git a/test/unit/pubspec.yaml.g_test.dart b/test/unit/pubspec.yaml.g_test.dart deleted file mode 100644 index 1e1973e..0000000 --- a/test/unit/pubspec.yaml.g_test.dart +++ /dev/null @@ -1,13 +0,0 @@ -// autor - Anton Ustinoff -import 'package:flutter_in_store_app_version_checker/src/model/pubspec.yaml.g.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() => group( - 'Unit_tests -', - () => group('pubspec.yaml.g -', () { - group('timestamp -', () { - test('When called, should be return ', () { - expect(Pubspec.timestamp, isA()); - }); - }); - })); diff --git a/test/util/mocks.dart b/test/util/mocks.dart index 2580dd2..2fe849b 100644 --- a/test/util/mocks.dart +++ b/test/util/mocks.dart @@ -2,10 +2,14 @@ import 'package:http/http.dart' as http; import 'package:mockito/annotations.dart'; +import 'package:package_info_plus/package_info_plus.dart'; export 'mocks.mocks.dart'; -@GenerateMocks([], customMocks: [MockSpec()]) +@GenerateMocks([], customMocks: [ + MockSpec(), + MockSpec(), +]) void getGenerateMocks() {} const fakeAndroidBuildVersion = {