mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: pick avatar
This commit is contained in:
@@ -272,6 +272,7 @@ class _CreatePanelState extends State<CreatePanel> {
|
||||
dynamic result = await MsgHttp.uploadBfs(
|
||||
path: _pathList[i],
|
||||
category: 'daily',
|
||||
biz: 'new_dyn',
|
||||
);
|
||||
if (result['status']) {
|
||||
int imageSize = await File(_pathList[i]).length();
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:PiliPalaX/common/widgets/http_error.dart';
|
||||
import 'package:PiliPalaX/http/constants.dart';
|
||||
import 'package:PiliPalaX/http/index.dart';
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
@@ -15,6 +16,7 @@ import 'package:get/get.dart' hide FormData, MultipartFile;
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:mime/mime.dart';
|
||||
|
||||
enum ProfileType { uname, sign, sex, birthday }
|
||||
|
||||
@@ -451,6 +453,12 @@ class _EditProfilePageState extends State<EditProfilePage> {
|
||||
imageQuality: 100,
|
||||
);
|
||||
if (pickedFile != null && mounted) {
|
||||
String? mimeType =
|
||||
lookupMimeType(pickedFile.path)?.split('/').getOrNull(1);
|
||||
if (mimeType == 'gif') {
|
||||
SmartDialog.showToast('不能选GIF');
|
||||
return;
|
||||
}
|
||||
CroppedFile? croppedFile = await ImageCropper().cropImage(
|
||||
sourcePath: pickedFile.path,
|
||||
uiSettings: [
|
||||
|
||||
@@ -169,7 +169,7 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
||||
InlineSpan _buildContent(String content) {
|
||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||
RegExp urlRegExp = RegExp(
|
||||
'#\\{([^}]*)\\}\\{"?([^}]*)"?\\}|https?:\\/\\/[^\\s/\$.?#].[^\\s]*|www\\.[^\\s/\$.?#].[^\\s]*');
|
||||
r'#\{([^}]*)\}\{([^}]*)\}|https?:\/\/[^\s/\$.?#].[^\s]*|www\.[^\s/\$.?#].[^\s]*');
|
||||
content.splitMapJoin(
|
||||
urlRegExp,
|
||||
onMatch: (Match match) {
|
||||
@@ -181,7 +181,7 @@ class _SysMsgPageState extends State<SysMsgPage> {
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
try {
|
||||
Uri uri = Uri.parse(match[2]!);
|
||||
Uri uri = Uri.parse(match[2]!.replaceAll('"', ''));
|
||||
PiliScheme.routePush(uri);
|
||||
} catch (err) {
|
||||
SmartDialog.showToast(err.toString());
|
||||
|
||||
@@ -480,6 +480,7 @@ class _ReplyPageState extends State<ReplyPage>
|
||||
dynamic result = await MsgHttp.uploadBfs(
|
||||
path: _pathList[i],
|
||||
category: 'daily',
|
||||
biz: 'new_dyn',
|
||||
);
|
||||
if (result['status']) {
|
||||
int imageSize = await File(_pathList[i]).length();
|
||||
|
||||
Reference in New Issue
Block a user