flutter_selectext 0.1.1
flutter_selectext: ^0.1.1 copied to clipboard
Selectable text widget and able to set custom selection control.
flutter_selectext #
Selectable text widget and able to set custom selection control.
Getting Started #
Add dependencies #
on pubspec.yaml
dependencies:
flutter_selectext: ^0.1.1
copied to clipboard
Import library #
import 'package:flutter_selectext/flutter_selectext.dart';
copied to clipboard
Usage #
SelectableText
-
use
string
SelectableText('your string');
copied to clipboard -
use
textspan
SelectableText.rich(textspan);
copied to clipboardSelectableText
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);
copied to clipboard -
use
textspan
List<TextSelection> markList = List(); void handlerMark(TextSelection selection) { setState(() { markList.add(selection); }); } MarkText(textspan, handlerMark: handlerMark, markColor: Colors.deepOrange, markList: markList);
copied to clipboard