mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
23 lines
540 B
Dart
23 lines
540 B
Dart
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(),
|
|
);
|
|
}
|