-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
What input code did you provide to the formatter?
This is the output produced by the earlier (<= 3.6) formatter
class StatePanelX extends StatelessWidget {
const StatePanelX({super.key});
@override
Widget build(BuildContext context) {
return BlocBuilder<MachineBloc, MachineState>(
buildWhen: (previous, current) => current.status != previous.status,
builder: (context, state) {
return Row(children: [
state.status.isRefreshable
? IconButton(
color: Colors.amber,
onPressed: () => context
.read<MachineBloc>()
.add(WeatherRefreshRequested()),
icon: const Icon(Icons.restart_alt),
)
: const IconButton(
color: Colors.grey,
onPressed: null,
icon: Icon(Icons.restart_alt),
),
StatusIndicator(status: state.status),
]);
},
);
}
}
What output did the formatter produce?
class StatePanelX extends StatelessWidget {
const StatePanelX({super.key});
@override
Widget build(BuildContext context) {
return BlocBuilder<MachineBloc, MachineState>(
buildWhen: (previous, current) => current.status != previous.status,
builder: (context, state) {
return Row(
children: [
state.status.isRefreshable
? IconButton(
color: Colors.amber,
onPressed:
() => context.read<MachineBloc>().add(
WeatherRefreshRequested(),
),
icon: const Icon(Icons.restart_alt),
)
: const IconButton(
color: Colors.grey,
onPressed: null,
icon: Icon(Icons.restart_alt),
),
StatusIndicator(status: state.status),
],
);
},
);
}
}
What output did you expect or want the formatter to produce?
See the first example above. The problem seems to occur due to the auto-inserted comma after WeatherRefreshRequested()
Anything else we should know?
This issue was originally raised as part of #1668
Metadata
Metadata
Assignees
Labels
No labels