Add link
This commit is contained in:
parent
0d412f2a5a
commit
a3b25c3ee1
2 changed files with 21 additions and 5 deletions
|
@ -2,16 +2,17 @@ import 'package:flutter/material.dart';
|
|||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class Link extends StatelessWidget {
|
||||
const Link({Key? key, required this.uri}) : super(key: key);
|
||||
const Link({Key? key, required this.uri, this.label}) : super(key: key);
|
||||
|
||||
final String uri;
|
||||
final String? label;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MouseRegion(
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
child: Text(uri,
|
||||
child: Text(label ?? uri,
|
||||
style: const TextStyle(decoration: TextDecoration.underline)),
|
||||
onTap: () {
|
||||
launch(uri);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue