|
|
|
@ -32,10 +32,7 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
icon: const Icon(Icons.close),
|
|
|
|
|
onPressed: Navigator.of(context).pop,
|
|
|
|
|
),
|
|
|
|
|
title: AnimatedOpacity(
|
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
|
opacity: controller.isHold ? 0 : 1,
|
|
|
|
|
child: ListTile(
|
|
|
|
|
title: ListTile(
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
title: Text(
|
|
|
|
|
controller.title,
|
|
|
|
@ -70,23 +67,15 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
name: controller.title,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
actions: currentEvent == null
|
|
|
|
|
? null
|
|
|
|
|
: [
|
|
|
|
|
if (!controller.isOwnStory)
|
|
|
|
|
AnimatedOpacity(
|
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
|
opacity: controller.isHold ? 0 : 1,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(Icons.adaptive.share_outlined),
|
|
|
|
|
onPressed: controller.share,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AnimatedOpacity(
|
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
|
opacity: controller.isHold ? 0 : 1,
|
|
|
|
|
child: PopupMenuButton<PopupStoryAction>(
|
|
|
|
|
PopupMenuButton<PopupStoryAction>(
|
|
|
|
|
onSelected: controller.onPopupStoryAction,
|
|
|
|
|
itemBuilder: (context) => [
|
|
|
|
|
if (controller.currentEvent?.canRedact ?? false)
|
|
|
|
@ -99,7 +88,7 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
child: Text(L10n.of(context)!.reportMessage),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
systemOverlayStyle: SystemUiOverlayStyle.light,
|
|
|
|
|
iconTheme: const IconThemeData(color: Colors.white),
|
|
|
|
@ -155,14 +144,25 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
if (event.messageType == MessageTypes.Text) {
|
|
|
|
|
controller.loadingModeOff();
|
|
|
|
|
}
|
|
|
|
|
final hash = event.infoMap['xyz.amorgan.blurhash'];
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTapDown: controller.hold,
|
|
|
|
|
onTapUp: controller.unhold,
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
if (hash is String)
|
|
|
|
|
BlurHash(
|
|
|
|
|
hash: hash,
|
|
|
|
|
imageFit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
if (event.messageType == MessageTypes.Video &&
|
|
|
|
|
PlatformInfos.isMobile)
|
|
|
|
|
FutureBuilder<VideoPlayerController?>(
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 80,
|
|
|
|
|
bottom: 64,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: FutureBuilder<VideoPlayerController?>(
|
|
|
|
|
future: controller.loadVideoControllerFuture ??=
|
|
|
|
|
controller.loadVideoController(event),
|
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
@ -172,15 +172,17 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
|
|
|
|
controller.loadingModeOff();
|
|
|
|
|
return Center(child: VideoPlayer(videoPlayerController));
|
|
|
|
|
return Center(
|
|
|
|
|
child: VideoPlayer(videoPlayerController));
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (event.messageType == MessageTypes.Image ||
|
|
|
|
|
(event.messageType == MessageTypes.Video &&
|
|
|
|
|
!PlatformInfos.isMobile))
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 0,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
top: 80,
|
|
|
|
|
bottom: 64,
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
|
child: FutureBuilder<MatrixFile>(
|
|
|
|
@ -190,13 +192,7 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
final matrixFile = snapshot.data;
|
|
|
|
|
if (matrixFile == null) {
|
|
|
|
|
controller.loadingModeOn();
|
|
|
|
|
final hash = event.infoMap['xyz.amorgan.blurhash'];
|
|
|
|
|
return hash is String
|
|
|
|
|
? BlurHash(
|
|
|
|
|
hash: hash,
|
|
|
|
|
imageFit: BoxFit.cover,
|
|
|
|
|
)
|
|
|
|
|
: Container();
|
|
|
|
|
return Container();
|
|
|
|
|
}
|
|
|
|
|
controller.loadingModeOff();
|
|
|
|
|
return Center(
|
|
|
|
@ -210,7 +206,10 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
AnimatedContainer(
|
|
|
|
|
duration: const Duration(milliseconds: 200),
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
padding: const EdgeInsets.symmetric(
|
|
|
|
|
horizontal: 8.0,
|
|
|
|
|
vertical: 64,
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
gradient: event.messageType == MessageTypes.Text
|
|
|
|
|
? LinearGradient(
|
|
|
|
@ -259,9 +258,6 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
top: 4,
|
|
|
|
|
left: 4,
|
|
|
|
|
right: 4,
|
|
|
|
|
child: AnimatedOpacity(
|
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
|
opacity: controller.isHold ? 0 : 1,
|
|
|
|
|
child: SafeArea(
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
@ -291,15 +287,11 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (!controller.isOwnStory && currentEvent != null)
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 16,
|
|
|
|
|
left: 16,
|
|
|
|
|
right: 16,
|
|
|
|
|
child: AnimatedOpacity(
|
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
|
opacity: controller.isHold ? 0 : 1,
|
|
|
|
|
child: SafeArea(
|
|
|
|
|
child: TextField(
|
|
|
|
|
focusNode: controller.replyFocus,
|
|
|
|
@ -326,16 +318,12 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (controller.isOwnStory &&
|
|
|
|
|
controller.currentSeenByUsers.isNotEmpty)
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: 16,
|
|
|
|
|
left: 16,
|
|
|
|
|
right: 16,
|
|
|
|
|
child: AnimatedOpacity(
|
|
|
|
|
duration: const Duration(seconds: 1),
|
|
|
|
|
opacity: controller.isHold ? 0 : 1,
|
|
|
|
|
child: SafeArea(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: OutlinedButton.icon(
|
|
|
|
@ -350,7 +338,6 @@ class StoryView extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|