Auto-format Framework (#160545)

This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
This commit is contained in:
Michael Goderbauer
2024-12-19 12:06:21 -08:00
committed by GitHub
parent 8e0993eda8
commit 5491c8c146
4411 changed files with 455108 additions and 415991 deletions

View File

@@ -9,27 +9,24 @@ import 'package:flutter/material.dart';
void main() => runApp(const StepStyleExampleApp());
class StepStyleExampleApp extends StatelessWidget {
const StepStyleExampleApp({super.key});
const StepStyleExampleApp({ super.key });
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Step Style Example')),
body: const Center(
child: StepStyleExample(),
),
),
);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Step Style Example')),
body: const Center(child: StepStyleExample()),
),
);
}
}
class StepStyleExample extends StatefulWidget {
const StepStyleExample({ super.key });
const StepStyleExample({super.key});
@override
State<StepStyleExample> createState() => _StepStyleExampleState();
@override
State<StepStyleExample> createState() => _StepStyleExampleState();
}
class _StepStyleExampleState extends State<StepStyleExample> {
@@ -37,18 +34,13 @@ class _StepStyleExampleState extends State<StepStyleExample> {
connectorThickness: 10,
color: Colors.white,
connectorColor: Colors.red,
indexStyle: const TextStyle(
color: Colors.black,
fontSize: 20,
),
border: Border.all(
width: 2,
),
indexStyle: const TextStyle(color: Colors.black, fontSize: 20),
border: Border.all(width: 2),
);
@override
Widget build(BuildContext context) {
return Stepper(
@override
Widget build(BuildContext context) {
return Stepper(
type: StepperType.horizontal,
stepIconHeight: 48,
stepIconWidth: 48,
@@ -66,21 +58,14 @@ class _StepStyleExampleState extends State<StepStyleExample> {
isActive: true,
stepStyle: _stepStyle.copyWith(
connectorColor: Colors.orange,
gradient: const LinearGradient(
colors: <Color>[
Colors.white,
Colors.black,
],
),
gradient: const LinearGradient(colors: <Color>[Colors.white, Colors.black]),
),
),
Step(
title: const SizedBox.shrink(),
content: const SizedBox.shrink(),
isActive: true,
stepStyle: _stepStyle.copyWith(
connectorColor: Colors.blue,
),
stepStyle: _stepStyle.copyWith(connectorColor: Colors.blue),
),
Step(
title: const SizedBox.shrink(),
@@ -89,13 +74,8 @@ class _StepStyleExampleState extends State<StepStyleExample> {
stepStyle: _stepStyle.merge(
StepStyle(
color: Colors.white,
indexStyle: const TextStyle(
color: Colors.black,
fontSize: 20,
),
border: Border.all(
width: 2,
),
indexStyle: const TextStyle(color: Colors.black, fontSize: 20),
border: Border.all(width: 2),
),
),
),

View File

@@ -16,9 +16,7 @@ class StepperExampleApp extends StatelessWidget {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Stepper Sample')),
body: const Center(
child: StepperExample(),
),
body: const Center(child: StepperExample()),
),
);
}
@@ -65,10 +63,7 @@ class _StepperExampleState extends State<StepperExample> {
child: const Text('Content for Step 1'),
),
),
const Step(
title: Text('Step 2 title'),
content: Text('Content for Step 2'),
),
const Step(title: Text('Step 2 title'), content: Text('Content for Step 2')),
],
);
}

View File

@@ -31,32 +31,14 @@ class ControlsBuilderExample extends StatelessWidget {
controlsBuilder: (BuildContext context, ControlsDetails details) {
return Row(
children: <Widget>[
TextButton(
onPressed: details.onStepContinue,
child: const Text('NEXT'),
),
TextButton(
onPressed: details.onStepCancel,
child: const Text('CANCEL'),
),
TextButton(onPressed: details.onStepContinue, child: const Text('NEXT')),
TextButton(onPressed: details.onStepCancel, child: const Text('CANCEL')),
],
);
},
steps: const <Step>[
Step(
title: Text('A'),
content: SizedBox(
width: 100.0,
height: 100.0,
),
),
Step(
title: Text('B'),
content: SizedBox(
width: 100.0,
height: 100.0,
),
),
Step(title: Text('A'), content: SizedBox(width: 100.0, height: 100.0)),
Step(title: Text('B'), content: SizedBox(width: 100.0, height: 100.0)),
],
);
}