shufle order

This commit is contained in:
gitea
2026-01-31 00:32:48 +01:00
parent 2ea573642d
commit 7ab2eb2ba4
15 changed files with 427 additions and 161 deletions
+45
View File
@@ -0,0 +1,45 @@
import 'package:flutter/material.dart';
/// Shows a snackbar-style message at the top of the screen (for success/neutral feedback).
void showTopSnackBar(
BuildContext context, {
required String message,
Color? backgroundColor,
Duration duration = const Duration(seconds: 2),
}) {
final overlay = Overlay.of(context);
final theme = Theme.of(context);
final color = backgroundColor ?? theme.colorScheme.surfaceContainerHighest;
final textColor = backgroundColor != null ? Colors.white : theme.colorScheme.onSurface;
late OverlayEntry entry;
entry = OverlayEntry(
builder: (context) => Positioned(
top: 0,
left: 0,
right: 0,
child: SafeArea(
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
child: Material(
color: color,
elevation: 4,
borderRadius: BorderRadius.circular(8),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Text(
message,
style: theme.textTheme.bodyLarge?.copyWith(color: textColor),
),
),
),
),
),
),
);
overlay.insert(entry);
Future.delayed(duration, () {
entry.remove();
});
}