text_selection_intent 0.0.1 copy "text_selection_intent: ^0.0.1" to clipboard
text_selection_intent: ^0.0.1 copied to clipboard

PlatformAndroid

A Flutter plugin that allows your Android app to appear in the system text selection menu.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: TextSelectionExample());
  }
}

class TextSelectionExample extends StatefulWidget {
  const TextSelectionExample({super.key});

  @override
  State<TextSelectionExample> createState() => _TextSelectionExampleState();
}

class _TextSelectionExampleState extends State<TextSelectionExample> {
  String selectedText = 'No text selected';

  @override
  void initState() {
    super.initState();

    TextSelectionIntent.listen((text) {
      setState(() {
        selectedText = text;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: SelectableText('Text Selection Intent')),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: Text(selectedText, style: const TextStyle(fontSize: 16)),
      ),
    );
  }
}
0
likes
160
points
46
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that allows your Android app to appear in the system text selection menu.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on text_selection_intent

Packages that implement text_selection_intent