From 2509a64c271b58e27e30cb16b169689e793aba77 Mon Sep 17 00:00:00 2001 From: James Williams <66931+jwill@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:39:14 -0400 Subject: [PATCH] dart format per request --- material_3_demo/lib/color_box.dart | 21 +++++++-------- .../lib/color_palettes_screen.dart | 26 ++++++++++++++----- material_3_demo/lib/scheme.dart | 2 -- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/material_3_demo/lib/color_box.dart b/material_3_demo/lib/color_box.dart index 6fd24ea43..f198ff0df 100644 --- a/material_3_demo/lib/color_box.dart +++ b/material_3_demo/lib/color_box.dart @@ -2,16 +2,15 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; class ColorBox extends StatefulWidget { - const ColorBox({ - super.key, - required this.label, - required this.tone, - required this.color, - required this.onColor, - required this.height, - required this.width, - this.displayPaletteInfo = false - }); + const ColorBox( + {super.key, + required this.label, + required this.tone, + required this.color, + required this.onColor, + required this.height, + required this.width, + this.displayPaletteInfo = false}); final String label; final String tone; @@ -62,7 +61,7 @@ class _ColorBoxState extends State { padding: EdgeInsets.zero, color: widget.onColor, tooltip: 'Copy hex color', - icon: const Icon(Icons.copy, size:24), + icon: const Icon(Icons.copy, size: 24), onPressed: () async { final messenger = ScaffoldMessenger.of(context); // Copy color as hex to clipboard diff --git a/material_3_demo/lib/color_palettes_screen.dart b/material_3_demo/lib/color_palettes_screen.dart index 2deac64b0..a2d9c8563 100644 --- a/material_3_demo/lib/color_palettes_screen.dart +++ b/material_3_demo/lib/color_palettes_screen.dart @@ -96,17 +96,31 @@ class ColorPalettesScreen extends StatelessWidget { ); } else { var seed = Theme.of(context).colorScheme.primary; - var lightScheme = ColorScheme.fromSeed(seedColor: seed, brightness: Brightness.light); - var darkScheme = ColorScheme.fromSeed(seedColor: seed, brightness: Brightness.dark); + var lightScheme = ColorScheme.fromSeed( + seedColor: seed, brightness: Brightness.light); + var darkScheme = ColorScheme.fromSeed( + seedColor: seed, brightness: Brightness.dark); return SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(8), child: Column( children: [ - SchemePreview(label:"Light ColorScheme", scheme: lightScheme, brightness: Brightness.light, contrast: 1.0, colorMatch: false,), - const SizedBox(height:16), - SchemePreview(label:"Dark ColorScheme", scheme: darkScheme, brightness: Brightness.dark, contrast: 1.0, colorMatch: false,), - const SizedBox(height:16), + SchemePreview( + label: "Light ColorScheme", + scheme: lightScheme, + brightness: Brightness.light, + contrast: 1.0, + colorMatch: false, + ), + const SizedBox(height: 16), + SchemePreview( + label: "Dark ColorScheme", + scheme: darkScheme, + brightness: Brightness.dark, + contrast: 1.0, + colorMatch: false, + ), + const SizedBox(height: 16), ], ), ), diff --git a/material_3_demo/lib/scheme.dart b/material_3_demo/lib/scheme.dart index b80ebe673..7c0a3b49d 100644 --- a/material_3_demo/lib/scheme.dart +++ b/material_3_demo/lib/scheme.dart @@ -25,10 +25,8 @@ class SchemePreview extends StatefulWidget { } class _SchemePreviewState extends State { - @override Widget build(BuildContext context) { - final theme = Theme.of(context); final fonts = theme.textTheme; final colors = theme.colorScheme;