Skip to content

Commit

Permalink
Update goldens
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit committed Feb 3, 2024
1 parent 267ada7 commit b64259c
Show file tree
Hide file tree
Showing 8 changed files with 915 additions and 232 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,91 @@ Message: `Convert to ConsumerStatefulWidget`
return const Placeholder();
}
===
Message: `Convert to ConsumerStatefulWidget`
=== diff (starting at line 133)
}

- class StatelessWithField extends StatelessWidget {
- const StatelessWithField({
- super.key,
- required this.field,
- });
-
- final int field;
- static final int staticField = 42;
-
- @override
- Widget build(BuildContext context) {
- return Column(
- children: [
- Text('$field'),
- Text('$staticField'),
+ class StatelessWithField extends ConsumerStatefulWidget {
+ const StatelessWithField({
+ super.key,
+ required this.field,
+ });
+
+ final int field;
+ static final int staticField = 42;
+
+ @override
+ ConsumerState<StatelessWithField> createState() => _StatelessWithFieldState();
+ }
+
+ class _StatelessWithFieldState extends ConsumerState<StatelessWithField> {
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ children: [
+ Text('${widget.field}'),
+ Text('${StatelessWithField.staticField}'),
],
);
===
Message: `Convert to ConsumerStatefulWidget`
=== diff (starting at line 153)
}

- class HookConsumerWithField extends HookConsumerWidget {
- const HookConsumerWithField({
- super.key,
- required this.field,
- });
-
- final int field;
- static final int staticField = 42;
-
- @override
- Widget build(
- BuildContext context,
- WidgetRef ref,
- ) {
- return Column(
- children: [
- Text('$field'),
- Text('$staticField'),
+ class HookConsumerWithField extends ConsumerStatefulWidget {
+ const HookConsumerWithField({
+ super.key,
+ required this.field,
+ });
+
+ final int field;
+ static final int staticField = 42;
+
+ @override
+ ConsumerState<HookConsumerWithField> createState() => _HookConsumerWithFieldState();
+ }
+
+ class _HookConsumerWithFieldState extends ConsumerState<HookConsumerWithField> {
+ @override
+ Widget build(
+ BuildContext context) {
+ return Column(
+ children: [
+ Text('${widget.field}'),
+ Text('${HookConsumerWithField.staticField}'),
],
);
===
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,15 @@ Message: `Convert to ConsumerWidget`
- /// Hello world
- @override
- Widget build(BuildContext context) {
- // Some comments
- return const Placeholder();
- }
- }
+ class Stateful extends ConsumerWidget {
+ const Stateful({super.key});
+
+
+ /// Hello world
+
+ /// Hello world
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ // Some comments
+ return const Placeholder();
+ }
+ }
+


// Some comments
return const Placeholder();
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 62)
Expand All @@ -110,23 +101,14 @@ Message: `Convert to ConsumerWidget`
- Widget build(
- BuildContext context,
- ) {
- return const Placeholder();
- }
- }
+ class ExplicitCreateState extends ConsumerWidget {
+ const ExplicitCreateState({super.key});
+
+
+ @override
+ Widget build(
+ BuildContext context, WidgetRef ref,
+ ) {
+ return const Placeholder();
+ }
+ }
+


+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
return const Placeholder();
}
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 78)
Expand All @@ -142,21 +124,14 @@ Message: `Convert to ConsumerWidget`
- class HookStatefulState extends State<HookStateful> {
- @override
- Widget build(BuildContext context) {
- return const Placeholder();
- }
- }
+ class HookStateful extends ConsumerWidget {
+ const HookStateful({super.key});
+
+
+ @override
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ return const Placeholder();
+ }
+ }
+


return const Placeholder();
}
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 92)
Expand All @@ -172,21 +147,14 @@ Message: `Convert to ConsumerWidget`
- class _ConsumerStatefulState extends ConsumerState<ConsumerStateful> {
- @override
- Widget build(BuildContext context) {
- return const Placeholder();
- }
- }
+ class ConsumerStateful extends ConsumerWidget {
+ const ConsumerStateful({super.key});
+
+
+ @override
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ return const Placeholder();
+ }
+ }
+


return const Placeholder();
}
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 106)
Expand All @@ -203,19 +171,124 @@ Message: `Convert to ConsumerWidget`
- class _HookConsumerStatefulState extends ConsumerState<HookConsumerStateful> {
- @override
- Widget build(BuildContext context) {
- return const Placeholder();
- }
- }
+ class HookConsumerStateful extends ConsumerWidget {
+ const HookConsumerStateful({super.key});
+
+
+ @override
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
return const Placeholder();
}
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 133)
}

- class StatelessWithField extends StatelessWidget {
- const StatelessWithField({
- super.key,
- required this.field,
- });
-
- final int field;
- static final int staticField = 42;
-
- @override
- Widget build(BuildContext context) {
+ class StatelessWithField extends ConsumerWidget {
+ const StatelessWithField({
+ super.key,
+ required this.field,
+ });
+
+ final int field;
+ static final int staticField = 42;
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
return Column(
children: [
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 153)
}

- class HookConsumerWithField extends HookConsumerWidget {
+ class HookConsumerWithField extends ConsumerWidget {
const HookConsumerWithField({
super.key,
===
Message: `Convert to ConsumerWidget`
=== diff (starting at line 180)
}

- class ConsumerStatefulWithField extends ConsumerStatefulWidget {
- const ConsumerStatefulWithField({
- super.key,
- required this.field,
- required this.foo,
- });
-
- final int field;
- final FooClass foo;
- static final int staticField = _constantNumber;
-
- @override
- ConsumerState<ConsumerStatefulWithField> createState() =>
- _ConsumerStatefulWithFieldState();
- }
-
- const _constantNumber = 42;
-
- class _ConsumerStatefulWithFieldState
- extends ConsumerState<ConsumerStatefulWithField> {
- void printFoo() {
- print(widget.foo);
- }
-
- @override
- Widget build(BuildContext context) {
- print(widget.field);
- printFoo();
- return Column(
- children: [
- Text('${widget.field}'),
- Text('${widget.foo.bar}'),
- Text('${ConsumerStatefulWithField.staticField}'),
- ],
- );
- }
- }
+ class ConsumerStatefulWithField extends ConsumerWidget {
+ const ConsumerStatefulWithField({
+ super.key,
+ required this.field,
+ required this.foo,
+ });
+
+ final int field;
+ final FooClass foo;
+ static final int staticField = _constantNumber;
+
+
+ void printFoo() {
+ print(foo);
+ }
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ return const Placeholder();
+ print(field);
+ printFoo();
+ return Column(
+ children: [
+ Text('$field'),
+ Text('${foo.bar}'),
+ Text('$staticField'),
+ ],
+ );
+ }
+ }
+

+ const _constantNumber = 42;

===
Loading

0 comments on commit b64259c

Please sign in to comment.