dart format per request

jwill_m3_demo
James Williams 2 months ago
parent 2332cd1d9d
commit 2509a64c27

@ -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<ColorBox> {
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

@ -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),
],
),
),

@ -25,10 +25,8 @@ class SchemePreview extends StatefulWidget {
}
class _SchemePreviewState extends State<SchemePreview> {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final fonts = theme.textTheme;
final colors = theme.colorScheme;

Loading…
Cancel
Save