Platform
testing
Plugin
package_info_plus
Version
3.0.1
Flutter SDK
3.3.6
Steps to reproduce
I stumbled across this issue when I wanted to use PackageInfo in a test and could not properly compare two instances as hashcode and equals is not overwritten.
https://github.com/fluttercommunity/plus_plugins/blob/main/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart
Code Sample
mockValue = PackageInfo(
appName: 'test',
packageName: 'test',
version: 'test',
buildNumber: 'test',
);
... execute test
expect(result, equals(PackageInfo(
appName: 'test',
packageName: 'test',
version: 'test',
buildNumber: 'test',
)));
Logs
Expected: [Instance of 'PackageInfo']
Actual: [Instance of 'PackageInfo']
Which: at location [0] is <Instance of 'PackageInfo'> instead of <Instance of 'PackageInfo'>
WARNING: Please ensure state instances extend Equatable, override == and hashCode, or implement Comparable.
Flutter Doctor
[✓] Flutter (Channel stable, 3.3.6, on macOS 12.3.1 21E258 darwin-arm, locale en-DE)
• Flutter version 3.3.6 on channel stable at /opt/homebrew/Caskroom/flutter/2.5.3/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 6928314d50 (13 days ago), 2022-10-25 16:34:41 -0400
• Engine revision 3ad69d7be3
• Dart version 2.18.2
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1)
• Android SDK at /Users/damianbast/Library/Android/sdk
• Platform android-33, build-tools 32.0.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 13A1030d
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
[✓] Connected device (3 available)
• iPhone 11 (mobile) • F17849CC-2710-40F5-BA75-3B7D81242F91 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.3.1 21E258 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.87
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Checklist before submitting a bug
Platform
testing
Plugin
package_info_plus
Version
3.0.1
Flutter SDK
3.3.6
Steps to reproduce
I stumbled across this issue when I wanted to use PackageInfo in a test and could not properly compare two instances as hashcode and equals is not overwritten.
https://github.com/fluttercommunity/plus_plugins/blob/main/packages/package_info_plus/package_info_plus/lib/package_info_plus.dart
Code Sample
Logs
Flutter Doctor
[✓] Flutter (Channel stable, 3.3.6, on macOS 12.3.1 21E258 darwin-arm, locale en-DE) • Flutter version 3.3.6 on channel stable at /opt/homebrew/Caskroom/flutter/2.5.3/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 6928314d50 (13 days ago), 2022-10-25 16:34:41 -0400 • Engine revision 3ad69d7be3 • Dart version 2.18.2 • DevTools version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0-rc1) • Android SDK at /Users/damianbast/Library/Android/sdk • Platform android-33, build-tools 32.0.0-rc1 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 13.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 13A1030d • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763) [✓] Connected device (3 available) • iPhone 11 (mobile) • F17849CC-2710-40F5-BA75-3B7D81242F91 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.3.1 21E258 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.87 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found!Checklist before submitting a bug
flutter pub upgradeflutter clean