custom_selectable_text 0.1.2 copy "custom_selectable_text: ^0.1.2" to clipboard
custom_selectable_text: ^0.1.2 copied to clipboard

outdated

A widget like selectable text but with additional customs like share. It can do Copy, select all, cut and paste as well.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: CustomSelectableText(
          "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...",
          textAlign: TextAlign.center,
          items: [
            CustomSelectableTextItem(controlType: SelectionControlType.copy),
            CustomSelectableTextItem(
                controlType: SelectionControlType.selectAll),
            CustomSelectableTextItem(
                label: "Share",
                controlType: SelectionControlType.other,
                onPressed: (text) {
                  ScaffoldMessenger.of(context).showSnackBar(SnackBar(
                    content: Text("$text is successfully shared"),
                  ));
                }),
          ],
        ),
      ),
    );
  }
}
12
likes
0
points
99
downloads

Publisher

unverified uploader

Weekly Downloads

A widget like selectable text but with additional customs like share. It can do Copy, select all, cut and paste as well.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on custom_selectable_text