dynamic_text_highlighting 2.2.0 copy "dynamic_text_highlighting: ^2.2.0" to clipboard
dynamic_text_highlighting: ^2.2.0 copied to clipboard

Dynamic Text Highlighting (DTH) is a Flutter package written in pure Dart, ideal for highlighting search results.

example/main.dart

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

void main() {
  runApp(DTHExampleApp());
}

class DTHExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        visualDensity: VisualDensity.adaptivePlatformDensity,
        primarySwatch: Colors.blue,
      ),
      home: DTHExample(),
    );
  }
}

class DTHExample extends StatefulWidget {
  DTHExample({Key key}) : super(key: key);

  @override
  _DTHExampleState createState() => _DTHExampleState();
}

class _DTHExampleState extends State<DTHExample> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: DynamicTextHighlighting(
          text: 'This is a demo text, the specified texts will be highlighted.',
          highlights: const ['this', 'demo', 'will'],
          color: Colors.yellow,
          style: TextStyle(
            fontSize: 18.0,
            color: Colors.black,
          ),
          caseSensitive: false,
        ),
      ),
    );
  }
}
54
likes
40
pub points
68%
popularity

Publisher

unverified uploader

Dynamic Text Highlighting (DTH) is a Flutter package written in pure Dart, ideal for highlighting search results.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on dynamic_text_highlighting