Skip to content

Commit

Permalink
Add type constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
n-bernat committed Sep 7, 2024
1 parent eacc546 commit 7f11b4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0

- **BREAKING**: Require `Preference` type to extend `Object`.

## 0.1.0

- Initial release.
2 changes: 1 addition & 1 deletion lib/flutter_app_preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class BaseAppPreferences extends ChangeNotifier {
}

/// A class that holds the app preferences.
class Preference<T> extends ValueNotifier<T> {
class Preference<T extends Object> extends ValueNotifier<T> {
/// Creates a new instance of [Preference].
Preference(
String key,
Expand Down

0 comments on commit 7f11b4e

Please sign in to comment.