Open jdeltoft opened 4 years ago
This could be a huge added value to the plugin. If there's anything that can be done to help, let us know.
I would also be interested in this option. It would be great to have a true or false parameter for selectable text.
Any update on this please ?
The selectable text feature is available in auto_size_text ? Please update
This package is awesome, but incompatibility with SelectableText
is definitely missing. +1 for considering adding this feature.
Since Flutter 3.3 you can use SelectionArea
which makes every Text
widget selectable.
Code:
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
darkTheme: ThemeData.dark(),
theme: ThemeData.light(),
home: const MyHomePage(),
debugShowCheckedModeBanner: false,
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Flutter app'),
),
body: const Center(
child: SelectionArea( // Add this widget
child: AutoSizeText(
'The text to display',
style: TextStyle(fontSize: 20),
maxLines: 2,
),
),
),
);
}
}
Demo:
So I think we can close this issue.
@nilsreichardt Yep, SelectableText will be deprecated in near future, so we can close it safely.
Awesome package!! One thing I would like if you could is to make the text selectable in my browser, such as if I use it to show text like an email address that they may want to cut and paste.