web_hyperlink 1.0.0
web_hyperlink: ^1.0.0 copied to clipboard
A lightweight Flutter Web widget for rendering clickable HTML hyperlinks.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:web_hyperlink/web_hyperlink.dart';
void main() {
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Web Hyperlink Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),
useMaterial3: true,
),
home: const ExamplePage(),
);
}
}
class ExamplePage extends StatelessWidget {
const ExamplePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Web Hyperlink Example'),
),
body: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
WebHyperlink(
showPreview: true,
text: 'Flutter',
url: 'https://flutter.com',
tooltip: 'Open Flutter official website',
underline: true,
color: Colors.blue,
fontSize: 16,
fontWeight: FontWeight.bold,
fontFamily: 'Poppins, sans-serif',
)
],
),
),
);
}
}