Skip to content

Commit

Permalink
reactive_forms_generator 6.0.0-beta.13
Browse files Browse the repository at this point in the history
reactive_forms_generator 6.0.0-beta.10

sponsors

equalsTo method

rebase

improve logging

nested form groups

6.0.0-beta.3

InconsistentAnalysisException fix

6.0.0-beta.1

test stabilization

freezed

first iteration of toOutput

remove array type checker

beta
  • Loading branch information
vasilich6107 committed Dec 16, 2024
1 parent 3e13b20 commit 68a72b5
Show file tree
Hide file tree
Showing 139 changed files with 19,321 additions and 665 deletions.
Binary file removed assets/dc.png
Binary file not shown.
12 changes: 6 additions & 6 deletions packages/generator_tests/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ packages:
dependency: transitive
description:
name: build_runner_core
sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0
sha256: "30859c90e9ddaccc484f56303931f477b1f1ba2bab74aa32ed5d6ce15870f8cf"
url: "https://pub.dev"
source: hosted
version: "7.3.2"
version: "7.2.8"
build_test:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -351,10 +351,10 @@ packages:
dependency: "direct dev"
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
version: "1.1.1"
macros:
dependency: transitive
description:
Expand Down Expand Up @@ -457,14 +457,14 @@ packages:
path: "../reactive_forms_annotations"
relative: true
source: path
version: "5.0.0"
version: "6.0.0-beta.6"
reactive_forms_generator:
dependency: "direct dev"
description:
path: "../reactive_forms_generator"
relative: true
source: path
version: "5.0.6"
version: "6.0.0-beta.14"
recase:
dependency: "direct main"
description:
Expand Down
46 changes: 40 additions & 6 deletions packages/generator_tests/test/doc/annotateless_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
part '$fileName.gform.dart';
@Rf()
@Rf(output: false)
class Annotateless {
final String email;
Expand All @@ -41,7 +41,7 @@ void main() {
const generatedFile = r'''// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file:
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'annotateless.dart';
Expand Down Expand Up @@ -188,6 +188,34 @@ class _AnnotatelessFormBuilderState extends State<AnnotatelessFormBuilder> {
widget.initState?.call(context, _formModel);
_logAnnotatelessForm.onRecord.listen((LogRecord e) {
// use `dumpErrorToConsole` for severe messages to ensure that severe
// exceptions are formatted consistently with other Flutter examples and
// avoids printing duplicate exceptions
if (e.level >= Level.SEVERE) {
final Object? error = e.error;
FlutterError.dumpErrorToConsole(
FlutterErrorDetails(
exception: error is Exception ? error : Exception(error),
stack: e.stackTrace,
library: e.loggerName,
context: ErrorDescription(e.message),
),
);
} else {
log(
e.message,
time: e.time,
sequenceNumber: e.sequenceNumber,
level: e.level.value,
name: e.loggerName,
zone: e.zone,
error: e.error,
stackTrace: e.stackTrace,
);
}
});
super.initState();
}
Expand Down Expand Up @@ -225,7 +253,9 @@ class _AnnotatelessFormBuilderState extends State<AnnotatelessFormBuilder> {
}
}
class AnnotatelessForm implements FormModel<Annotateless> {
final _logAnnotatelessForm = Logger('AnnotatelessForm');
class AnnotatelessForm implements FormModel<Annotateless, Annotateless> {
AnnotatelessForm(
this.form,
this.path,
Expand Down Expand Up @@ -378,9 +408,11 @@ class AnnotatelessForm implements FormModel<Annotateless> {
final isValid = !currentForm.hasErrors && currentForm.errors.isEmpty;
if (!isValid) {
debugPrintStack(
label:
'[${path ?? 'AnnotatelessForm'}]\n┗━ Avoid calling `model` on invalid form. Possible exceptions for non-nullable fields which should be guarded by `required` validator.');
_logAnnotatelessForm.warning(
'Avoid calling `model` on invalid form.Possible exceptions for non-nullable fields which should be guarded by `required` validator.',
null,
StackTrace.current,
);
}
return Annotateless(email: _emailValue, password: _passwordValue);
}
Expand Down Expand Up @@ -438,6 +470,8 @@ class AnnotatelessForm implements FormModel<Annotateless> {
if (currentForm.valid) {
onValid(model);
} else {
_logAnnotatelessForm.info('Errors');
_logAnnotatelessForm.info('┗━━ ${form.errors}');
onNotValid?.call();
}
}
Expand Down
46 changes: 40 additions & 6 deletions packages/generator_tests/test/doc/array_nullable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void main() {
enum UserMode { user, admin }
@Rf()
@Rf(output: false)
class ArrayNullable {
final List<String> emailList;
Expand Down Expand Up @@ -56,7 +56,7 @@ void main() {
const generatedFile = r'''// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file:
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
part of 'array_nullable.dart';
Expand Down Expand Up @@ -203,6 +203,34 @@ class _ArrayNullableFormBuilderState extends State<ArrayNullableFormBuilder> {
widget.initState?.call(context, _formModel);
_logArrayNullableForm.onRecord.listen((LogRecord e) {
// use `dumpErrorToConsole` for severe messages to ensure that severe
// exceptions are formatted consistently with other Flutter examples and
// avoids printing duplicate exceptions
if (e.level >= Level.SEVERE) {
final Object? error = e.error;
FlutterError.dumpErrorToConsole(
FlutterErrorDetails(
exception: error is Exception ? error : Exception(error),
stack: e.stackTrace,
library: e.loggerName,
context: ErrorDescription(e.message),
),
);
} else {
log(
e.message,
time: e.time,
sequenceNumber: e.sequenceNumber,
level: e.level.value,
name: e.loggerName,
zone: e.zone,
error: e.error,
stackTrace: e.stackTrace,
);
}
});
super.initState();
}
Expand Down Expand Up @@ -240,7 +268,9 @@ class _ArrayNullableFormBuilderState extends State<ArrayNullableFormBuilder> {
}
}
class ArrayNullableForm implements FormModel<ArrayNullable> {
final _logArrayNullableForm = Logger('ArrayNullableForm');
class ArrayNullableForm implements FormModel<ArrayNullable, ArrayNullable> {
ArrayNullableForm(
this.form,
this.path,
Expand Down Expand Up @@ -858,9 +888,11 @@ class ArrayNullableForm implements FormModel<ArrayNullable> {
final isValid = !currentForm.hasErrors && currentForm.errors.isEmpty;
if (!isValid) {
debugPrintStack(
label:
'[${path ?? 'ArrayNullableForm'}]\n┗━ Avoid calling `model` on invalid form. Possible exceptions for non-nullable fields which should be guarded by `required` validator.');
_logArrayNullableForm.warning(
'Avoid calling `model` on invalid form.Possible exceptions for non-nullable fields which should be guarded by `required` validator.',
null,
StackTrace.current,
);
}
return ArrayNullable(
emailList: _emailListValue,
Expand Down Expand Up @@ -923,6 +955,8 @@ class ArrayNullableForm implements FormModel<ArrayNullable> {
if (currentForm.valid) {
onValid(model);
} else {
_logArrayNullableForm.info('Errors');
_logArrayNullableForm.info('┗━━ ${form.errors}');
onNotValid?.call();
}
}
Expand Down
Loading

0 comments on commit 68a72b5

Please sign in to comment.