Commit ac9fa29
authored
feat!: 6.0.0 Major Refactoring - Complete Breaking Changes (#510)
## 🚀 Summary
Major refactoring for flutter_inapp_purchase v6.0.0 with complete
breaking changes to improve type safety, code organization, and
developer experience.
## 💥 BREAKING CHANGES
### File Structure
- Moved all enums from `types.dart` to new `enums.dart` file
- Renamed `Store.dart` to `enums.dart` for consistency
- Split module-specific code into separate files:
- `modules/android.dart` for Android-specific functionality
- `modules/ios.dart` for iOS-specific functionality
- Created dedicated type files:
- `types/iap_android_types.dart`
- `types/iap_ios_types.dart`
### Type Safety Improvements
- Fixed all `List<dynamic>?` warnings with explicit type annotations
- Added explicit `Future<dynamic>` return types where applicable
- Fixed all type inference issues with explicit parameter types
- Improved null safety throughout the codebase
### Removed Deprecated APIs
- Removed unused `_finishTransactionIOSOld` method
- Cleaned up deprecated methods scheduled for removal in v6.0.0
### Error Handling
- Created new `utils/error_mapping.dart` for centralized error handling
- Improved error type definitions and mapping
## ✨ New Features
- Added `use_iap.dart` hook for Flutter Hooks integration
- Better separation of concerns with module-specific files
- Improved type definitions for Android and iOS platforms
## 📝 Migration Guide
### Import Changes
```dart
// Before
import 'package:flutter_inapp_purchase/Store.dart';
import 'package:flutter_inapp_purchase/types.dart';
// After
import 'package:flutter_inapp_purchase/enums.dart';
import 'package:flutter_inapp_purchase/types.dart';
```
### Enum Usage
All enums are now imported from `enums.dart`. The `types.dart` file
exports `enums.dart` for backward compatibility, but direct imports are
recommended.
### Platform-Specific Code
```dart
// Android-specific
import 'package:flutter_inapp_purchase/modules/android.dart';
// iOS-specific
import 'package:flutter_inapp_purchase/modules/ios.dart';
```
## 🧪 Test Plan
- [x] All existing tests pass
- [x] Type checking passes without warnings
- [x] Example app runs correctly on both platforms
- [ ] Migration from v5.x works as documented
## 📊 Impact
This is a major version bump (v6.0.0) with extensive breaking changes.
All users will need to update their code when upgrading.
Closes #505 #507 #503 #501 #500 #496 #495 #494 #491 #4821 parent e99bce0 commit ac9fa29
File tree
95 files changed
+15260
-4330
lines changed- .claude
- .vscode
- android
- src/main
- kotlin/dev/hyo/flutterinapppurchase
- darwin
- Assets
- Classes
- docs
- docs
- api
- getting-started
- guides
- src
- components/HomepageFeatures
- pages
- versioned_docs
- version-5.5.0
- getting-started
- version-6.0.0
- getting-started
- example
- android
- app
- src/main
- java
- com/dooboolab/iapexample
- dev/hyo/martie
- gradle/wrapper
- ios
- Flutter
- ephemeral
- Runner.xcodeproj
- Runner
- lib
- src
- screens
- ios
- Classes
- flutter_inapp_purchase/Sources/flutter_inapp_purchase
- lib
- modules
- types
- utils
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
95 files changed
+15260
-4330
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
1 | 101 | | |
2 | 102 | | |
3 | 103 | | |
| |||
438 | 538 | | |
439 | 539 | | |
440 | 540 | | |
441 | | - | |
| 541 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments