chore: Minor story viewer fixes

This commit is contained in:
Krille Fear 2022-03-10 17:28:53 +01:00
parent acb94772ac
commit 286d953d38

View File

@ -172,15 +172,7 @@ class StoryView extends StatelessWidget {
controller.loadingModeOff(); controller.loadingModeOff();
} }
final hash = event.infoMap['xyz.amorgan.blurhash']; final hash = event.infoMap['xyz.amorgan.blurhash'];
return GestureDetector( return Stack(
onTapDown: controller.hold,
onTapUp: controller.unhold,
onTapCancel: controller.unhold,
onVerticalDragStart: controller.hold,
onVerticalDragEnd: controller.unhold,
onHorizontalDragStart: controller.hold,
onHorizontalDragEnd: controller.unhold,
child: Stack(
children: [ children: [
if (hash is String) if (hash is String)
BlurHash( BlurHash(
@ -204,8 +196,7 @@ class StoryView extends StatelessWidget {
return Container(); return Container();
} }
controller.loadingModeOff(); controller.loadingModeOff();
return Center( return Center(child: VideoPlayer(videoPlayerController));
child: VideoPlayer(videoPlayerController));
}, },
), ),
), ),
@ -230,7 +221,15 @@ class StoryView extends StatelessWidget {
); );
}, },
), ),
AnimatedContainer( GestureDetector(
onTapDown: controller.hold,
onTapUp: controller.unhold,
onTapCancel: controller.unhold,
onVerticalDragStart: controller.hold,
onVerticalDragEnd: controller.unhold,
onHorizontalDragStart: controller.hold,
onHorizontalDragEnd: controller.unhold,
child: AnimatedContainer(
duration: const Duration(milliseconds: 200), duration: const Duration(milliseconds: 200),
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 8.0, horizontal: 8.0,
@ -275,6 +274,7 @@ class StoryView extends StatelessWidget {
), ),
), ),
), ),
),
Positioned( Positioned(
top: 4, top: 4,
left: 4, left: 4,
@ -317,8 +317,6 @@ class StoryView extends StatelessWidget {
child: TextField( child: TextField(
focusNode: controller.replyFocus, focusNode: controller.replyFocus,
controller: controller.replyController, controller: controller.replyController,
minLines: 1,
maxLines: 7,
onSubmitted: controller.replyAction, onSubmitted: controller.replyAction,
textInputAction: TextInputAction.send, textInputAction: TextInputAction.send,
readOnly: controller.replyLoading, readOnly: controller.replyLoading,
@ -329,8 +327,14 @@ class StoryView extends StatelessWidget {
icon: const Icon(Icons.emoji_emotions_outlined), icon: const Icon(Icons.emoji_emotions_outlined),
), ),
suffixIcon: controller.replyLoading suffixIcon: controller.replyLoading
? const CircularProgressIndicator.adaptive( ? const SizedBox(
strokeWidth: 2) width: 16,
height: 16,
child: Center(
child: CircularProgressIndicator.adaptive(
strokeWidth: 2),
),
)
: IconButton( : IconButton(
onPressed: controller.replyAction, onPressed: controller.replyAction,
icon: const Icon(Icons.send_outlined), icon: const Icon(Icons.send_outlined),
@ -360,7 +364,6 @@ class StoryView extends StatelessWidget {
), ),
), ),
], ],
),
); );
}, },
), ),