Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ainusdev/flutter_selectext

Open more actions menu
 
 

Repository files navigation

flutter_selectext

Selectable text widget and able to set custom selection control.

image

Getting Started

Add dependencies

on pubspec.yaml

dependencies:
  flutter_selectext: ^0.1.1

Import library

import 'package:flutter_selectext/flutter_selectext.dart';

Usage

SelectableText

  • use string

     SelectableText('your string');
    
  • use textspan

     SelectableText.rich(textspan);
    

    SelectableText default only can copy.

    you can custom controls and could refer to MarkText widget.

MarkText

  • use string

      List<TextSelection> markList = List();
    
      void handlerMark(TextSelection selection) {
        setState(() {
          markList.add(selection);
        });
      }
    
      MarkText('your string',
        handlerMark: handlerMark,
        markColor: Colors.deepOrange,
        markList: markList);
    
  • use textspan

      List<TextSelection> markList = List();
    
      void handlerMark(TextSelection selection) {
        setState(() {
          markList.add(selection);
        });
      }
    
      MarkText(textspan,
        handlerMark: handlerMark,
        markColor: Colors.deepOrange,
        markList: markList);
    

About

Flutter selectable text widget.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.