mirror of
https://github.com/seemoo-lab/openhaystack.git
synced 2026-08-23 21:46:15 +00:00
Adding OpenHaystack Mobile app
Co-Authored-By: Lukas Burg <lukas.burg@hemalu.de>
This commit is contained in:
committed by
Alexander Heinrich
co-authored by
Lukas Burg
parent
b65a6e6be0
commit
3d593a006c
@@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class Hyperlink extends StatelessWidget {
|
||||
/// The target url to open.
|
||||
String target;
|
||||
/// The display text of the hyperlink. Default is [target].
|
||||
String _text;
|
||||
|
||||
/// Displays a hyperlink that can be opened by a tap.
|
||||
Hyperlink({
|
||||
Key? key,
|
||||
required this.target,
|
||||
text,
|
||||
}) : _text = text ?? target, super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
child: Text(_text,
|
||||
style: const TextStyle(
|
||||
color: Colors.blue,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
launch(target);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user