removed theme deprecations

This commit is contained in:
Vadim 2025-01-06 15:20:18 +01:00
parent 5753e261f6
commit f784af927a
7 changed files with 12 additions and 17 deletions

View file

@ -33,7 +33,7 @@ ThemeData themeFrom(Color primaryColor, Brightness brightness) {
elevation: Dimens.elevationLevel0,
scrolledUnderElevation: Dimens.elevationLevel2,
color: scheme.surface,
foregroundColor: scheme.onBackground,
foregroundColor: scheme.onSurface,
surfaceTintColor: scheme.surfaceTint,
),
cardTheme: CardTheme(
@ -83,8 +83,6 @@ ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) {
return ColorScheme(
brightness: brightness,
background: Color(scheme.background),
onBackground: Color(scheme.onBackground),
error: Color(scheme.error),
onError: Color(scheme.onError),
errorContainer: Color(scheme.errorContainer),
@ -103,7 +101,7 @@ ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) {
onTertiaryContainer: Color(scheme.onTertiaryContainer),
surface: Color(scheme.surface),
onSurface: Color(scheme.onSurface),
surfaceVariant: Color(scheme.surfaceVariant),
surfaceContainerHighest: Color(scheme.surfaceContainerHighest),
onSurfaceVariant: Color(scheme.onSurfaceVariant),
outline: Color(scheme.outline),
outlineVariant: Color(scheme.outlineVariant),

View file

@ -25,7 +25,7 @@ class CameraControlsPlaceholder extends StatelessWidget {
const SizedBox(height: Dimens.grid8),
Text(
error.toStringLocalized(context),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Theme.of(context).colorScheme.onBackground),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Theme.of(context).colorScheme.onSurface),
textAlign: TextAlign.center,
),
],

View file

@ -62,14 +62,14 @@ class _Title<T extends PhotographyStopValue> extends StatelessWidget {
value.toString(),
stepGranularity: 0.5,
minFontSize: 10,
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onSurface),
softWrap: false,
overflow: TextOverflow.fade,
maxLines: 1,
)
: Text(
value.toString(),
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground),
style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onSurface),
softWrap: false,
overflow: TextOverflow.fade,
maxLines: 1,
@ -97,7 +97,7 @@ class _Tick extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ColoredBox(
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
child: SizedBox(
height: 1,
width: _length,

View file

@ -78,7 +78,7 @@ class ExposurePairsList extends StatelessWidget {
? constraints.maxHeight / 2
: constraints.maxHeight,
child: ColoredBox(
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
child: const SizedBox(width: 1),
),
),

View file

@ -120,7 +120,7 @@ class _Slider extends StatelessWidget {
width: handleDistance + trackThickness,
child: ClipRRect(
borderRadius: BorderRadius.circular(trackThickness / 2),
child: ColoredBox(color: Theme.of(context).colorScheme.surfaceVariant),
child: ColoredBox(color: Theme.of(context).colorScheme.surfaceContainerHighest),
),
),
AnimatedPositioned.fromRect(

View file

@ -20,15 +20,12 @@ class IconPlaceholder extends StatelessWidget {
children: [
Icon(
icon,
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
),
const SizedBox(height: Dimens.grid8),
Text(
text,
style: Theme.of(context)
.textTheme
.bodyMedium
?.copyWith(color: Theme.of(context).colorScheme.onBackground),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Theme.of(context).colorScheme.onSurface),
textAlign: TextAlign.center,
),
],

View file

@ -30,7 +30,7 @@ class RulerSlider extends StatelessWidget {
children: [
Text(
valueAdapter(value),
style: Theme.of(context).textTheme.labelLarge!.copyWith(color: Theme.of(context).colorScheme.onBackground),
style: Theme.of(context).textTheme.labelLarge!.copyWith(color: Theme.of(context).colorScheme.onSurface),
),
const SizedBox(height: Dimens.grid4),
Expanded(
@ -78,7 +78,7 @@ class _Ruler extends StatelessWidget {
@override
Widget build(BuildContext context) {
final mainTicksFontSize = Theme.of(context).textTheme.bodySmall!.fontSize!;
final itemsColor = Theme.of(context).colorScheme.onBackground;
final itemsColor = Theme.of(context).colorScheme.onSurface;
return LayoutBuilder(
builder: (context, constraints) {
final bool showAllMainTicks =