Skip to content

Commit 9735109

Browse files
authored
fix: revert json_annotation update (#159)
1 parent 50b99c4 commit 9735109

File tree

15 files changed

+572
-34
lines changed

15 files changed

+572
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
## 4.1.1
1+
## 4.1.2
22

33
**Bug fix**
44
- [#156](https://github.com/FlutterGen/flutter_gen/pull/156) The Dartdocs generate different strings on Windows and Ubuntu.
55

6-
**Features**
7-
- [#157](https://github.com/FlutterGen/flutter_gen/pull/157) The supported version of json_serializable `>=5.0.0 <6.0.0` -> `>=5.0.0 <7.0.0`.
8-
96
## 4.1.0
107

118
**Feature**
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
// ignore_for_file: directives_ordering
22
import 'package:build_runner_core/build_runner_core.dart' as _i1;
33
import 'package:flutter_gen_runner/flutter_gen_runner.dart' as _i2;
4-
import 'package:json_serializable/builder.dart' as _i3;
5-
import 'package:source_gen/builder.dart' as _i4;
6-
import 'dart:isolate' as _i5;
7-
import 'package:build_runner/build_runner.dart' as _i6;
8-
import 'dart:io' as _i7;
4+
import 'package:freezed/builder.dart' as _i3;
5+
import 'package:json_serializable/builder.dart' as _i4;
6+
import 'package:source_gen/builder.dart' as _i5;
7+
import 'dart:isolate' as _i6;
8+
import 'package:build_runner/build_runner.dart' as _i7;
9+
import 'dart:io' as _i8;
910

1011
final _builders = <_i1.BuilderApplication>[
1112
_i1.apply(r'flutter_gen_runner:flutter_gen_runner', [_i2.build],
1213
_i1.toDependentsOf(r'flutter_gen_runner'),
1314
hideOutput: false),
14-
_i1.apply(r'json_serializable:json_serializable', [_i3.jsonSerializable],
15+
_i1.apply(r'freezed:freezed', [_i3.freezed], _i1.toDependentsOf(r'freezed'),
16+
hideOutput: false),
17+
_i1.apply(r'json_serializable:json_serializable', [_i4.jsonSerializable],
1518
_i1.toDependentsOf(r'json_serializable'),
1619
hideOutput: true,
1720
appliesBuilders: const [r'source_gen:combining_builder']),
18-
_i1.apply(r'source_gen:combining_builder', [_i4.combiningBuilder],
21+
_i1.apply(r'source_gen:combining_builder', [_i5.combiningBuilder],
1922
_i1.toNoneByDefault(),
2023
hideOutput: false, appliesBuilders: const [r'source_gen:part_cleanup']),
21-
_i1.applyPostProcess(r'source_gen:part_cleanup', _i4.partCleanup)
24+
_i1.applyPostProcess(r'source_gen:part_cleanup', _i5.partCleanup)
2225
];
23-
void main(List<String> args, [_i5.SendPort? sendPort]) async {
24-
var result = await _i6.run(args, _builders);
26+
void main(List<String> args, [_i6.SendPort? sendPort]) async {
27+
var result = await _i7.run(args, _builders);
2528
sendPort?.send(result);
26-
_i7.exitCode = result;
29+
_i8.exitCode = result;
2730
}

example/analysis_options.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
include: package:flutter_lints/flutter.yaml
22

3+
analyzer:
4+
exclude:
5+
- "**/*.g.dart"
6+
- "**/*.freezed.dart"
7+
38
linter:
49
rules:
510
public_member_api_docs: false

example/lib/freezed_sample.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// main.dart
2+
import 'package:freezed_annotation/freezed_annotation.dart';
3+
import 'package:flutter/foundation.dart';
4+
5+
part 'freezed_sample.freezed.dart';
6+
7+
@freezed
8+
class Union with _$Union {
9+
const factory Union(int value) = Data;
10+
const factory Union.loading() = Loading;
11+
const factory Union.error([String? message]) = ErrorDetails;
12+
}

0 commit comments

Comments
 (0)