Is there a way to take input in multiple text styles in a textfield in Flutter like this?
Where the user can select a part of the text and edit its style like he wants
CodePudding user response:
You can try use RichText
RichText(
text: TextSpan(
text: 'Hello ',
style: DefaultTextStyle.of(context).style,
children: const <TextSpan>[
TextSpan(text: 'bold', style: TextStyle(fontWeight: FontWeight.bold)),
TextSpan(text: ' world!'),
],
),
)
Source: Source on api.flutter.dev
CodePudding user response:
You can use this https://pub.dev/packages/flutter_social_textfield. You can add different styles too.