mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
39 lines
616 B
Dart
39 lines
616 B
Dart
import 'package:PiliPlus/utils/utils.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
Widget selectableText(
|
|
String text, {
|
|
TextStyle? style,
|
|
}) {
|
|
if (Utils.isDesktop) {
|
|
return SelectionArea(
|
|
child: Text(
|
|
style: style,
|
|
text,
|
|
),
|
|
);
|
|
}
|
|
return SelectableText(
|
|
style: style,
|
|
text,
|
|
);
|
|
}
|
|
|
|
Widget selectableRichText(
|
|
TextSpan textSpan, {
|
|
TextStyle? style,
|
|
}) {
|
|
if (Utils.isDesktop) {
|
|
return SelectionArea(
|
|
child: Text.rich(
|
|
style: style,
|
|
textSpan,
|
|
),
|
|
);
|
|
}
|
|
return SelectableText.rich(
|
|
style: style,
|
|
textSpan,
|
|
);
|
|
}
|