mod: 表情体验优化,代码整理

This commit is contained in:
orz12
2024-02-26 09:38:11 +08:00
parent f2805553ec
commit 11988a4f8e
13 changed files with 318 additions and 144 deletions

View File

@@ -1,11 +1,8 @@
import 'dart:async';
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:get/get.dart';
import 'package:PiliPalaX/common/skeleton/video_reply.dart';
import 'package:PiliPalaX/common/widgets/http_error.dart';
import 'package:PiliPalaX/models/common/reply_type.dart';
import 'package:PiliPalaX/pages/video/detail/index.dart';
import 'package:PiliPalaX/pages/video/detail/reply_new/index.dart';

View File

@@ -951,7 +951,6 @@ class MorePanel extends StatelessWidget {
@override
Widget build(BuildContext context) {
Color errorColor = Theme.of(context).colorScheme.error;
return Container(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
child: Column(

View File

@@ -102,7 +102,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
_replyContentController.value = TextEditingValue(
text: newText,
selection:
TextSelection.collapsed(offset: cursorPosition + emote.text!.length),
TextSelection.collapsed(offset: cursorPosition + emote.text!.length),
);
}
@@ -118,7 +118,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
if (keyboardHeight == 0 && emoteHeight == 0) {
setState(() {
emoteHeight = keyboardHeight =
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
});
}
}
@@ -221,15 +221,11 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
],
),
),
AnimatedSize(
curve: Curves.easeInOut,
duration: const Duration(milliseconds: 300),
child: SizedBox(
width: double.infinity,
height: toolbarType == 'input' ? keyboardHeight : emoteHeight,
child: EmotePanel(
onChoose: (package, emote) => onChooseEmote(package, emote),
),
SizedBox(
width: double.infinity,
height: toolbarType == 'input' ? keyboardHeight : emoteHeight,
child: EmotePanel(
onChoose: (package, emote) => onChooseEmote(package, emote),
),
),
],
@@ -255,4 +251,4 @@ class Debouncer {
callback();
});
}
}
}