added excel sheet link
This commit is contained in:
25
lib/widgets/linkButton.dart
Normal file
25
lib/widgets/linkButton.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
import "package:flutter/material.dart";
|
||||
import "package:url_launcher/url_launcher.dart";
|
||||
|
||||
class LinkButton extends StatelessWidget {
|
||||
final Uri link;
|
||||
final String iconImage;
|
||||
final double height;
|
||||
const LinkButton(
|
||||
{Key? key, required this.link, required this.iconImage, this.height = 30})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: InkWell(
|
||||
child: Image(image: AssetImage(iconImage), height: height),
|
||||
onTap: () async {
|
||||
if (await canLaunchUrl(link)) {
|
||||
launchUrl(link);
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user