Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/theme_tailor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.0.2
Copy link

@vasilich6107 vasilich6107 Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this could be 4.0.0 as far as we are having a breaking change.

by bumping analyzer to next major version
analyzer: ">=7.0.0 <8.0.0"

and dart
dart: ">=3.0.0 <4.0.0"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not count dependencies upgrade as a breaking change, we didn't change any API in this release. Pub won't upgrade this version in your project if dependencies are not compatible.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying

- Support analyzer 7.0.0
- Support source_gen 2.0.0
- Require Dart >=3.0.0

# 3.0.1
- Bump dependencies versions

Expand Down Expand Up @@ -77,7 +82,7 @@
- Add support for json_serializable,
- Add support for nested the extension with `@themeExtension` annotation,
- Add support for Flutter's DiagnosticableTreeMixin (debugFillProperties)
- Generated class will overwrite the `hashCode` and `==` operator. The equality operator will deeply compare collections in the class
- Generated class will overwrite the `hashCode` and `==` operator. The equality operator will deeply compare collections in the class

# 1.0.1
- Fix README.md
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: annotate_overrides
// ignore_for_file: annotate_overrides, deprecated_member_use

import 'package:example/encoder_example.dart';
import 'package:flutter/material.dart';
Expand All @@ -22,15 +22,13 @@ class JsonColorConverter implements JsonConverter<Color, int> {
@JsonSerializable(explicitToJson: true)
@CustomColorEncoder()
@JsonColorConverter()
class SerializableTheme extends ThemeExtension<SerializableTheme>
with _$SerializableThemeTailorMixin {
class SerializableTheme extends ThemeExtension<SerializableTheme> with _$SerializableThemeTailorMixin {
SerializableTheme({
required this.fooNumber,
this.barColor = Colors.black,
});

factory SerializableTheme.fromJson(Map<String, dynamic> json) =>
_$SerializableThemeFromJson(json);
factory SerializableTheme.fromJson(Map<String, dynamic> json) => _$SerializableThemeFromJson(json);

@JsonKey(name: 'foo_number', defaultValue: 10)
final int fooNumber;
Expand Down
10 changes: 2 additions & 8 deletions packages/theme_tailor/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// ignore_for_file: library_private_types_in_public_api
// ignore_for_file: unnecessary_import
import 'dart:ui';

import 'package:example/app_colors.dart';
import 'package:example/diagnosticable_lib.dart';

Expand Down Expand Up @@ -58,7 +54,7 @@ class MyApp extends StatefulWidget {
const MyApp({super.key});

@override
_MyAppState createState() => _MyAppState();
State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
Expand Down Expand Up @@ -118,9 +114,7 @@ class _MyHomePageState extends State<MyHomePage> {

void _swapTheme() {
final currentTheme = widget.themeModeNotifier.value;
currentTheme == ThemeMode.light
? widget.themeModeNotifier.value = ThemeMode.dark
: widget.themeModeNotifier.value = ThemeMode.light;
currentTheme == ThemeMode.light ? widget.themeModeNotifier.value = ThemeMode.dark : widget.themeModeNotifier.value = ThemeMode.light;
}

@override
Expand Down
Loading