refactored broad range of the application, split files, modularized calendar and file views, centralized bottom sheets and clipboard handling, and implemented unit test coverage
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
/// Copies [text] to the system clipboard and shows a SnackBar confirmation.
|
||||
/// Safe to await: respects context lifecycle via the provided [context].
|
||||
Future<void> copyToClipboard(
|
||||
BuildContext context,
|
||||
String text, {
|
||||
String successMessage = 'In Zwischenablage kopiert',
|
||||
}) async {
|
||||
await Clipboard.setData(ClipboardData(text: text));
|
||||
if (!context.mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(successMessage),
|
||||
duration: const Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user