ChatApp/lib/tools/home/NormalTextOnly.dart
2024-07-05 10:00:00 +08:00

19 lines
411 B
Dart

import 'package:flutter/cupertino.dart';
class NormalTextOnly extends StatelessWidget {
final String text;
NormalTextOnly({super.key, required this.text});
@override
Widget build(BuildContext context) {
return Text(
_extractNormalText(text),
);
}
String _extractNormalText(String text) {
final RegExp regExp = RegExp(r'\*[^*]+\*');
return text.replaceAll(regExp, '');
}
}