searchable_text 0.0.4 copy "searchable_text: ^0.0.4" to clipboard
searchable_text: ^0.0.4 copied to clipboard

A Flutter package that provides a widget for displaying text with highlighted search terms, enabling easy customization and highlighting within the text.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:searchable_text/text.dart';

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

  @override
  Widget build(BuildContext context) {

    var searchQuery = "";
    List<Models> results = [];

    return Scaffold(
      appBar: AppBar(title: const Text('Searchable Text Example')),
      body: ListView.builder(
        itemBuilder: (BuildContext context, int index) {
          var item = results[index];
          return ListTile(
            title: SearchableText(
              item.name,
              style: TextStyle(
                color: Themes.textColor,
                fontSize: 11.sp,
                fontFamily: 'nexaRegular',
              ),
              searchTerm: searchQuery.value,
            ),
          );
        },
        itemCount: results.length,
      ),
    );
  }
}
4
likes
150
pub points
57%
popularity

Publisher

verified publishermicroprogramers.org

A Flutter package that provides a widget for displaying text with highlighted search terms, enabling easy customization and highlighting within the text.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on searchable_text