Added a regex in input to avoid manipulation of the api link

This commit is contained in:
2025-05-16 00:10:07 +02:00
parent 84583de46e
commit 76c6dd2ddd

View File

@@ -12,7 +12,8 @@ class _HomeScreenState extends State<HomeScreen> {
final TextEditingController _controller = TextEditingController();
void _handleInput(BuildContext context, String input) {
// Replace with your desired logic
final regex = RegExp(r'^[a-zA-Z\-]+$');
if (input.isEmpty || regex.hasMatch(input) == false) { return; }
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Checking profile of: $input')),
);