fix: Improve story page appearance

This commit is contained in:
Reinhart Previano Koentjoro 2022-12-23 11:58:40 +07:00
parent 5efff9a1e9
commit 857eea428e

View File

@ -1,3 +1,4 @@
import 'package:fluffychat/config/app_config.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -105,6 +106,10 @@ class StoryView extends StatelessWidget {
M2PopupMenuButton<PopupStoryAction>( M2PopupMenuButton<PopupStoryAction>(
color: Colors.white, color: Colors.white,
onSelected: controller.onPopupStoryAction, onSelected: controller.onPopupStoryAction,
icon: Icon(
Icons.adaptive.more_outlined,
color: Colors.white,
),
itemBuilder: (context) => [ itemBuilder: (context) => [
if (controller.currentEvent?.canRedact ?? false) if (controller.currentEvent?.canRedact ?? false)
PopupMenuItem( PopupMenuItem(
@ -303,7 +308,8 @@ class StoryView extends StatelessWidget {
? LinearProgressIndicator( ? LinearProgressIndicator(
color: Colors.white, color: Colors.white,
minHeight: 2, minHeight: 2,
backgroundColor: Colors.grey.shade600, backgroundColor:
Colors.white.withOpacity(0.25),
value: controller.loadingMode value: controller.loadingMode
? null ? null
: controller.progress.inMilliseconds / : controller.progress.inMilliseconds /
@ -315,7 +321,7 @@ class StoryView extends StatelessWidget {
height: 2, height: 2,
color: i < controller.index color: i < controller.index
? Colors.white ? Colors.white
: Colors.grey.shade600, : Colors.white.withOpacity(0.25),
), ),
), ),
], ],
@ -324,10 +330,18 @@ class StoryView extends StatelessWidget {
), ),
if (!controller.isOwnStory && currentEvent != null) if (!controller.isOwnStory && currentEvent != null)
Positioned( Positioned(
bottom: 16, bottom: 8,
left: 16, left: 8,
right: 16, right: 8,
child: SafeArea( child: SafeArea(
child: Material(
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(AppConfig.borderRadius),
bottomRight: Radius.circular(AppConfig.borderRadius),
),
shadowColor: Colors.black.withAlpha(64),
clipBehavior: Clip.hardEdge,
elevation: 4,
child: TextField( child: TextField(
focusNode: controller.replyFocus, focusNode: controller.replyFocus,
controller: controller.replyController, controller: controller.replyController,
@ -335,6 +349,8 @@ class StoryView extends StatelessWidget {
textInputAction: TextInputAction.send, textInputAction: TextInputAction.send,
readOnly: controller.replyLoading, readOnly: controller.replyLoading,
decoration: InputDecoration( decoration: InputDecoration(
contentPadding:
const EdgeInsets.fromLTRB(0, 16, 0, 16),
hintText: L10n.of(context)!.reply, hintText: L10n.of(context)!.reply,
prefixIcon: IconButton( prefixIcon: IconButton(
onPressed: controller.replyEmojiAction, onPressed: controller.replyEmojiAction,
@ -358,6 +374,7 @@ class StoryView extends StatelessWidget {
), ),
), ),
), ),
),
if (controller.isOwnStory && if (controller.isOwnStory &&
controller.currentSeenByUsers.isNotEmpty) controller.currentSeenByUsers.isNotEmpty)
Positioned( Positioned(