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

@@ -15,10 +15,8 @@ class TexturePage extends StatefulWidget {
class _TexturePageState extends State<TexturePage> {
static const int textureWidth = 300;
static const int textureHeight = 300;
static const MethodChannel channel =
MethodChannel('samples.flutter.io/texture');
final Future<int?> textureId =
channel.invokeMethod('create', <int>[textureWidth, textureHeight]);
static const MethodChannel channel = MethodChannel('samples.flutter.io/texture');
final Future<int?> textureId = channel.invokeMethod('create', <int>[textureWidth, textureHeight]);
// Set the color of the texture.
Future<void> setColor(int r, int g, int b) async {
@@ -67,10 +65,7 @@ class _TexturePageState extends State<TexturePage> {
child: const Text('Flutter Sky'),
onPressed: () => setColor(0x02, 0x7d, 0xfd),
),
OutlinedButton(
child: const Text('Red'),
onPressed: () => setColor(0xf2, 0x5d, 0x50),
),
OutlinedButton(child: const Text('Red'), onPressed: () => setColor(0xf2, 0x5d, 0x50)),
OutlinedButton(
child: const Text('Yellow'),
onPressed: () => setColor(0xff, 0xf2, 0x75),
@@ -79,10 +74,7 @@ class _TexturePageState extends State<TexturePage> {
child: const Text('Purple'),
onPressed: () => setColor(0x62, 0x00, 0xee),
),
OutlinedButton(
child: const Text('Green'),
onPressed: () => setColor(0x1c, 0xda, 0xc5),
),
OutlinedButton(child: const Text('Green'), onPressed: () => setColor(0x1c, 0xda, 0xc5)),
],
),
),

View File

@@ -7,8 +7,7 @@ import 'package:texture/main.dart' as texture;
void main() {
testWidgets('Texture smoke test', (WidgetTester tester) async {
texture
.main(); // builds the app and schedules a frame but doesn't trigger one
texture.main(); // builds the app and schedules a frame but doesn't trigger one
await tester.pump(); // triggers a frame
expect(find.text('Flutter Blue'), findsOneWidget);