mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-21 19:28:27 +08:00
@@ -1,5 +1,3 @@
|
||||
import 'package:html/parser.dart' show parse;
|
||||
|
||||
abstract class Em {
|
||||
static final _exp = RegExp('<[^>]*>([^<]*)</[^>]*>');
|
||||
|
||||
@@ -19,7 +17,13 @@ abstract class Em {
|
||||
},
|
||||
onNonMatch: (String str) {
|
||||
if (str != '') {
|
||||
str = decodeHtmlEntities(str);
|
||||
str = str
|
||||
.replaceAll('<', '<')
|
||||
.replaceAll('>', '>')
|
||||
.replaceAll('"', '"')
|
||||
.replaceAll(''', "'")
|
||||
.replaceAll(' ', " ")
|
||||
.replaceAll('&', "&");
|
||||
res.add((isEm: false, text: str));
|
||||
}
|
||||
return '';
|
||||
@@ -27,8 +31,4 @@ abstract class Em {
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
static String decodeHtmlEntities(String title) {
|
||||
return parse(title).body?.text ?? title;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,25 +654,29 @@ abstract class PageUtils {
|
||||
barrierLabel: '',
|
||||
barrierDismissible: true,
|
||||
pageBuilder: (buildContext, animation, secondaryAnimation) {
|
||||
return Get.context!.isPortrait
|
||||
? SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(flex: 3),
|
||||
Expanded(flex: 7, child: child),
|
||||
if (isFullScreen() && padding != null)
|
||||
SizedBox(height: padding),
|
||||
],
|
||||
),
|
||||
)
|
||||
: SafeArea(
|
||||
child: Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Expanded(child: child),
|
||||
],
|
||||
),
|
||||
);
|
||||
if (Get.context!.isPortrait) {
|
||||
return SafeArea(
|
||||
child: FractionallySizedBox(
|
||||
heightFactor: 0.7,
|
||||
widthFactor: 1.0,
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: isFullScreen() && padding != null
|
||||
? Padding(
|
||||
padding: EdgeInsets.only(bottom: padding),
|
||||
child: child,
|
||||
)
|
||||
: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
return SafeArea(
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 0.5,
|
||||
heightFactor: 1.0,
|
||||
alignment: Alignment.centerRight,
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
},
|
||||
transitionDuration: const Duration(milliseconds: 350),
|
||||
transitionBuilder: (context, animation, secondaryAnimation, child) {
|
||||
|
||||
Reference in New Issue
Block a user