highlightable 1.0.3 copy "highlightable: ^1.0.3" to clipboard
highlightable: ^1.0.3 copied to clipboard

outdated

A text widget that makes it easy to highlight any letter/word you want

example/main.dart

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

void main() => runApp(App());

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) => MaterialApp(home: Home());
}

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Highlightable Examples")),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // Very basic usage:
            HighlightText(
              'Hello World',
              highlightable: 'hello',
              defaultStyle: TextStyle(fontSize: 25, color: Colors.black),
              highlightStyle: TextStyle(
                fontSize: 25,
                color: Colors.blue,
              ),
            ),

            const SizedBox(height: 50),

            // Custom Usage
            HighlightText(
              "Hello, Flutter!",
              highlightable: "Flu, He",
              caseSensitive: true, // Turn on case-sensitive.
              detectWords: true, // Turn on only full word hightlighting.
              defaultStyle: TextStyle(
                fontSize: 25,
                color: Colors.black,
                fontWeight: FontWeight.bold,
              ),
              highlightStyle: TextStyle(
                fontSize: 25,
                letterSpacing: 2.5,
                color: Colors.white,
                backgroundColor: Colors.blue,
                fontWeight: FontWeight.bold,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
14
likes
0
pub points
70%
popularity

Publisher

verified publishertheiskaa.com

A text widget that makes it easy to highlight any letter/word you want

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on highlightable