single_word_clickable_text 1.0.6 copy "single_word_clickable_text: ^1.0.6" to clipboard
single_word_clickable_text: ^1.0.6 copied to clipboard

A Flutter package that provides a customizable widget for displaying text where each word is individually clickable. Ideal for applications that require interactive text, such as chat applications or [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:single_word_clickable_text/single_word_clickable_text.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Single Word Clickable Text Demo',
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.deepPurpleAccent,
          title: Text('Single Word Clickable Text Demo'),
        ),
        body: Center(
          child: SingleWordClickableText(
            text: 'Click a word to show a toast with a work click.',
            onWordPressed: (word) {
              Fluttertoast.showToast(
                  msg: word,
                  toastLength: Toast.LENGTH_SHORT,
                  gravity: ToastGravity.BOTTOM,
                  timeInSecForIosWeb: 1,
                  textColor: Colors.white,
                  fontSize: 16.0
              );
            },
            textStyle: TextStyle(fontSize: 18, color: Colors.blue),
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
54
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides a customizable widget for displaying text where each word is individually clickable. Ideal for applications that require interactive text, such as chat applications or tutorials. Supports customizing text style, alignment, and handling click events on each word.

Repository (GitHub)

License

MIT (license)

Dependencies

flutter

More

Packages that depend on single_word_clickable_text