mod: 更多回复键盘弹起样式
This commit is contained in:
@ -47,8 +47,7 @@ class VideoDetailController extends GetxController {
|
||||
|
||||
showReplyReplyPanel() {
|
||||
PersistentBottomSheetController<void>? ctr = scaffoldKey.currentState?.showBottomSheet<void>((BuildContext context) {
|
||||
return
|
||||
VideoReplyReplyPanel(
|
||||
return VideoReplyReplyPanel(
|
||||
oid: oid,
|
||||
rpid: fRpid,
|
||||
closePanel: ()=> {
|
||||
|
@ -23,7 +23,7 @@ class ReplyItem extends StatelessWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(12, 6, 8, 0),
|
||||
padding: const EdgeInsets.fromLTRB(12, 2, 8, 0),
|
||||
child: content(context),
|
||||
),
|
||||
// Divider(
|
||||
|
@ -69,8 +69,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
||||
);
|
||||
if (result['status']) {
|
||||
SmartDialog.showToast(result['data']['success_toast']);
|
||||
} else {
|
||||
}
|
||||
} else {}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -95,45 +94,24 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: MediaQuery.of(context).size.height - MediaQuery.of(context).size.width * 9 / 16 - 48,
|
||||
height: MediaQuery.of(context).size.height -
|
||||
MediaQuery.of(context).size.width * 9 / 16 -
|
||||
45,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
topRight: Radius.circular(16),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.background),
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(16),
|
||||
topRight: Radius.circular(16),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 55,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const SizedBox(width: 20),
|
||||
Text('发表评论', style: Theme.of(context).textTheme.titleMedium),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
onPressed: () => Get.back(),
|
||||
icon: const Icon(Icons.close),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
],
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 12, right: 15, left: 15, bottom: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
top: 6, right: 15, left: 15, bottom: 10),
|
||||
child: Form(
|
||||
key: _formKey,
|
||||
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||||
@ -182,13 +160,14 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
||||
)),
|
||||
),
|
||||
const Spacer(),
|
||||
TextButton(onPressed: () => submitReplyAdd(), child: const Text('发送'))
|
||||
TextButton(
|
||||
onPressed: () => submitReplyAdd(), child: const Text('发送'))
|
||||
],
|
||||
),
|
||||
),
|
||||
AnimatedSize(
|
||||
curve: Curves.easeInOut,
|
||||
duration: const Duration(milliseconds: 500),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
height: _keyboardHeight,
|
||||
|
@ -60,7 +60,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
height: Get.size.height - Get.size.width * 9 / 16 - 48,
|
||||
height: Get.size.height - Get.size.width * 9 / 16 - 45,
|
||||
color: Theme.of(context).colorScheme.background,
|
||||
child: Column(
|
||||
children: [
|
||||
@ -101,6 +101,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
controller: _videoReplyReplyController.scrollController,
|
||||
slivers: <Widget>[
|
||||
if (widget.firstFloor != null) ...[
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 10)),
|
||||
SliverToBoxAdapter(
|
||||
child: ReplyItem(
|
||||
replyItem: widget.firstFloor,
|
||||
@ -109,7 +110,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
),
|
||||
SliverToBoxAdapter(
|
||||
child: Divider(
|
||||
height: 30,
|
||||
height: 20,
|
||||
color: Theme.of(context).dividerColor.withOpacity(0.1),
|
||||
thickness: 6,
|
||||
),
|
||||
@ -137,19 +138,22 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
height: MediaQuery.of(context)
|
||||
.padding
|
||||
.bottom +
|
||||
60,
|
||||
100,
|
||||
child: Center(
|
||||
child: Obx(() => Text(
|
||||
_videoReplyReplyController
|
||||
.noMore.value
|
||||
? '没有更多了'
|
||||
: '加载中')),
|
||||
child: Obx(
|
||||
() => Text(_videoReplyReplyController
|
||||
.noMore.value
|
||||
? '没有更多了'
|
||||
: '加载中'),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return ReplyItem(
|
||||
replyItem: _videoReplyReplyController
|
||||
.replyList[index],
|
||||
return Material(
|
||||
child: ReplyItem(
|
||||
replyItem: _videoReplyReplyController
|
||||
.replyList[index],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -40,6 +40,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: Stack(
|
||||
children: [
|
||||
Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
key: videoDetailController.scaffoldKey,
|
||||
body: ExtendedNestedScrollView(
|
||||
headerSliverBuilder:
|
||||
@ -55,6 +56,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
MediaQuery.of(context).size.width * 9 / 16,
|
||||
collapsedHeight:
|
||||
MediaQuery.of(context).size.width * 9 / 16,
|
||||
backgroundColor: Colors.black,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
background: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
@ -68,6 +70,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
return Hero(
|
||||
tag: videoDetailController.heroTag,
|
||||
child: NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
|
Reference in New Issue
Block a user