undo tests

This commit is contained in:
Henry Hiles 2026-07-17 01:31:18 -04:00
commit accb2fc3ea
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
4 changed files with 7 additions and 40 deletions

View file

@ -1,7 +1,7 @@
import "package:flutter/material.dart";
extension SchemeToTheme on ColorScheme {
ThemeData getTheme(bool useSystemFont) => .from(colorScheme: this).copyWith(
ThemeData get theme => .from(colorScheme: this).copyWith(
cardTheme: .new(color: primaryContainer),
popupMenuTheme: .new(
shape: RoundedRectangleBorder(borderRadius: .circular(16)),
@ -11,12 +11,10 @@ extension SchemeToTheme on ColorScheme {
titleSpacing: 0,
backgroundColor: surfaceContainerLow,
),
textTheme: useSystemFont
? ThemeData(
fontFamilyFallback: ["sans", "emoji", "fallback-emoji"],
textTheme: ThemeData(
fontFamilyFallback: ["sans", "emoji"],
brightness: brightness,
).textTheme
: null,
).textTheme,
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),
),

View file

@ -105,14 +105,7 @@ class App extends StatelessWidget {
settings.useDynamicTheming ? lightDynamic : null,
) ??
ColorScheme.fromSeed(seedColor: Colors.indigo))
.getTheme(
ref
.watch(SettingsController.provider)
.maybeWhen(
orElse: () => true,
data: (settings) => settings.useSystemFont,
),
),
.theme,
darkTheme:
(ref
.watch(SettingsController.provider)
@ -125,14 +118,7 @@ class App extends StatelessWidget {
seedColor: Colors.indigo,
brightness: Brightness.dark,
))
.getTheme(
ref
.watch(SettingsController.provider)
.maybeWhen(
orElse: () => true,
data: (settings) => settings.useSystemFont,
),
),
.theme,
themeMode: ref
.watch(SettingsController.provider)
.maybeWhen(

View file

@ -8,7 +8,6 @@ abstract class Settings with _$Settings {
const factory Settings({
@Default(ThemeMode.system) ThemeMode theme,
@Default(true) bool useDynamicTheming,
@Default(true) bool useSystemFont,
}) = _Settings;
factory Settings.fromJson(Map<String, Object?> json) =>

View file

@ -75,22 +75,6 @@ class SettingsPage extends ConsumerWidget {
: null,
),
),
Setting(
title: "Use System Font",
icon: Icons.abc,
description:
"Use the system's sans and emoji fonts, instead of Flutter's bundled fonts. Turn this off if you are having issues rendering emoji.",
builder: (title, description, icon) => SwitchListTile(
title: Text(title),
subtitle: Text(description),
secondary: Icon(icon),
value: settings.useSystemFont,
onChanged: (value) => ref
.watch(SettingsController.provider.notifier)
.set(settings.copyWith(useSystemFont: value))
.onError(showError),
),
),
]),
),
]),