flutter_html_search_highlight 1.0.0 copy "flutter_html_search_highlight: ^1.0.0" to clipboard
flutter_html_search_highlight: ^1.0.0 copied to clipboard

Search HTML content, wrap matches in <mark>, and page through results using flutter_html—with keyword normalization and scroll-to-match helpers.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_html_search_highlight/flutter_html_search_highlight.dart';

void main() {
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'HTML search highlight',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
        useMaterial3: true,
      ),
      home: const DemoScreen(),
    );
  }
}

class DemoScreen extends StatelessWidget {
  const DemoScreen({super.key});

  static const _pages = [
    '<h1>Chapter 1</h1><p>This week\'s topic is <strong>Flutter</strong> '
        'and rendering HTML.</p>',
    '<h1>Chapter 2</h1><p>We still discuss Flutter and search highlights.</p>',
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('flutter_html_search_highlight')),
      body: const Padding(
        padding: EdgeInsets.all(8),
        child: HtmlPagedSearchReader(htmlPages: _pages),
      ),
    );
  }
}
5
likes
0
points
296
downloads

Publisher

unverified uploader

Weekly Downloads

Search HTML content, wrap matches in <mark>, and page through results using flutter_html—with keyword normalization and scroll-to-match helpers.

Repository (GitHub)
View/report issues

Topics

#html #search #widget

License

unknown (license)

Dependencies

flutter, flutter_html, html

More

Packages that depend on flutter_html_search_highlight