mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 19:14:42 +08:00
22
lib/common/widgets/flutter/text_intro/text.dart
Normal file
22
lib/common/widgets/flutter/text_intro/text.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:PiliPlus/common/widgets/flutter/text_intro/selectable_text.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:flutter/material.dart' hide SelectableText;
|
||||
|
||||
Widget selectableRichText(
|
||||
TextSpan textSpan, {
|
||||
TextStyle? style,
|
||||
}) {
|
||||
if (PlatformUtils.isDesktop) {
|
||||
return SelectionArea(
|
||||
child: Text.rich(
|
||||
style: style,
|
||||
textSpan,
|
||||
),
|
||||
);
|
||||
}
|
||||
return SelectableText.rich(
|
||||
style: style,
|
||||
textSpan,
|
||||
scrollPhysics: const NeverScrollableScrollPhysics(),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user