feat: add browser extension link (#433)

This commit is contained in:
Levi authored and GitHub committed 2024-03-30 09:12:24 +08:00
1 parent 56ef25065e
commit 207c287c97
10 files changed
+157 -95

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
class OpenInNew extends StatelessWidget {
final String text;
final String url;
const OpenInNew({super.key, required this.text, required this.url});
@override
Widget build(BuildContext context) {
return Stack(
children: [
ElevatedButton(
onPressed: () {
launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);
},
style: ElevatedButton.styleFrom(
backgroundColor: Get.theme.colorScheme.background,
),
child: Row(
mainAxisSize: MainAxisSize
.min, // Set the row's size to be as small as possible
children: <Widget>[
Text(text),
const SizedBox(
width: 4), // Add some space between the text and the icon
const Icon(
Icons.open_in_new,
size: 14,
), // The icon is after the text
],
),
)
],
);
}
}