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