slight cleanups

This commit is contained in:
Henry Hiles 2026-10-16 10:56:55 -04:00
commit 00f22d46b7
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
11 changed files with 24 additions and 33 deletions

View file

@ -191,8 +191,7 @@ class ClientController extends AsyncNotifier<int> {
}
}
Future<RecoveryKey> generateRecoveryKey({String passphrase = ""}) async =>
.fromJson(
Future<RecoveryKey> generateRecoveryKey(String passphrase) async => .fromJson(
await _sendCommand("generate_recovery_key", {"passphrase": passphrase}),
);

View file

@ -67,7 +67,7 @@ final class ChatScroll({
await Scrollable.ensureVisible(
context!,
alignment: 0.5,
duration: const .new(milliseconds: 700),
duration: Durations.extralong1,
curve: Curves.easeInOut,
);
}
@ -179,7 +179,7 @@ final class ChatScroll({
await Scrollable.ensureVisible(
context,
alignment: 0.5,
duration: const .new(milliseconds: 700),
duration: Durations.extralong1,
curve: Curves.easeInOut,
);
return;
@ -203,7 +203,7 @@ final class ChatScroll({
await scrollController.animateTo(
scrollController.position.minScrollExtent,
duration: const .new(milliseconds: 700),
duration: Durations.extralong1,
curve: Curves.easeInOut,
);
},

View file

@ -13,7 +13,7 @@ final class const HighlightWrapper(
color: isHighlighted
? Theme.of(context).colorScheme.onSurface.withAlpha(50)
: Colors.transparent,
duration: .new(milliseconds: 250),
duration: Durations.medium1,
child: Material(color: Colors.transparent, child: child),
),
);

View file

@ -9,7 +9,7 @@ class const SpoilerText(final String text, {super.key}) extends HookWidget {
return InkWell(
onTap: () => revealed.value = !revealed.value,
child: AnimatedContainer(
duration: const .new(milliseconds: 100),
duration: Durations.short2,
padding: const .symmetric(horizontal: 4, vertical: 2),
decoration: BoxDecoration(
color: revealed.value ? Colors.transparent : Colors.blueGrey,

View file

@ -98,10 +98,10 @@ class const NotificationsList({super.key})
index: index,
scrollController: scrollController,
alignment: 0.5,
duration: (_) => .new(milliseconds: 700),
duration: (_) => Durations.extralong1,
curve: (_) => Curves.easeInOut,
);
timer = Timer(.new(seconds: 1), () {
timer = Timer(Durations.extralong4, () {
highlightedId.value = null;
});
});

View file

@ -81,11 +81,11 @@ class const SettingsPage({super.key}) extends ConsumerWidget {
index: match.$1.$2,
scrollController: scrollController,
alignment: 0.5,
duration: (_) => .new(milliseconds: 700),
duration: (_) => Durations.extralong1,
curve: (_) => Curves.easeInOut,
);
highlightedMatch.value = match.$1;
await Future.delayed(.new(seconds: 1), () {
await Future.delayed(Durations.extralong4, () {
if (highlightedMatch.value == match.$1) {
highlightedMatch.value = null;
}

View file

@ -31,10 +31,10 @@ class const SettingsCategoryPage(
index: initialHighlight!,
scrollController: scrollController,
alignment: 0.5,
duration: (_) => .new(milliseconds: 700),
duration: (_) => Durations.extralong1,
curve: (_) => Curves.easeInOut,
);
timer = Timer(.new(seconds: 1), () {
timer = Timer(Durations.extralong4, () {
highlight.value = null;
});
listController.value.removeListener(listener);

View file

@ -53,7 +53,7 @@ class const ResetEncryptionSheet({
final recoveryKey = await ref
.read(ClientController.provider.notifier)
.generateRecoveryKey(
passphrase: usePassphrase.value ? passphrase : "",
usePassphrase.value ? passphrase : "",
);
if (!context.mounted) return;

View file

@ -143,7 +143,7 @@ final class const RoomChat({
highlightedEvent.value = rowId;
await scroll.jumpToEvent(rowId);
await Future.delayed(.new(milliseconds: 700), () {
await Future.delayed(Durations.extralong1, () {
if (highlightedEvent.value == rowId) {
highlightedEvent.value = null;
}
@ -240,7 +240,7 @@ final class const RoomChat({
ignoring: scroll.atBottom,
child: AnimatedOpacity(
opacity: scroll.atBottom ? 0 : 1,
duration: const Duration(milliseconds: 200),
duration: Durations.short4,
child: FloatingActionButton.small(
onPressed: scroll.jumpToBottom,
child: const Icon(Icons.keyboard_arrow_down),

View file

@ -42,7 +42,7 @@ class const SyncStatusBanner({super.key}) extends ConsumerWidget {
];
return AnimatedSize(
duration: const .new(milliseconds: 200),
duration: Durations.short4,
alignment: .topCenter,
child: banner == null
? const SizedBox(width: double.infinity)

View file

@ -233,13 +233,9 @@ final class const UserBottomSheet(
shape: .square,
icon: Icon(Icons.sports_martial_arts),
label: Text("Kick"),
decoration: .new(
backgroundColor: WidgetStatePropertyAll(
theme.colorScheme.error,
),
foregroundColor: WidgetStatePropertyAll(
theme.colorScheme.onError,
),
decoration: .styleFrom(
backgroundColor: theme.colorScheme.error,
foregroundColor: theme.colorScheme.onError,
),
),
@ -248,13 +244,9 @@ final class const UserBottomSheet(
shape: .square,
icon: Icon(Icons.gavel),
label: Text("Ban"),
decoration: .new(
backgroundColor: WidgetStatePropertyAll(
theme.colorScheme.errorContainer,
),
foregroundColor: WidgetStatePropertyAll(
theme.colorScheme.onErrorContainer,
),
decoration: .styleFrom(
backgroundColor: theme.colorScheme.errorContainer,
foregroundColor: theme.colorScheme.onErrorContainer,
),
),
].map((e) => Expanded(child: e)).toList(),